Commit graph

38 commits

Author SHA1 Message Date
Erik Ogenvik
127793e8a2 Implement an "attachments" property.
This is put on entities that can have other entities attached to them.
With this property both "right_hand_wield" and "outfit" are deprecated.
2018-08-14 21:32:06 +02:00
Erik Ogenvik
092d122be2 Separate flags into own class.
Also allow broadcast to respect visibility.
2018-07-30 13:07:43 +02:00
Erik Ogenvik
712fd7a741 Introduce protected and private properties.
This is defined by the naming of the property.
Properties that starts with "__" are private. Only visible to the
simulation and admins.
Properties that starts with "_" are protected. Like private but also
visible to the owning entity.
All other are public.
2018-07-30 10:24:33 +02:00
Erik Ogenvik
664988645e Make all properties define type and optional name. 2018-04-27 23:12:15 +02:00
Erik Ogenvik
c23b322ead Use "add" and "remove" for flags.
Since it's more descriptive.
2018-04-25 20:15:28 +02:00
Erik Ogenvik
d51d1c39c0 Use fixed size values for flags. 2018-04-24 22:53:11 +02:00
Erik Ogenvik
f09675cec6 Use "planted" for floating entities.
Entities that are "planted" on bodies of water are floating.
This does away with the "floating" mode.

To mark that entities should by default be floating when placed in
water the boolean property "floats" has been added.
2018-03-24 17:06:02 +01:00
Erik Ogenvik
70084e0279 Added calls for when property is installed on Type 2018-02-06 13:45:11 +01:00
Erik Ogenvik
5e8d20a020 Use correct types. 2017-05-27 20:27:48 +02:00
Erik Ogenvik
901259469a Call slightly faster version. 2014-09-15 21:11:35 +02:00
Erik Ogenvik
79d6bda7b2 Properly remove properties with delegates. 2014-08-26 21:09:02 +02:00
Erik Ogenvik
5b96570547 Call "remove" when removing properties.
Since some properties are class properties without any state we need to
add a "remove" method to call, rather than putting cleanup logic in the
destructor.
2013-11-24 20:23:45 +01:00
Olek Wojnar
7f9ff2246d Remove CVS $Id tags
The legacy tags are causing build issues in Debian.
2013-07-15 20:31:59 +02:00
Alistair Riddoch
88ebf48378 Add Property specialisation for List 2013-02-23 01:00:07 +00:00
Alistair Riddoch
3d6f39cdee Modify Property install method to take name
This change also switches DecaysProperty to using delegates as a proof of
concept.
2013-02-13 00:45:36 +00:00
Alistair Riddoch
4a9c7078f7 Refactor to use LocatedEntity as base class
All IG code should use the interface of LocatedEntity when dealing
with any entity, rather than sometimes requiring Entity. Add virtual
functions to the interface where required, and modify all other interfaces
to stop them using Entity. This makes the code way cleaner, and much better
de-coupled.
2013-01-17 10:17:07 +00:00
Alistair Riddoch
72c956d4b4 First pass at copy method for all property classes 2013-01-07 23:03:25 +00:00
Alistair Riddoch
508a98bb49 Add an operation method to Property interface 2013-01-03 23:17:51 +00:00
Alistair Riddoch
ac37383d8a Convery all the property get functions 2011-09-29 17:36:26 +01:00
Alistair Riddoch
892de24f22 Add specialissation for generic map properties. 2009-12-30 01:03:01 +00:00
Alistair Riddoch
3d094a892f Remove all the cases where value was passed to PropertyBase constructor 2009-05-14 00:20:09 +01:00
Al Riddoch
c1e6553c28 2008-10-14 Al Riddoch <alriddoch@googlemail.com>
* common/Property.cpp, common/Property.h: Add a doc group for
	  Property flags, and document them all in it.
2008-10-14 00:59:28 +00:00
Al Riddoch
3c56ee8027 2008-09-27 Al Riddoch <alriddoch@googlemail.com>
* common/Property.h, common/Property_impl.h, common/Property.cpp:
	  Re-write the core property classes to embed their own data,
	  rather than refer to it. This makes DynamicProperty obsolete.
2008-09-27 15:51:16 +00:00
Al Riddoch
08050f8b83 2008-08-18 Al Riddoch <alriddoch@googlemail.com>
* common/Property.h, common/Property.cpp: Add two new functions to the
	  property API which facilitate using properties for default values.
2008-08-18 16:11:59 +00:00
Al Riddoch
22bdff6acd 2007-12-21 Al Riddoch <alriddoch@zepler.org>
* common/Property.h, common/Property.cpp: Add a soft property class,
	  which can take values of any type.

	* rulesets/Entity.cpp: Use soft property for any values for which
	  there is no assigned property factory, and avoid using raw atlas
	  attributes completely.
2007-12-24 00:06:20 +00:00
Al Riddoch
325780d652 2007-01-14 Al Riddoch <alriddoch@zepler.org>
* common/Property.cpp: Add some specialisations that are useful
	  to cover in the tests, even though we are not using them in
	  the server yet.

	* common/inheritance.h: Provide an accessor for the dictionary of
	  class objects for testing purposes.

	* rulesets/AreaProperty.cpp: Use Map() rather than isMap() once we
	  have already tested it.

	* rulesets/Entity.cpp: Remove some debug output.

	* server/CorePropertyManager.cpp: Remove some debug output.

	* tests/PropertyExerciser.h, tests/PropertyExerciser.cpp: Fill out
	  the functionality of the property tester. Add functions to get
	  random values. Use vector for value storage to make it easier
	  to generate the random values.

	* tests/AllPropertytest.cpp: Cover all the property classes we can
	  test.

	* tests/Makefile.am: Add mercator libraries to the property test,
	  as we are now testing the terrain property.
