2006-01-19 Al Riddoch <alriddoch@zepler.org>
* aiclient/ClientAccount.cpp, aiclient/ClientAccount.h,
aiclient/ClientConnection.cpp, aiclient/ClientConnection.h,
aiclient/client.cpp, aiclient/client.h, client/BaseClient.cpp,
client/BaseClient.h, client/CharacterClient.cpp,
client/CharacterClient.h, client/ClientConnection.cpp,
client/ClientConnection.h, client/CreatorClient.cpp,
client/CreatorClient.h, client/ObserverClient.cpp,
client/ObserverClient.h, client/Py_CreatorClient.cpp,
client/Py_CreatorClient.h, client/client.cpp,
client/define_world.cpp, client/define_world.h, common/Add.h,
common/Affect.h, common/AtlasFileLoader.cpp,
common/AtlasFileLoader.h, common/Attack.h, common/BaseEntity.cpp,
common/BaseEntity.h, common/BaseWorld.cpp, common/BaseWorld.h,
common/Burn.h, common/Chop.h, common/Connect.h, common/CustomOp.cpp,
common/CustomOp.h, common/CustomOp_impl.h, common/Cut.h,
common/Database.cpp, common/Database.h, common/Delve.h, common/Dig.h,
common/Eat.h, common/FormattedXMLWriter.cpp,
common/FormattedXMLWriter.h, common/Generic.h, common/Load.h,
common/Monitor.h, common/Mow.h, common/Nourish.h,
common/OOGThing.cpp, common/OOGThing.h, common/Property.cpp,
common/Property.h, common/Property_impl.h, common/Save.h,
common/Setup.h, common/Tick.h, common/Unseen.h, common/Update.h,
common/Use.h, common/Wield.h, common/accountbase.cpp,
common/accountbase.h, common/const.cpp, common/const.h,
common/custom.cpp, common/debug.h, common/globals.cpp,
common/globals.h, common/id.cpp, common/id.h, common/inheritance.cpp,
common/inheritance.h, common/inheritance_impl.h, common/log.cpp,
common/log.h, common/newid.cpp, common/nls.h, common/op_switch.h,
common/operations.cpp, common/operations.h, common/random.h,
common/refno.h, common/serialno.cpp, common/serialno.h,
common/system.cpp, common/system.h, common/terrain_utils.cpp,
common/terrain_utils.h, common/type_utils.h, common/types.h,
common/utility.cpp, common/utility.h, modules/DateTime.cpp,
modules/DateTime.h, modules/Location.cpp, modules/Location.h,
modules/WorldTime.cpp, modules/WorldTime.h, physics/BBox.cpp,
physics/BBox.h, physics/Collision.cpp, physics/Collision.h,
physics/Quaternion.cpp, physics/Quaternion.h, physics/Vector3D.cpp,
physics/Vector3D.h, physics/VectorPol.h, rulesets/Area.cpp,
rulesets/Area.h, rulesets/AreaProperty.cpp, rulesets/AreaProperty.h,
rulesets/ArithmeticScript.cpp, rulesets/ArithmeticScript.h,
rulesets/BaseMind.cpp, rulesets/BaseMind.h,
rulesets/CalendarProperty.cpp, rulesets/CalendarProperty.h,
rulesets/Character.cpp, rulesets/Character.h, rulesets/Combat.cpp,
rulesets/Combat.h, rulesets/Container.cpp, rulesets/Container.h,
rulesets/Creator.cpp, rulesets/Creator.h, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/EntityProperties.cpp,
rulesets/Entity_getLocation.h, rulesets/Fell.cpp, rulesets/Fell.h,
rulesets/Food.cpp, rulesets/Food.h, rulesets/Line.cpp,
rulesets/Line.h, rulesets/LineProperty.cpp, rulesets/LineProperty.h,
rulesets/MemEntity.cpp, rulesets/MemEntity.h, rulesets/MemMap.cpp,
rulesets/MemMap.h, rulesets/MemMap_methods.h,
rulesets/MindFactory.cpp, rulesets/MindFactory.h, rulesets/Missile.h,
rulesets/Motion.cpp, rulesets/Motion.h, rulesets/Movement.cpp,
rulesets/Movement.h, rulesets/Pedestrian.cpp, rulesets/Pedestrian.h,
rulesets/Plant.cpp, rulesets/Plant.h, rulesets/Py_BBox.cpp,
rulesets/Py_BBox.h, rulesets/Py_EntityWrapper.h,
rulesets/Py_Location.cpp, rulesets/Py_Location.h,
rulesets/Py_Map.cpp, rulesets/Py_Map.h, rulesets/Py_Mind.cpp,
rulesets/Py_Mind.h, rulesets/Py_Object.cpp, rulesets/Py_Object.h,
rulesets/Py_Operation.cpp, rulesets/Py_Operation.h,
rulesets/Py_Oplist.cpp, rulesets/Py_Oplist.h, rulesets/Py_Optime.cpp,
rulesets/Py_Optime.h, rulesets/Py_Point3D.cpp, rulesets/Py_Point3D.h,
rulesets/Py_Property.cpp, rulesets/Py_Property.h,
rulesets/Py_Quaternion.cpp, rulesets/Py_Quaternion.h,
rulesets/Py_RootEntity.cpp, rulesets/Py_RootEntity.h,
rulesets/Py_Statistics.cpp, rulesets/Py_Statistics.h,
rulesets/Py_Task.cpp, rulesets/Py_Task.h, rulesets/Py_Thing.cpp,
rulesets/Py_Thing.h, rulesets/Py_Vector3D.cpp,
rulesets/Py_Vector3D.h, rulesets/Py_World.cpp, rulesets/Py_World.h,
rulesets/Py_WorldTime.cpp, rulesets/Py_WorldTime.h,
rulesets/PythonArithmeticScript.cpp,
rulesets/PythonArithmeticScript.h, rulesets/PythonMindScript.cpp,
rulesets/PythonMindScript.h, rulesets/PythonScript.cpp,
rulesets/PythonScript.h, rulesets/PythonThingScript.cpp,
rulesets/PythonThingScript.h, rulesets/PythonWrapper.cpp,
rulesets/PythonWrapper.h, rulesets/Python_API.cpp,
rulesets/Python_API.h, rulesets/Python_Script_Utils.h,
rulesets/Script.cpp, rulesets/Script.h, rulesets/Stackable.cpp,
rulesets/Stackable.h, rulesets/Statistics.cpp, rulesets/Statistics.h,
rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h,
rulesets/Structure.cpp, rulesets/Structure.h, rulesets/Task.cpp,
rulesets/Task.h, rulesets/TaskScript.cpp, rulesets/TaskScript.h,
rulesets/TerrainProperty.cpp, rulesets/TerrainProperty.h,
rulesets/Thing.cpp, rulesets/Thing.h, rulesets/ThingFactory.cpp,
rulesets/ThingFactory.h, rulesets/World.cpp, rulesets/World.h,
rulesets/attributes.h, server/Account.cpp, server/Account.h,
server/Admin.cpp, server/Admin.h, server/ArithmeticFactory.cpp,
server/ArithmeticFactory.h, server/CommClient.cpp,
server/CommClient.h, server/CommIdleSocket.cpp,
server/CommIdleSocket.h, server/CommListener.cpp,
server/CommListener.h, server/CommLocalClient.cpp,
server/CommLocalClient.h, server/CommMDNSPublisher.cpp,
server/CommMDNSPublisher.h, server/CommMaster.cpp,
server/CommMaster.h, server/CommMetaClient.cpp,
server/CommMetaClient.h, server/CommPSQLSocket.cpp,
server/CommPSQLSocket.h, server/CommPeer.cpp,
server/CommPeer.h, server/CommPeerListener.cpp,
server/CommPeerListener.h, server/CommRemoteClient.cpp,
server/CommRemoteClient.h, server/CommServer.cpp,
server/CommServer.h, server/CommSlaveClient.cpp,
server/CommSlaveClient.h, server/CommSlaveListener.cpp,
server/CommSlaveListener.h, server/CommSocket.cpp,
server/CommSocket.h, server/CommUnixListener.cpp,
server/CommUnixListener.h, server/Connection.cpp,
server/Connection.h, server/Connection_methods.h,
server/EntityFactory.cpp, server/EntityFactory.h,
server/ExternalMind.cpp, server/ExternalMind.h,
server/Idle.cpp, server/Idle.h, server/Lobby.cpp, server/Lobby.h,
server/Master.cpp, server/Master.h, server/Peer.cpp, server/Peer.h,
server/Persistance.cpp, server/Persistance.h,
server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
server/PersistantThingFactory_impl.h, server/Persistor.cpp,
server/Persistor.h, server/Persistor_impl.h,
server/Player.cpp, server/Player.h, server/Restoration.cpp,
server/Restoration.h, server/Restorer.cpp, server/Restorer.h,
server/Restorer_impl.h, server/ScriptFactory.cpp,
server/ScriptFactory.h, server/ServerRouting.cpp,
server/ServerRouting.h, server/ServerRouting_methods.h,
server/SlaveClientConnection.cpp, server/SlaveClientConnection.h,
server/TaskFactory.cpp, server/TaskFactory.h,
server/TrustedConnection.cpp, server/TrustedConnection.h,
server/WorldRouter.cpp, server/WorldRouter.h,
server/server.cpp, server/server.h, server/slave.cpp,
tests/Areatest.cpp, tests/BaseEntitytest.cpp,
tests/Charactertest.cpp, tests/Containertest.cpp,
tests/Creatortest.cpp, tests/EntityExerciser.h,
tests/EntityFactorytest.cpp, tests/Entitytest.cpp,
tests/Foodtest.cpp, tests/IGEntityExerciser.h,
tests/Linetest.cpp, tests/Locationtest.cpp, tests/OOGThingtest.cpp,
tests/Planttest.cpp, tests/Propertytest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Tasktest.cpp, tests/TestWorld.h,
tests/Thingtest.cpp, tests/WorldTimetest.cpp, tests/Worldtest.cpp,
tests/allOperations.h, tests/collisiontest.cpp, tests/consttest.cpp,
tests/distancetest.cpp, tests/emergencetest.cpp,
tests/inheritancetest.cpp, tests/logtest.cpp, tests/randomtest.cpp,
tests/systemtest.cpp, tests/transformtest.cpp,
tests/type_utilstest.cpp, tests/utilitytest.cpp,
tools/AdminClient.cpp, tools/AdminClient.h, tools/cyaddrules.cpp,
tools/cycmd.cpp, tools/cyconfig.cpp, tools/cyconvertrules.cpp,
tools/cyctrl.cpp, tools/cydbload.cpp, tools/cydumprules.cpp,
tools/cyisoload.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp,
tools/cywatchdog.cpp: Replace the copyright and license statements
with new versions that include disclaimer of warranty, and
permit distribution under later versions of the GPL.
2006-01-19 02:17:06 +00:00
|
|
|
// Cyphesis Online RPG Server and AI Engine
|
2003-09-10 22:57:18 +00:00
|
|
|
// Copyright (C) 2003 Alistair Riddoch
|
2006-01-19 Al Riddoch <alriddoch@zepler.org>
* aiclient/ClientAccount.cpp, aiclient/ClientAccount.h,
aiclient/ClientConnection.cpp, aiclient/ClientConnection.h,
aiclient/client.cpp, aiclient/client.h, client/BaseClient.cpp,
client/BaseClient.h, client/CharacterClient.cpp,
client/CharacterClient.h, client/ClientConnection.cpp,
client/ClientConnection.h, client/CreatorClient.cpp,
client/CreatorClient.h, client/ObserverClient.cpp,
client/ObserverClient.h, client/Py_CreatorClient.cpp,
client/Py_CreatorClient.h, client/client.cpp,
client/define_world.cpp, client/define_world.h, common/Add.h,
common/Affect.h, common/AtlasFileLoader.cpp,
common/AtlasFileLoader.h, common/Attack.h, common/BaseEntity.cpp,
common/BaseEntity.h, common/BaseWorld.cpp, common/BaseWorld.h,
common/Burn.h, common/Chop.h, common/Connect.h, common/CustomOp.cpp,
common/CustomOp.h, common/CustomOp_impl.h, common/Cut.h,
common/Database.cpp, common/Database.h, common/Delve.h, common/Dig.h,
common/Eat.h, common/FormattedXMLWriter.cpp,
common/FormattedXMLWriter.h, common/Generic.h, common/Load.h,
common/Monitor.h, common/Mow.h, common/Nourish.h,
common/OOGThing.cpp, common/OOGThing.h, common/Property.cpp,
common/Property.h, common/Property_impl.h, common/Save.h,
common/Setup.h, common/Tick.h, common/Unseen.h, common/Update.h,
common/Use.h, common/Wield.h, common/accountbase.cpp,
common/accountbase.h, common/const.cpp, common/const.h,
common/custom.cpp, common/debug.h, common/globals.cpp,
common/globals.h, common/id.cpp, common/id.h, common/inheritance.cpp,
common/inheritance.h, common/inheritance_impl.h, common/log.cpp,
common/log.h, common/newid.cpp, common/nls.h, common/op_switch.h,
common/operations.cpp, common/operations.h, common/random.h,
common/refno.h, common/serialno.cpp, common/serialno.h,
common/system.cpp, common/system.h, common/terrain_utils.cpp,
common/terrain_utils.h, common/type_utils.h, common/types.h,
common/utility.cpp, common/utility.h, modules/DateTime.cpp,
modules/DateTime.h, modules/Location.cpp, modules/Location.h,
modules/WorldTime.cpp, modules/WorldTime.h, physics/BBox.cpp,
physics/BBox.h, physics/Collision.cpp, physics/Collision.h,
physics/Quaternion.cpp, physics/Quaternion.h, physics/Vector3D.cpp,
physics/Vector3D.h, physics/VectorPol.h, rulesets/Area.cpp,
rulesets/Area.h, rulesets/AreaProperty.cpp, rulesets/AreaProperty.h,
rulesets/ArithmeticScript.cpp, rulesets/ArithmeticScript.h,
rulesets/BaseMind.cpp, rulesets/BaseMind.h,
rulesets/CalendarProperty.cpp, rulesets/CalendarProperty.h,
rulesets/Character.cpp, rulesets/Character.h, rulesets/Combat.cpp,
rulesets/Combat.h, rulesets/Container.cpp, rulesets/Container.h,
rulesets/Creator.cpp, rulesets/Creator.h, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/EntityProperties.cpp,
rulesets/Entity_getLocation.h, rulesets/Fell.cpp, rulesets/Fell.h,
rulesets/Food.cpp, rulesets/Food.h, rulesets/Line.cpp,
rulesets/Line.h, rulesets/LineProperty.cpp, rulesets/LineProperty.h,
rulesets/MemEntity.cpp, rulesets/MemEntity.h, rulesets/MemMap.cpp,
rulesets/MemMap.h, rulesets/MemMap_methods.h,
rulesets/MindFactory.cpp, rulesets/MindFactory.h, rulesets/Missile.h,
rulesets/Motion.cpp, rulesets/Motion.h, rulesets/Movement.cpp,
rulesets/Movement.h, rulesets/Pedestrian.cpp, rulesets/Pedestrian.h,
rulesets/Plant.cpp, rulesets/Plant.h, rulesets/Py_BBox.cpp,
rulesets/Py_BBox.h, rulesets/Py_EntityWrapper.h,
rulesets/Py_Location.cpp, rulesets/Py_Location.h,
rulesets/Py_Map.cpp, rulesets/Py_Map.h, rulesets/Py_Mind.cpp,
rulesets/Py_Mind.h, rulesets/Py_Object.cpp, rulesets/Py_Object.h,
rulesets/Py_Operation.cpp, rulesets/Py_Operation.h,
rulesets/Py_Oplist.cpp, rulesets/Py_Oplist.h, rulesets/Py_Optime.cpp,
rulesets/Py_Optime.h, rulesets/Py_Point3D.cpp, rulesets/Py_Point3D.h,
rulesets/Py_Property.cpp, rulesets/Py_Property.h,
rulesets/Py_Quaternion.cpp, rulesets/Py_Quaternion.h,
rulesets/Py_RootEntity.cpp, rulesets/Py_RootEntity.h,
rulesets/Py_Statistics.cpp, rulesets/Py_Statistics.h,
rulesets/Py_Task.cpp, rulesets/Py_Task.h, rulesets/Py_Thing.cpp,
rulesets/Py_Thing.h, rulesets/Py_Vector3D.cpp,
rulesets/Py_Vector3D.h, rulesets/Py_World.cpp, rulesets/Py_World.h,
rulesets/Py_WorldTime.cpp, rulesets/Py_WorldTime.h,
rulesets/PythonArithmeticScript.cpp,
rulesets/PythonArithmeticScript.h, rulesets/PythonMindScript.cpp,
rulesets/PythonMindScript.h, rulesets/PythonScript.cpp,
rulesets/PythonScript.h, rulesets/PythonThingScript.cpp,
rulesets/PythonThingScript.h, rulesets/PythonWrapper.cpp,
rulesets/PythonWrapper.h, rulesets/Python_API.cpp,
rulesets/Python_API.h, rulesets/Python_Script_Utils.h,
rulesets/Script.cpp, rulesets/Script.h, rulesets/Stackable.cpp,
rulesets/Stackable.h, rulesets/Statistics.cpp, rulesets/Statistics.h,
rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h,
rulesets/Structure.cpp, rulesets/Structure.h, rulesets/Task.cpp,
rulesets/Task.h, rulesets/TaskScript.cpp, rulesets/TaskScript.h,
rulesets/TerrainProperty.cpp, rulesets/TerrainProperty.h,
rulesets/Thing.cpp, rulesets/Thing.h, rulesets/ThingFactory.cpp,
rulesets/ThingFactory.h, rulesets/World.cpp, rulesets/World.h,
rulesets/attributes.h, server/Account.cpp, server/Account.h,
server/Admin.cpp, server/Admin.h, server/ArithmeticFactory.cpp,
server/ArithmeticFactory.h, server/CommClient.cpp,
server/CommClient.h, server/CommIdleSocket.cpp,
server/CommIdleSocket.h, server/CommListener.cpp,
server/CommListener.h, server/CommLocalClient.cpp,
server/CommLocalClient.h, server/CommMDNSPublisher.cpp,
server/CommMDNSPublisher.h, server/CommMaster.cpp,
server/CommMaster.h, server/CommMetaClient.cpp,
server/CommMetaClient.h, server/CommPSQLSocket.cpp,
server/CommPSQLSocket.h, server/CommPeer.cpp,
server/CommPeer.h, server/CommPeerListener.cpp,
server/CommPeerListener.h, server/CommRemoteClient.cpp,
server/CommRemoteClient.h, server/CommServer.cpp,
server/CommServer.h, server/CommSlaveClient.cpp,
server/CommSlaveClient.h, server/CommSlaveListener.cpp,
server/CommSlaveListener.h, server/CommSocket.cpp,
server/CommSocket.h, server/CommUnixListener.cpp,
server/CommUnixListener.h, server/Connection.cpp,
server/Connection.h, server/Connection_methods.h,
server/EntityFactory.cpp, server/EntityFactory.h,
server/ExternalMind.cpp, server/ExternalMind.h,
server/Idle.cpp, server/Idle.h, server/Lobby.cpp, server/Lobby.h,
server/Master.cpp, server/Master.h, server/Peer.cpp, server/Peer.h,
server/Persistance.cpp, server/Persistance.h,
server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
server/PersistantThingFactory_impl.h, server/Persistor.cpp,
server/Persistor.h, server/Persistor_impl.h,
server/Player.cpp, server/Player.h, server/Restoration.cpp,
server/Restoration.h, server/Restorer.cpp, server/Restorer.h,
server/Restorer_impl.h, server/ScriptFactory.cpp,
server/ScriptFactory.h, server/ServerRouting.cpp,
server/ServerRouting.h, server/ServerRouting_methods.h,
server/SlaveClientConnection.cpp, server/SlaveClientConnection.h,
server/TaskFactory.cpp, server/TaskFactory.h,
server/TrustedConnection.cpp, server/TrustedConnection.h,
server/WorldRouter.cpp, server/WorldRouter.h,
server/server.cpp, server/server.h, server/slave.cpp,
tests/Areatest.cpp, tests/BaseEntitytest.cpp,
tests/Charactertest.cpp, tests/Containertest.cpp,
tests/Creatortest.cpp, tests/EntityExerciser.h,
tests/EntityFactorytest.cpp, tests/Entitytest.cpp,
tests/Foodtest.cpp, tests/IGEntityExerciser.h,
tests/Linetest.cpp, tests/Locationtest.cpp, tests/OOGThingtest.cpp,
tests/Planttest.cpp, tests/Propertytest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Tasktest.cpp, tests/TestWorld.h,
tests/Thingtest.cpp, tests/WorldTimetest.cpp, tests/Worldtest.cpp,
tests/allOperations.h, tests/collisiontest.cpp, tests/consttest.cpp,
tests/distancetest.cpp, tests/emergencetest.cpp,
tests/inheritancetest.cpp, tests/logtest.cpp, tests/randomtest.cpp,
tests/systemtest.cpp, tests/transformtest.cpp,
tests/type_utilstest.cpp, tests/utilitytest.cpp,
tools/AdminClient.cpp, tools/AdminClient.h, tools/cyaddrules.cpp,
tools/cycmd.cpp, tools/cyconfig.cpp, tools/cyconvertrules.cpp,
tools/cyctrl.cpp, tools/cydbload.cpp, tools/cydumprules.cpp,
tools/cyisoload.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp,
tools/cywatchdog.cpp: Replace the copyright and license statements
with new versions that include disclaimer of warranty, and
permit distribution under later versions of the GPL.
2006-01-19 02:17:06 +00:00
|
|
|
//
|
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
// along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2003-09-10 22:57:18 +00:00
|
|
|
|
2008-09-08 11:49:22 +00:00
|
|
|
// $Id$
|
2006-10-26 00:48:00 +00:00
|
|
|
|
2011-02-15 09:30:46 +00:00
|
|
|
#ifdef NDEBUG
|
|
|
|
|
#undef NDEBUG
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef DEBUG
|
|
|
|
|
#define DEBUG
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-09-10 22:57:18 +00:00
|
|
|
#include "IGEntityExerciser.h"
|
|
|
|
|
#include "allOperations.h"
|
|
|
|
|
|
|
|
|
|
#include "rulesets/Structure.h"
|
|
|
|
|
|
2007-12-31 18:31:26 +00:00
|
|
|
#include "common/TypeNode.h"
|
|
|
|
|
|
2003-09-10 22:57:18 +00:00
|
|
|
#include <cassert>
|
|
|
|
|
|
2004-12-03 Al Riddoch <alriddoch@zepler.org>
* client/BaseClient.cpp, client/BaseClient.h,
client/CharacterClient.cpp, client/CharacterClient.h,
client/ClientConnection.cpp, client/ClientConnection.h,
client/CreatorClient.cpp, client/CreatorClient.h,
client/Py_CreatorClient.cpp, common/BaseEntity.cpp,
common/BaseEntity.h, common/BaseWorld.h, common/custom.cpp,
common/inheritance.cpp, common/inheritance.h,
common/inheritance_impl.h, common/op_switch.h, common/type_utils.h,
common/types.h, common/utility.cpp, common/utility.h,
modules/Location.cpp, rulesets/BaseMind.cpp, rulesets/BaseMind.h,
rulesets/Character.cpp, rulesets/Character.h, rulesets/Creator.cpp,
rulesets/Creator.h, rulesets/Entity.cpp, rulesets/Entity.h,
rulesets/EntityProperties.cpp, rulesets/Entity_getLocation.h,
rulesets/Food.cpp, rulesets/Food.h, rulesets/MemMap.cpp,
rulesets/MemMap.h, rulesets/Missile.h, rulesets/Pedestrian.cpp,
rulesets/Plant.cpp, rulesets/Plant.h, rulesets/Py_Mind.cpp,
rulesets/Py_Object.cpp, rulesets/Py_Operation.cpp,
rulesets/Py_Operation.h, rulesets/Py_Thing.cpp,
rulesets/PythonMindScript.h, rulesets/PythonScript.h,
rulesets/PythonThingScript.h, rulesets/Python_API.cpp,
rulesets/Script.cpp, rulesets/Script.h, rulesets/Stackable.cpp,
rulesets/Stackable.h, rulesets/Thing.cpp, rulesets/Thing.h,
rulesets/World.cpp, rulesets/World.h,
server/Account.cpp, server/Account.h server/Admin.cpp, server/Admin.h,
server/CommClient.cpp, server/Connection.cpp, server/Connection.h,
server/EntityFactory.cpp, server/EntityFactory.h, server/Lobby.cpp,
server/Lobby.h, server/Persistance.cpp, server/Persistance.h,
server/Persistor.cpp, server/Player.cpp, server/Player.h,
server/ServerRouting.cpp, server/ServerRouting.h,
server/TrustedConnection.cpp, server/TrustedConnection.h,
server/WorldRouter.cpp, server/WorldRouter.h, tests/Areatest.cpp,
tests/Charactertest.cpp, tests/Creatortest.cpp,
tests/EntityExerciser.h, tests/Entitytest.cpp, tests/Foodtest.cpp,
tests/IGEntityExerciser.h, tests/Linetest.cpp, tests/Planttest.cpp,
tests/Stackabletest.cpp, tests/Structuretest.cpp, tests/Thingtest.cpp,
tests/Worldtest.cpp, tests/allOperations.h, tests/inheritancetest.cpp,
tests/utilitytest.cpp, tools/cycmd.cpp:
Modify the entity interface so that all Operation methods
take references to RootOperation, as its cleaner, and requires
less nasty casts. Clean up operations in headers generally.
2004-12-03 14:49:13 +00:00
|
|
|
using Atlas::Message::MapType;
|
|
|
|
|
using Atlas::Message::ListType;
|
|
|
|
|
|
2003-09-10 22:57:18 +00:00
|
|
|
int main()
|
|
|
|
|
{
|
2005-11-17 Al Riddoch <alriddoch@zepler.org>
* tests/Areatest.cpp, tests/BaseEntitytest.cpp,
tests/Charactertest.cpp, tests/Creatortest.cpp,
tests/EntityExerciser.h, tests/Entitytest.cpp, tests/Foodtest.cpp,
tests/Linetest.cpp, tests/Makefile.am, tests/OOGThingtest.cpp,
tests/Planttest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Tasktest.cpp, tests/Thingtest.cpp,
tests/Worldtest.cpp, tests/distancetest.cpp:
Update tests to work with integer ID changes.
2005-11-17 23:58:46 +00:00
|
|
|
Structure e("1", 1);
|
2011-09-16 18:30:22 +01:00
|
|
|
TypeNode type("structure");
|
2007-11-26 Al Riddoch <alriddoch@zepler.org>
* common/inheritance.cpp, common/inheritance.h: Introduce a type
node class as a carrier for all information, including default
values for a type.
* rulesets/Entity.h, rulesets/Entity.cpp, rulesets/Character.cpp:
Use a TypeNode pointer rather than a string giving the type
of an entity.
* client/Py_CreatorClient.cpp, rulesets/MemMap.cpp, rulesets/MemMap.h,
rulesets/MindFactory.cpp, rulesets/MindFactory.h,
rulesets/Py_Mind.cpp, rulesets/Py_Thing.cpp, rulesets/Stackable.cpp,
rulesets/World.cpp, server/PersistantThingFactory.h,
server/Restorer_impl.h, server/WorldRouter.cpp:
Adapt all the code that deals with types. Set the type pointer
up correctly in BaseMind.
* server/EntityFactory.cpp: Initialise the TypeNode pointer on new
entities.
* tests/inheritancetest.cpp: Adapt the test to cope with TypeNode.
2007-11-26 02:57:04 +00:00
|
|
|
e.setType(&type);
|
2003-09-10 22:57:18 +00:00
|
|
|
|
|
|
|
|
IGEntityExerciser<Structure> ee(e);
|
|
|
|
|
|
|
|
|
|
// Throw an op of every type at the entity
|
|
|
|
|
ee.runOperations();
|
|
|
|
|
|
|
|
|
|
// Subscribe the entity to every class of op
|
|
|
|
|
std::set<std::string> opNames;
|
|
|
|
|
ee.addAllOperations(opNames);
|
|
|
|
|
|
|
|
|
|
// Throw an op of every type at the entity again now it is subscribed
|
|
|
|
|
ee.runOperations();
|
|
|
|
|
|
|
|
|
|
std::set<std::string> attrNames;
|
|
|
|
|
attrNames.insert("id");
|
|
|
|
|
|
|
|
|
|
// Make sure we have all the default attributes
|
|
|
|
|
assert(ee.checkAttributes(attrNames));
|
|
|
|
|
|
|
|
|
|
attrNames.insert("test_int");
|
|
|
|
|
attrNames.insert("test_float");
|
|
|
|
|
attrNames.insert("test_list_string");
|
|
|
|
|
attrNames.insert("test_list_int");
|
|
|
|
|
attrNames.insert("test_list_float");
|
|
|
|
|
attrNames.insert("test_map_string");
|
|
|
|
|
attrNames.insert("test_map_int");
|
|
|
|
|
attrNames.insert("test_map_float");
|
|
|
|
|
|
|
|
|
|
// Make sure we don't have the test attributes yet
|
|
|
|
|
assert(!ee.checkAttributes(attrNames));
|
|
|
|
|
|
|
|
|
|
// Add the test attributes
|
2006-07-03 Al Riddoch <alriddoch@zepler.org>
* tests/IGEntityExerciser.h, tests/TestPropertyManager.cpp,
tests/TestPropertyManager.h: Add a dummy property manager, and
install it before testing any IG entity classes.
* tests/Areatest.cpp, tests/Charactertest.cpp,
tests/Creatortest.cpp, tests/EntityFactorytest.cpp,
tests/Entitytest.cpp, tests/Foodtest.cpp, tests/IGEntityExerciser.h,
tests/Linetest.cpp, tests/Planttest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp:
Switch to new hasAttr getAttr setAttr method names.
2006-07-03 11:30:02 +00:00
|
|
|
e.setAttr("test_int", 1);
|
|
|
|
|
e.setAttr("test_float", 1.f);
|
|
|
|
|
e.setAttr("test_list_string", "test_value");
|
|
|
|
|
e.setAttr("test_list_int", ListType(1, 1));
|
|
|
|
|
e.setAttr("test_list_float", ListType(1, 1.f));
|
|
|
|
|
e.setAttr("test_map_string", ListType(1, "test_value"));
|
2004-08-17 Al Riddoch <alriddoch@zepler.org>
* tests/Areatest.cpp, tests/Entitytest.cpp, tests/Foodtest.cpp,
tests/Linetest.cpp, tests/Planttest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp,
tests/inheritancetest.cpp, tests/utilitytest.cpp, tools/cycmd.cpp,
tools/cyconvertrules.cpp, tools/cydbload.cpp, tools/cyisoload.cpp,
tools/cyloadrules.cpp, tools/cypasswd.cpp: Convert code to using
Atlas Message typedefs as found in Atlas-C++ 0.6 to aid
conversion later.
2004-08-17 13:23:28 +00:00
|
|
|
MapType test_map;
|
2003-09-10 22:57:18 +00:00
|
|
|
test_map["test_key"] = 1;
|
2006-07-03 Al Riddoch <alriddoch@zepler.org>
* tests/IGEntityExerciser.h, tests/TestPropertyManager.cpp,
tests/TestPropertyManager.h: Add a dummy property manager, and
install it before testing any IG entity classes.
* tests/Areatest.cpp, tests/Charactertest.cpp,
tests/Creatortest.cpp, tests/EntityFactorytest.cpp,
tests/Entitytest.cpp, tests/Foodtest.cpp, tests/IGEntityExerciser.h,
tests/Linetest.cpp, tests/Planttest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp:
Switch to new hasAttr getAttr setAttr method names.
2006-07-03 11:30:02 +00:00
|
|
|
e.setAttr("test_map_int", test_map);
|
2003-09-10 22:57:18 +00:00
|
|
|
test_map["test_key"] = 1.f;
|
2006-07-03 Al Riddoch <alriddoch@zepler.org>
* tests/IGEntityExerciser.h, tests/TestPropertyManager.cpp,
tests/TestPropertyManager.h: Add a dummy property manager, and
install it before testing any IG entity classes.
* tests/Areatest.cpp, tests/Charactertest.cpp,
tests/Creatortest.cpp, tests/EntityFactorytest.cpp,
tests/Entitytest.cpp, tests/Foodtest.cpp, tests/IGEntityExerciser.h,
tests/Linetest.cpp, tests/Planttest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp:
Switch to new hasAttr getAttr setAttr method names.
2006-07-03 11:30:02 +00:00
|
|
|
e.setAttr("test_map_float", test_map);
|
2003-09-10 22:57:18 +00:00
|
|
|
test_map["test_key"] = "test_value";
|
2006-07-03 Al Riddoch <alriddoch@zepler.org>
* tests/IGEntityExerciser.h, tests/TestPropertyManager.cpp,
tests/TestPropertyManager.h: Add a dummy property manager, and
install it before testing any IG entity classes.
* tests/Areatest.cpp, tests/Charactertest.cpp,
tests/Creatortest.cpp, tests/EntityFactorytest.cpp,
tests/Entitytest.cpp, tests/Foodtest.cpp, tests/IGEntityExerciser.h,
tests/Linetest.cpp, tests/Planttest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp:
Switch to new hasAttr getAttr setAttr method names.
2006-07-03 11:30:02 +00:00
|
|
|
e.setAttr("test_map_string", test_map);
|
2003-09-10 22:57:18 +00:00
|
|
|
|
|
|
|
|
// Make sure we have the test attributes now
|
|
|
|
|
assert(ee.checkAttributes(attrNames));
|
|
|
|
|
|
2004-08-17 Al Riddoch <alriddoch@zepler.org>
* tests/Areatest.cpp, tests/Entitytest.cpp, tests/Foodtest.cpp,
tests/Linetest.cpp, tests/Planttest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp,
tests/inheritancetest.cpp, tests/utilitytest.cpp, tools/cycmd.cpp,
tools/cyconvertrules.cpp, tools/cydbload.cpp, tools/cyisoload.cpp,
tools/cyloadrules.cpp, tools/cypasswd.cpp: Convert code to using
Atlas Message typedefs as found in Atlas-C++ 0.6 to aid
conversion later.
2004-08-17 13:23:28 +00:00
|
|
|
MapType entityAsAtlas;
|
2003-09-10 22:57:18 +00:00
|
|
|
|
|
|
|
|
// Dump a representation of the entity into an Atlas Message
|
2004-08-24 Al Riddoch <alriddoch@zepler.org>
* client/Py_CreatorClient.cpp, common/BaseEntity.cpp,
common/BaseEntity.h, modules/Location.cpp, modules/Location.h,
rulesets/Area.cpp, rulesets/Area.h, rulesets/Character.cpp,
rulesets/Character.h, rulesets/Entity.cpp, rulesets/Entity.h,
rulesets/Line.cpp, rulesets/Line.h, rulesets/MemMap.cpp,
rulesets/Pedestrian.cpp, rulesets/Plant.cpp, rulesets/Plant.h,
rulesets/Py_Mind.cpp, rulesets/Py_Object.cpp, rulesets/Py_Thing.cpp,
rulesets/Python_API.cpp, rulesets/Stackable.cpp,
rulesets/Stackable.h, rulesets/Thing.cpp, rulesets/World.cpp,
rulesets/World.h, server/Account.cpp, server/Account.h,
server/Admin.cpp, server/Connection.cpp, server/Lobby.cpp,
server/Lobby.h, server/Player.cpp, server/Player.h,
server/ServerRouting.cpp, server/ServerRouting.h,
tests/Areatest.cpp, tests/Entitytest.cpp, tests/Foodtest.cpp,
tests/Linetest.cpp, tests/Planttest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp:
Replace addToObject() with addToMessage() throughout.
* server/Account.cpp, server/Lobby.cpp: Use BaseEntity::addToMessage().
* server/Player.cpp: Make adding character types attribute to Message
more efficient.
2004-08-24 21:05:06 +00:00
|
|
|
e.addToMessage(entityAsAtlas);
|
2003-09-10 22:57:18 +00:00
|
|
|
|
|
|
|
|
// Make sure we got at least some of it
|
2004-11-02 17:47:51 +00:00
|
|
|
assert(entityAsAtlas.size() >= 14);
|
2003-09-10 22:57:18 +00:00
|
|
|
|
|
|
|
|
// Read the contents of the Atlas Message back in
|
|
|
|
|
e.merge(entityAsAtlas);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|