cyphesis/common/BaseWorld.h

235 lines
8 KiB
C
Raw Permalink Normal View History

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
// Copyright (C) 2000-2004 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
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
#ifndef COMMON_BASE_WORLD_H
#define COMMON_BASE_WORLD_H
#include "globals.h"
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
#include <Atlas/Message/Element.h>
#include <Atlas/Objects/ObjectsFwd.h>
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
#include <sigc++/signal.h>
#include <ctime>
class ArithmeticScript;
class LocatedEntity;
2011-10-31 11:19:33 +01:00
class SystemTime;
class Task;
class Location;
typedef std::map<long, LocatedEntity *> EntityDict;
/// \brief Base class for game world manager object.
///
/// This base class provides the common features required by cyphesis
/// for the object which encapsulates the game world. Other classes
/// inherit from this provide the core game world system.
class BaseWorld {
private:
2013-01-22 18:32:12 +00:00
/// \brief Copy constructor deleted to prevent slicing
BaseWorld(const BaseWorld &) = delete;
/// \brief Assignment operator deleted to prevent slicing
const BaseWorld & operator=(const BaseWorld &) = delete;
/// \brief Singleton instance pointer for the World manager object.
static BaseWorld * m_instance;
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
protected:
/// The system time when the server was started.
std::time_t m_initTime;
/// \brief Dictionary of all the objects in the world.
///
/// Pointers to all in-game entities in the world are stored keyed to
/// their integer ID.
EntityDict m_eobjects;
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
/// \brief Whether the base world is suspended or not.
///
/// If this is set to true, the world is "suspended". In this state no
/// Tick ops are sent.
/// This is useful for when a world author wants to edit the world
/// without the simulation altering it.
bool m_isSuspended;
/// \brief The top level in-game entity in the world.
LocatedEntity & m_gameWorld;
LocatedEntity* m_defaultLocation;
LocatedEntity* m_limboLocation;
explicit BaseWorld(LocatedEntity &);
/// \brief Called when the world is resumed.
virtual void resumeWorld() {}
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
public:
virtual ~BaseWorld();
/// \brief Singleton accessor for the World manager object.
static BaseWorld & instance() {
return *m_instance;
}
LocatedEntity * getEntity(const std::string & id) const;
LocatedEntity * getEntity(long id) const;
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
/// \brief Read only accessor for the in-game objects dictionary.
const EntityDict & getEntities() const {
return m_eobjects;
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
}
/// \brief Gets the root entity.
///
/// The root entity is special, in that it never can be deleted.
LocatedEntity& getRootEntity();
/// \brief Gets the root entity.
///
/// The root entity is special, in that it never can be deleted.
LocatedEntity& getRootEntity() const;
/// \brief Gets the default location.
///
/// This is where entities will be created if nothing else is specified.
/// This will either return the root gameworld, or another entity if
/// setDefaultLocation() has been called.
LocatedEntity& getDefaultLocation();
/// \brief Gets the default location.
///
/// This is where entities will be created if nothing else is specified.
/// This will either return the root gameworld, or another entity if
/// setDefaultLocation() has been called.
LocatedEntity& getDefaultLocation() const;
/// \brief Sets the default location.
///
/// If a null value is provided the default location will revert back
/// to the root world.
void setDefaultLocation(LocatedEntity* entity);
/// \brief Gets the limbo location.
///
/// This is where player entities will be moved when they are deleted without
/// there being an active connection. This is to prevent the active world from
/// filling up with inactive entities.
/// \returns A valid limbo entity, or null if none is set.
LocatedEntity* getLimboLocation() const;
/// \brief Sets the limbo location.
///
/// This is where player entities will be moved when they are deleted without
/// there being an active connection. This is to prevent the active world from
/// filling up with inactive entities.
void setLimboLocation(LocatedEntity* entity);
/// \brief Read only accessor for the in-game time.
double getTime() const;
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
/// \brief Get the time the world has been running since the server started.
double upTime() const {
return getTime() - timeoffset;
}
/// \brief Gets whether the world is suspended or not.
const bool & getIsSuspended() const {
return m_isSuspended;
}
/// \brief Sets whether the world is suspended or not.
/// If this is set to true, the world is "suspended". In this state no
/// Tick ops are sent.
/// This is useful for when a world author wants to edit the world
/// without the simulation altering it.
void setIsSuspended(bool suspended);
/// \brief Main world loop function.
virtual bool idle() = 0;
/// \brief Add a new entity to the world.
virtual LocatedEntity * addEntity(LocatedEntity * obj) = 0;
/// \brief Create a new entity and add to the world.
virtual LocatedEntity * addNewEntity(const std::string & type,
const Atlas::Objects::Entity::RootEntity &) = 0;
/// \brief Deletes an entity from the world.
virtual void delEntity(LocatedEntity * obj) = 0;
virtual int createSpawnPoint(const Atlas::Message::MapType & data,
LocatedEntity * ent) = 0;
/**
* \brief Removes a previously registered spawn point.
* @param ent The entity to which the spawn point was registered.
* @return 0 if successful
*/
virtual int removeSpawnPoint(LocatedEntity * ent) = 0;
virtual int getSpawnList(Atlas::Message::ListType & data) = 0;
virtual LocatedEntity * spawnNewEntity(
const std::string & name,
const std::string & type,
const Atlas::Objects::Entity::RootEntity &) = 0;
/**
* \brief Moves the location to within the spawn specified by the name.
* \param name The name of the spawn.
* \param location The location which will be moved.
* \return 0 if successful.
*/
virtual int moveToSpawn(const std::string & name,
Location& location) = 0;
/// \brief Create a new task
virtual Task * newTask(const std::string &, LocatedEntity &) = 0;
/// \brief Activate a new tast
virtual Task * activateTask(const std::string &, const std::string &,
LocatedEntity *, LocatedEntity &) = 0;
/// \brief Create a new Arithmetic object
virtual ArithmeticScript * newArithmetic(const std::string &,
LocatedEntity *) = 0;
/// \brief Pass an operation to the world.
virtual void message(const Atlas::Objects::Operation::RootOperation &,
LocatedEntity & obj) = 0;
/// \brief Find an entity of the given name.
virtual LocatedEntity * findByName(const std::string & name) = 0;
/// \brief Find an entity of the given type.
virtual LocatedEntity * findByType(const std::string & type) = 0;
/// \brief Add an entity provided to the list of perceptive entities.
virtual void addPerceptive(LocatedEntity *) = 0;
/// \brief Signal that an operation is being dispatched.
sigc::signal<void, Atlas::Objects::Operation::RootOperation> Dispatching;
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
};
#endif // COMMON_BASE_WORLD_H