2007-01-14 21:55:21 +00:00
Al Riddoch
cd3857589b 2006-12-12 Al Riddoch <alriddoch@zepler.org>
* Doxyfile: Add tools to the documented code.

	* index.dox: Update documentation index.

	* tools/cycmd.cpp: Add a document page for this tool.

	* common/DynamicProperty.h, common/Property.cpp, common/Property.h,
	  rulesets/AreaProperty.h, rulesets/CalendarProperty.h,
	  rulesets/EntityProperty.h, rulesets/LineProperty.h,
	  rulesets/StatisticsProperty.h, rulesets/TerrainProperty.h:
	  Add all property classes into a property group.
2006-12-12 19:52:36 +00:00
Al Riddoch
9a56dac06c 2006-10-26 Al Riddoch <alriddoch@zepler.org>
* Add RCS Id keywords to every file, for better version tracking.
2006-10-26 00:48:00 +00:00
Al Riddoch
fac57eee73 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
Al Riddoch
0057589a56 2005-11-30 Al Riddoch <alriddoch@zepler.org>
* common/Property.h, common/Property_impl.h, common/Property.cpp:
	  Modify property interface to make apropriate methods const,
	  re-order inheritance to eliminate some redundant code.

	* rulesets/EntityProperties.cpp, rulesets/LineProperty.h,
	  rulesets/LineProperty.cpp, rulesets/TerrainProperty.h,
	  rulesets/TerrainProperty.cpp: Update methods to match modified
	  interface.
2005-11-30 18:44:43 +00:00
Al Riddoch
42e1c99565 2005-08-30 Al Riddoch <alriddoch@zepler.org>
* common/AtlasFileLoader.cpp, common/Database.cpp,
	  common/FormattedXMLWriter.cpp, common/Property.cpp,
	  common/accountbase.cpp, rulesets/Character.cpp,
	  rulesets/Entity_getLocation.h, rulesets/MemMap.cpp,
	  rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
	  rulesets/Py_Object.cpp, rulesets/Thing.cpp,
	  server/Admin.cpp, server/Connection.cpp, server/EntityFactory.cpp,
	  server/WorldRouter.cpp, tools/AdminClient.cpp, tools/cycmd.cpp,
	  tools/cyconvertrules.cpp: After an Element has been checked
	  with isFoo(), it is more efficient to get its value using Foo()
	  rather than asFoo() which repeats the check.
2005-08-30 20:43:19 +00:00
Al Riddoch
fdd316b628 2005-08-27 Al Riddoch <alriddoch@zepler.org>
* Port whole code base to Atlas-C++ 0.6 series. Main server binary
	  now links.
2005-08-27 14:52:12 +00:00
Al Riddoch
3c1de4ff35 2005-03-03 Al Riddoch <alriddoch@zepler.org>
* common/Property.cpp, rulesets/EntityProperties.cpp,
	  server/Persistor.cpp, server/Restorer.cpp, tools/cycmd.cpp:
	  Tweak template code to work with stricter standard compliance
	  of gcc 4.

	* rulesets/Character.h, rulesets/Character.cpp: static const
	  members need to be defined in the .cpp to satisfy all compilers.
2005-03-03 23:45:32 +00:00
Al Riddoch
901cdbff8d 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
Al Riddoch
9660738fe2 2004-11-05 Al Riddoch <alriddoch@zepler.org>
* common/Property.cpp, common/Property.h, common/Property_impl.h:
	  Add a default add() method to the Property base class, as its
	  often the same in derived classes.

	* rulesets/TerrainProperty.cpp, rulesets/TerrainProperty.h:
	  Remove add() method, as its now covered by the default in
	  the base class.

	* rulesets/Entity.cpp: Fix for loop not to create temporary for
	  end() on every iteration.
2004-11-05 16:33:51 +00:00
Al Riddoch
e36c693654 2004-11-02 Al Riddoch <alriddoch@zepler.org>
* common/Property.cpp: Add required type checks to property set
	  methods.

	* modules/Location.cpp: Don't send LOC attribute when the
	  pointer is NULL.

	* rulesets/EntityProperties.cpp: Add a Property specialisation
	  for list of IDs.

	* rulesets/MemMap.cpp: Fix the memory code to use the correct
	  PARENTS attribute rather than type, which is not an Atlas
	  attribute.

	* tests/IGEntityExerciser.h: Add debugging output to attribute
	  checks.
2004-11-02 17:20:34 +00:00
Al Riddoch
b06c61deaf 2004-10-31 Al Riddoch <alriddoch@zepler.org>
* common/Property.cpp, common/Property.h, common/Property_impl.h:
	  Add new ImmutableProperty for properties that cannot be
	  modified, and hold a const reference.

	* rulesets/EntityProperties.cpp: Add some specialisations of
	  Property to handle attributes of Entity.

	* rulesets/LineProperty.h, rulesets/LineProperty.cpp:
	  Property class for handling linear list of coordinates.

	* rulesets/TerrainProperty.cpp, rulesets/TerrainProperty.h:
	  Property class for handling Mercator terrain.
2004-10-31 02:36:26 +00:00
Al Riddoch
2a57d3fe20 2004-10-27 Al Riddoch <alriddoch@zepler.org>
* common/Property.cpp, common/Property.h, common/Property_impl.h:
	  New class to automate and simplify handled of hard coded
	  proerties.

	* tests/Propertytest.cpp: Test for new Property class.
2004-10-27 17:30:36 +00:00