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
|
2004-10-27 17:30:36 +00:00
|
|
|
// Copyright (C) 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
|
2004-10-27 17:30:36 +00:00
|
|
|
|
2006-10-26 00:48:00 +00:00
|
|
|
|
2004-10-27 17:30:36 +00:00
|
|
|
#ifndef COMMON_PROPERTY_H
|
|
|
|
|
#define COMMON_PROPERTY_H
|
|
|
|
|
|
2013-01-03 23:17:51 +00:00
|
|
|
#include "OperationRouter.h"
|
|
|
|
|
|
2004-10-27 17:30:36 +00:00
|
|
|
#include <Atlas/Message/Element.h>
|
|
|
|
|
|
2013-01-17 10:17:07 +00:00
|
|
|
class LocatedEntity;
|
2018-01-28 21:25:12 +01:00
|
|
|
class TypeNode;
|
2006-12-12 19:52:36 +00:00
|
|
|
|
2004-12-26 23:48:32 +00:00
|
|
|
/// \brief Interface for Entity properties
|
2006-12-12 19:52:36 +00:00
|
|
|
///
|
|
|
|
|
/// \ingroup PropertyClasses
|
2004-10-27 17:30:36 +00:00
|
|
|
class PropertyBase {
|
|
|
|
|
protected:
|
2004-12-28 Al Riddoch <alriddoch@zepler.org>
* common/OOGThing.cpp, common/Property.cpp, common/Property.h,
common/Property_impl.h, common/inheritance.h, common/operations.cpp,
rulesets/World.cpp: Update some comments.
* rulesets/Task.h, rulesets/Task.cpp, tests/Tasktest.cpp,
rulesets/Fell.h, rulesets/Fell.cpp: New Task interface for
tasks which take a while to complete. Sample implentation provided
in the form of a Fell task for felling trees.
* rulesets/Character.cpp, rulesets/Character.h: Try out Task
implementation with Fell.
2004-12-28 02:14:17 +00:00
|
|
|
/// \brief Flags indicating how this Property should be handled
|
2018-04-24 22:53:11 +02:00
|
|
|
std::uint32_t m_flags;
|
|
|
|
|
explicit PropertyBase(std::uint32_t flags = 0);
|
2013-01-08 00:27:04 +00:00
|
|
|
PropertyBase(const PropertyBase &) = default;
|
2004-10-31 02:36:26 +00:00
|
|
|
public:
|
2018-01-28 21:25:12 +01:00
|
|
|
virtual ~PropertyBase() = default;
|
2004-10-27 17:30:36 +00:00
|
|
|
|
2004-12-28 Al Riddoch <alriddoch@zepler.org>
* common/OOGThing.cpp, common/Property.cpp, common/Property.h,
common/Property_impl.h, common/inheritance.h, common/operations.cpp,
rulesets/World.cpp: Update some comments.
* rulesets/Task.h, rulesets/Task.cpp, tests/Tasktest.cpp,
rulesets/Fell.h, rulesets/Fell.cpp: New Task interface for
tasks which take a while to complete. Sample implentation provided
in the form of a Fell task for felling trees.
* rulesets/Character.cpp, rulesets/Character.h: Try out Task
implementation with Fell.
2004-12-28 02:14:17 +00:00
|
|
|
/// \brief Accessor for Property flags
|
2018-04-24 22:53:11 +02:00
|
|
|
std::uint32_t flags() const { return m_flags; }
|
2008-08-14 17:44:26 +00:00
|
|
|
/// \brief Accessor for Property flags
|
2018-04-24 22:53:11 +02:00
|
|
|
std::uint32_t & flags() { return m_flags; }
|
2004-10-27 17:30:36 +00:00
|
|
|
|
2018-04-25 12:21:44 +02:00
|
|
|
void addFlags(std::uint32_t flags) { m_flags |= flags; }
|
2008-08-23 17:53:43 +00:00
|
|
|
|
2018-04-25 12:21:44 +02:00
|
|
|
void removeFlags(std::uint32_t flags) { m_flags &= ~flags; }
|
2008-08-23 17:53:43 +00:00
|
|
|
|
2018-04-24 22:53:11 +02:00
|
|
|
bool hasFlags(std::uint32_t flags) const { return (m_flags & flags) != 0; }
|
2018-03-24 17:06:02 +01:00
|
|
|
|
2008-08-18 16:11:59 +00:00
|
|
|
/// \brief Install this property on an entity
|
|
|
|
|
///
|
|
|
|
|
/// Called whenever an Entity gains this property for the first time
|
2013-02-13 00:45:36 +00:00
|
|
|
virtual void install(LocatedEntity *, const std::string &);
|
2018-01-28 21:25:12 +01:00
|
|
|
/// \brief Install this property on a type
|
|
|
|
|
///
|
|
|
|
|
/// Called whenever a TypeNode gains this property for the first time
|
|
|
|
|
virtual void install(TypeNode *, const std::string &);
|
2013-11-24 20:07:56 +01:00
|
|
|
/// \brief Remove this property from an entity.
|
|
|
|
|
///
|
|
|
|
|
/// Called whenever the property is removed or the entity is shutting down.
|
2014-08-25 22:42:00 +02:00
|
|
|
virtual void remove(LocatedEntity *, const std::string & name);
|
2008-08-18 16:11:59 +00:00
|
|
|
/// \brief Apply whatever effect this property has on an Entity
|
|
|
|
|
///
|
|
|
|
|
/// Called whenever the value of this property should affect an Entity
|
2013-01-17 10:17:07 +00:00
|
|
|
virtual void apply(LocatedEntity *);
|
2008-08-18 16:11:59 +00:00
|
|
|
|
2013-11-24 20:07:56 +01:00
|
|
|
|
2004-12-26 23:48:32 +00:00
|
|
|
/// \brief Copy the value of the property into an Atlas Message
|
2011-09-29 17:36:26 +01:00
|
|
|
virtual int get(Atlas::Message::Element & val) const = 0;
|
2004-12-26 23:48:32 +00:00
|
|
|
/// \brief Read the value of the property from an Atlas Message
|
2006-12-26 Al Riddoch <alriddoch@zepler.org>
* client/BaseClient.cpp, client/BaseClient.h,
client/ClientConnection.cpp, common/AtlasFileLoader.cpp,
common/AtlasFileLoader.h, common/BaseEntity.cpp, common/BaseEntity.h,
common/Property.h, common/accountbase.cpp, common/accountbase.h,
rulesets/ActivePropertyFactory.h,
rulesets/ActivePropertyFactory_impl.h, rulesets/Area.cpp,
rulesets/Area.h, rulesets/AreaProperty.cpp, rulesets/AreaProperty.h,
rulesets/BaseMind.cpp, rulesets/BaseMind.h, server/Account.cpp,
server/Admin.cpp, server/Admin.h, server/ArithmeticFactory.h,
tests/Makefile.am, tools/AdminClient.cpp, tools/AdminClient.h,
tools/cycmd.cpp: Add inline documentation.
* rulesets/ActivePropertyFactory.h: Use handler function pointer
typedef for readability.
* rulesets/AreaProperty.cpp, rulesets/AreaProperty.h: Fix PropertyBase
overriding by adding const to the right methods.
2006-12-26 14:30:42 +00:00
|
|
|
virtual void set(const Atlas::Message::Element & val) = 0;
|
2004-12-26 23:48:32 +00:00
|
|
|
/// \brief Add the value as an attribute to an Atlas map
|
2006-12-26 Al Riddoch <alriddoch@zepler.org>
* client/BaseClient.cpp, client/BaseClient.h,
client/ClientConnection.cpp, common/AtlasFileLoader.cpp,
common/AtlasFileLoader.h, common/BaseEntity.cpp, common/BaseEntity.h,
common/Property.h, common/accountbase.cpp, common/accountbase.h,
rulesets/ActivePropertyFactory.h,
rulesets/ActivePropertyFactory_impl.h, rulesets/Area.cpp,
rulesets/Area.h, rulesets/AreaProperty.cpp, rulesets/AreaProperty.h,
rulesets/BaseMind.cpp, rulesets/BaseMind.h, server/Account.cpp,
server/Admin.cpp, server/Admin.h, server/ArithmeticFactory.h,
tests/Makefile.am, tools/AdminClient.cpp, tools/AdminClient.h,
tools/cycmd.cpp: Add inline documentation.
* rulesets/ActivePropertyFactory.h: Use handler function pointer
typedef for readability.
* rulesets/AreaProperty.cpp, rulesets/AreaProperty.h: Fix PropertyBase
overriding by adding const to the right methods.
2006-12-26 14:30:42 +00:00
|
|
|
virtual void add(const std::string & key, Atlas::Message::MapType & map) const;
|
2005-08-27 14:52:12 +00:00
|
|
|
/// \brief Add the value as an attribute to an Atlas entity
|
2006-12-26 Al Riddoch <alriddoch@zepler.org>
* client/BaseClient.cpp, client/BaseClient.h,
client/ClientConnection.cpp, common/AtlasFileLoader.cpp,
common/AtlasFileLoader.h, common/BaseEntity.cpp, common/BaseEntity.h,
common/Property.h, common/accountbase.cpp, common/accountbase.h,
rulesets/ActivePropertyFactory.h,
rulesets/ActivePropertyFactory_impl.h, rulesets/Area.cpp,
rulesets/Area.h, rulesets/AreaProperty.cpp, rulesets/AreaProperty.h,
rulesets/BaseMind.cpp, rulesets/BaseMind.h, server/Account.cpp,
server/Admin.cpp, server/Admin.h, server/ArithmeticFactory.h,
tests/Makefile.am, tools/AdminClient.cpp, tools/AdminClient.h,
tools/cycmd.cpp: Add inline documentation.
* rulesets/ActivePropertyFactory.h: Use handler function pointer
typedef for readability.
* rulesets/AreaProperty.cpp, rulesets/AreaProperty.h: Fix PropertyBase
overriding by adding const to the right methods.
2006-12-26 14:30:42 +00:00
|
|
|
virtual void add(const std::string & key, const Atlas::Objects::Entity::RootEntity & ent) const;
|
2013-01-03 23:17:51 +00:00
|
|
|
/// \brief Handle an operation
|
2013-01-17 10:17:07 +00:00
|
|
|
virtual HandlerResult operation(LocatedEntity *,
|
|
|
|
|
const Operation &,
|
|
|
|
|
OpVector &);
|
2013-01-07 23:03:25 +00:00
|
|
|
/// \brief Create a copy of this instance
|
|
|
|
|
///
|
|
|
|
|
/// The copy should have exactly the same type, and the same value
|
|
|
|
|
virtual PropertyBase * copy() const = 0;
|
2004-10-27 17:30:36 +00:00
|
|
|
};
|
|
|
|
|
|
2008-08-14 17:44:26 +00:00
|
|
|
/// \brief Flag indicating data has been written to permanent store
|
2008-10-14 00:59:28 +00:00
|
|
|
/// \ingroup PropertyFlags
|
2018-04-24 22:53:11 +02:00
|
|
|
static const std::uint32_t per_clean = 1u << 0u;
|
2008-08-14 17:44:26 +00:00
|
|
|
/// \brief Flag indicating data should never be persisted
|
2008-10-14 00:59:28 +00:00
|
|
|
/// \ingroup PropertyFlags
|
2018-04-24 22:53:11 +02:00
|
|
|
static const std::uint32_t per_ephem = 1u << 1u;
|
2008-08-23 17:53:43 +00:00
|
|
|
/// \brief Flag indicating data has been stored initially
|
2008-10-14 00:59:28 +00:00
|
|
|
/// \ingroup PropertyFlags
|
2018-04-24 22:53:11 +02:00
|
|
|
static const std::uint32_t per_seen = 1u << 2u;
|
2008-08-14 17:44:26 +00:00
|
|
|
|
|
|
|
|
/// \brief Flag mask indicating data should not be written to store
|
2008-10-14 00:59:28 +00:00
|
|
|
/// \ingroup PropertyFlags
|
2018-04-24 22:53:11 +02:00
|
|
|
static const std::uint32_t per_mask = per_clean | per_ephem;
|
2008-08-14 17:44:26 +00:00
|
|
|
|
|
|
|
|
/// \brief Flag indicating data is not visible
|
2008-10-14 00:59:28 +00:00
|
|
|
/// \ingroup PropertyFlags
|
2018-04-24 22:53:11 +02:00
|
|
|
static const std::uint32_t vis_hidden = 1u << 3u;
|
2008-08-14 17:44:26 +00:00
|
|
|
/// \brief Flag indicating data is server internal
|
2008-10-14 00:59:28 +00:00
|
|
|
/// \ingroup PropertyFlags
|
2018-04-24 22:53:11 +02:00
|
|
|
static const std::uint32_t vis_internal = 1u << 4u;
|
2008-08-14 17:44:26 +00:00
|
|
|
|
|
|
|
|
/// \brief Flag mask indicating data should be be perceptable
|
2008-10-14 00:59:28 +00:00
|
|
|
/// \ingroup PropertyFlags
|
2018-04-24 22:53:11 +02:00
|
|
|
static const std::uint32_t vis_mask = vis_hidden | vis_internal;
|
2008-08-14 17:44:26 +00:00
|
|
|
|
2008-09-06 19:06:53 +00:00
|
|
|
/// \brief Flag set to indicate this is a class property, and has no instance
|
2008-10-14 00:59:28 +00:00
|
|
|
/// \ingroup PropertyFlags
|
2018-04-24 22:53:11 +02:00
|
|
|
static const std::uint32_t flag_class = 1u << 5u;
|
2008-09-06 19:06:53 +00:00
|
|
|
|
|
|
|
|
/// \brief Flag used for boolean properties
|
2008-10-14 00:59:28 +00:00
|
|
|
/// \ingroup PropertyFlags
|
2018-04-24 22:53:11 +02:00
|
|
|
static const std::uint32_t flag_bool = 1u << 6u;
|
2008-09-06 19:06:53 +00:00
|
|
|
|
2008-09-22 23:47:04 +00:00
|
|
|
/// \brief Flag used to mark properties whose state has not been broadcast
|
2008-10-14 00:59:28 +00:00
|
|
|
/// \ingroup PropertyFlags
|
2018-04-24 22:53:11 +02:00
|
|
|
static const std::uint32_t flag_unsent = 1u << 7u;
|
2008-09-22 23:47:04 +00:00
|
|
|
|
2009-03-04 18:07:26 +00:00
|
|
|
/// \brief Flag used to mark properties which must be instance properties
|
|
|
|
|
/// \ingroup PropertyFlags
|
|
|
|
|
/// Typically this will be because they have per-entity state which cannot
|
|
|
|
|
/// be handled on a class property.
|
2018-04-24 22:53:11 +02:00
|
|
|
static const std::uint32_t flag_instance = 1u << 8u;
|
2009-03-04 18:07:26 +00:00
|
|
|
|
2004-12-26 23:48:32 +00:00
|
|
|
/// \brief Entity property template for properties with single data values
|
2006-12-12 19:52:36 +00:00
|
|
|
/// \ingroup PropertyClasses
|
2004-10-27 17:30:36 +00:00
|
|
|
template <typename T>
|
2008-09-27 15:51:16 +00:00
|
|
|
class Property : public PropertyBase {
|
2004-10-27 17:30:36 +00:00
|
|
|
protected:
|
2004-12-28 Al Riddoch <alriddoch@zepler.org>
* common/OOGThing.cpp, common/Property.cpp, common/Property.h,
common/Property_impl.h, common/inheritance.h, common/operations.cpp,
rulesets/World.cpp: Update some comments.
* rulesets/Task.h, rulesets/Task.cpp, tests/Tasktest.cpp,
rulesets/Fell.h, rulesets/Fell.cpp: New Task interface for
tasks which take a while to complete. Sample implentation provided
in the form of a Fell task for felling trees.
* rulesets/Character.cpp, rulesets/Character.h: Try out Task
implementation with Fell.
2004-12-28 02:14:17 +00:00
|
|
|
/// \brief Reference to variable holding the value of this Property
|
2008-09-27 15:51:16 +00:00
|
|
|
T m_data;
|
2013-01-08 00:27:04 +00:00
|
|
|
Property(const Property<T> &) = default;
|
2004-10-27 17:30:36 +00:00
|
|
|
public:
|
2018-04-27 20:55:02 +02:00
|
|
|
static const std::string property_atlastype;
|
|
|
|
|
|
2008-09-27 15:51:16 +00:00
|
|
|
explicit Property(unsigned int flags = 0);
|
|
|
|
|
|
|
|
|
|
const T & data() const { return this->m_data; }
|
|
|
|
|
T & data() { return this->m_data; }
|
2004-10-27 17:30:36 +00:00
|
|
|
|
2018-01-26 13:23:15 +01:00
|
|
|
int get(Atlas::Message::Element & val) const override;
|
|
|
|
|
|
|
|
|
|
void set(const Atlas::Message::Element &) override;
|
|
|
|
|
|
|
|
|
|
void add(const std::string & key, Atlas::Message::MapType & map) const override;
|
2018-01-28 21:25:12 +01:00
|
|
|
void add(const std::string & key, const Atlas::Objects::Entity::RootEntity & ent) const override;
|
2018-01-26 13:23:15 +01:00
|
|
|
Property<T> * copy() const override;
|
2004-10-31 02:36:26 +00:00
|
|
|
};
|
|
|
|
|
|
2008-10-14 00:59:28 +00:00
|
|
|
/// \brief Entity property that can store any Atlas value
|
|
|
|
|
/// \ingroup PropertyClasses
|
2007-12-24 00:06:20 +00:00
|
|
|
class SoftProperty : public PropertyBase {
|
|
|
|
|
protected:
|
|
|
|
|
Atlas::Message::Element m_data;
|
|
|
|
|
public:
|
2018-01-28 21:25:12 +01:00
|
|
|
SoftProperty() = default;
|
2007-12-24 00:06:20 +00:00
|
|
|
explicit SoftProperty(const Atlas::Message::Element & data);
|
|
|
|
|
|
2018-01-26 13:23:15 +01:00
|
|
|
int get(Atlas::Message::Element & val) const override ;
|
|
|
|
|
void set(const Atlas::Message::Element & val) override ;
|
2018-04-27 20:55:02 +02:00
|
|
|
SoftProperty * copy() const override;
|
2007-12-24 00:06:20 +00:00
|
|
|
};
|
|
|
|
|
|
2018-03-24 17:06:02 +01:00
|
|
|
class BoolProperty : public PropertyBase {
|
|
|
|
|
public:
|
2018-04-27 20:55:02 +02:00
|
|
|
static constexpr const char* property_atlastype = "int";
|
2018-03-24 17:06:02 +01:00
|
|
|
|
|
|
|
|
explicit BoolProperty() = default;
|
|
|
|
|
|
|
|
|
|
int get(Atlas::Message::Element & val) const override;
|
|
|
|
|
void set(const Atlas::Message::Element & val) override;
|
|
|
|
|
BoolProperty * copy() const override;
|
|
|
|
|
|
|
|
|
|
bool isTrue() const;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
2004-10-27 17:30:36 +00:00
|
|
|
#endif // COMMON_PROPERTY_H
|