Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv29987
Modified Files:
ai.cpp ai.h dragdrop.cpp dragdrop.h uobject.h
Log Message:
Removed all old singletons and changed dragdrop into a namespace.
Index: ai.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** ai.cpp 8 Sep 2003 10:58:46 -0000 1.18
--- ai.cpp 13 Sep 2003 13:37:15 -0000 1.19
***************
*** 48,52 ****
#include <vector>
! void AIFactory::checkScriptAI( const QStringList &oldSections, const QStringList &newSections )
{
QStringList::const_iterator aiit = oldSections.begin();
--- 48,52 ----
#include <vector>
! void cAIFactory::checkScriptAI( const QStringList &oldSections, const QStringList &newSections )
{
QStringList::const_iterator aiit = oldSections.begin();
Index: ai.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** ai.h 9 Sep 2003 17:22:55 -0000 1.17
--- ai.h 13 Sep 2003 13:37:15 -0000 1.18
***************
*** 40,43 ****
--- 40,44 ----
#include "factory.h"
#include "definable.h"
+ #include "singleton.h"
// library includes
***************
*** 129,143 ****
};
! class AIFactory : public Factory< AbstractAI, QString >
{
public:
- static AIFactory* instance()
- {
- static AIFactory factory;
- return &factory;
- }
-
void checkScriptAI( const QStringList &oldSections, const QStringList &newSections );
};
class Action_Wander : public AbstractAction
--- 130,140 ----
};
! class cAIFactory : public Factory< AbstractAI, QString >
{
public:
void checkScriptAI( const QStringList &oldSections, const QStringList &newSections );
};
+
+ typedef SingletonHolder< cAIFactory > AIFactory;
class Action_Wander : public AbstractAction
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.199
retrieving revision 1.200
diff -C2 -d -r1.199 -r1.200
*** dragdrop.cpp 11 Sep 2003 15:33:58 -0000 1.199
--- dragdrop.cpp 13 Sep 2003 13:37:15 -0000 1.200
***************
*** 54,58 ****
// New Class implementation
! void cDragItems::grabItem( cUOSocket *socket, cUORxDragItem *packet )
{
// Get our character
--- 54,58 ----
// New Class implementation
! void DragAndDrop::grabItem( cUOSocket *socket, cUORxDragItem *packet )
{
// Get our character
***************
*** 253,257 ****
}
! void cDragItems::bounceItem( cUOSocket* socket, P_ITEM pItem, bool denyMove )
{
// Reject the move of the item
--- 253,257 ----
}
! void DragAndDrop::bounceItem( cUOSocket* socket, P_ITEM pItem, bool denyMove )
{
// Reject the move of the item
***************
*** 277,281 ****
}
! void cDragItems::equipItem( cUOSocket *socket, cUORxWearItem *packet )
{
P_ITEM pItem = FindItemBySerial( packet->serial() );
--- 277,281 ----
}
! void DragAndDrop::equipItem( cUOSocket *socket, cUORxWearItem *packet )
{
P_ITEM pItem = FindItemBySerial( packet->serial() );
***************
*** 419,423 ****
}
! void cDragItems::dropItem( cUOSocket *socket, cUORxDropItem *packet )
{
P_PLAYER pChar = socket->player();
--- 419,423 ----
}
! void DragAndDrop::dropItem( cUOSocket *socket, cUORxDropItem *packet )
{
P_PLAYER pChar = socket->player();
***************
*** 475,479 ****
}
! void cDragItems::dropOnChar( cUOSocket *socket, P_ITEM pItem, P_CHAR pOtherChar )
{
// Three possibilities:
--- 475,479 ----
}
! void DragAndDrop::dropOnChar( cUOSocket *socket, P_ITEM pItem, P_CHAR pOtherChar )
{
// Three possibilities:
***************
*** 585,589 ****
}
! void cDragItems::dropOnGround( cUOSocket *socket, P_ITEM pItem, const Coord_cl &pos )
{
P_PLAYER pChar = socket->player();
--- 585,589 ----
}
! void DragAndDrop::dropOnGround( cUOSocket *socket, P_ITEM pItem, const Coord_cl &pos )
{
P_PLAYER pChar = socket->player();
***************
*** 634,638 ****
}
! void cDragItems::dropOnItem( cUOSocket *socket, P_ITEM pItem, P_ITEM pCont, const Coord_cl &dropPos )
{
P_PLAYER pChar = socket->player();
--- 634,638 ----
}
! void DragAndDrop::dropOnItem( cUOSocket *socket, P_ITEM pItem, P_ITEM pCont, const Coord_cl &dropPos )
{
P_PLAYER pChar = socket->player();
***************
*** 795,799 ****
// Food was dropped on a pet
! void cDragItems::dropFoodOnChar( cUOSocket* socket, P_ITEM pItem, P_CHAR pChar )
{
// Feed our pets
--- 795,799 ----
// Food was dropped on a pet
! void DragAndDrop::dropFoodOnChar( cUOSocket* socket, P_ITEM pItem, P_CHAR pChar )
{
// Feed our pets
***************
*** 843,847 ****
}
! void cDragItems::dropOnBeggar( cUOSocket* socket, P_ITEM pItem, P_CHAR pBeggar )
{
int tempint;
--- 843,847 ----
}
! void DragAndDrop::dropOnBeggar( cUOSocket* socket, P_ITEM pItem, P_CHAR pBeggar )
{
int tempint;
***************
*** 917,921 ****
}
! void cDragItems::dropOnBroker( cUOSocket* socket, P_ITEM pItem, P_CHAR pBroker )
{
// For House and Boat deeds we should pay back 75% of the value
--- 917,921 ----
}
! void DragAndDrop::dropOnBroker( cUOSocket* socket, P_ITEM pItem, P_CHAR pBroker )
{
// For House and Boat deeds we should pay back 75% of the value
***************
*** 938,946 ****
}
! void cDragItems::dropOnBanker( cUOSocket* socket, P_ITEM pItem, P_CHAR pBanker )
{
}
! void cDragItems::dropOnTrainer( cUOSocket* socket, P_ITEM pItem, P_CHAR pTrainer )
{
}
--- 938,946 ----
}
! void DragAndDrop::dropOnBanker( cUOSocket* socket, P_ITEM pItem, P_CHAR pBanker )
{
}
! void DragAndDrop::dropOnTrainer( cUOSocket* socket, P_ITEM pItem, P_CHAR pTrainer )
{
}
Index: dragdrop.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** dragdrop.h 19 May 2003 11:26:33 -0000 1.18
--- dragdrop.h 13 Sep 2003 13:37:15 -0000 1.19
***************
*** 40,46 ****
class cUORxWearItem;
! class cDragItems
{
- public:
void grabItem( cUOSocket*, cUORxDragItem* );
void equipItem( cUOSocket*, cUORxWearItem* );
--- 40,45 ----
class cUORxWearItem;
! namespace DragAndDrop
{
void grabItem( cUOSocket*, cUORxDragItem* );
void equipItem( cUOSocket*, cUORxWearItem* );
***************
*** 60,69 ****
void bounceItem( cUOSocket* socket, P_ITEM pi, bool denyMove = false );
-
- static cDragItems *getInstance( void )
- {
- static cDragItems instance;
- return &instance;
- }
};
--- 59,62 ----
Index: uobject.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.h,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -d -r1.74 -r1.75
*** uobject.h 27 Aug 2003 20:35:10 -0000 1.74
--- uobject.h 13 Sep 2003 13:37:15 -0000 1.75
***************
*** 37,40 ****
--- 37,41 ----
#include "persistentobject.h"
#include "definable.h"
+ #include "singleton.h"
#include "customtags.h"
#include "factory.h"
***************
*** 177,189 ****
! class UObjectFactory : public Factory<cUObject, QString>
{
public:
- static UObjectFactory* instance()
- {
- static UObjectFactory factory;
- return &factory;
- }
-
void registerSqlQuery( const QString &type, const QString &query )
{
--- 178,184 ----
! class cUObjectFactory : public Factory<cUObject, QString>
{
public:
void registerSqlQuery( const QString &type, const QString &query )
{
***************
*** 212,215 ****
--- 207,211 ----
};
+ typedef SingletonHolder< cUObjectFactory > UObjectFactory;
struct stError
|