Commit graph

44 commits

Author SHA1 Message Date
Erik Hjortsberg
51151ec228 Added a "visdist" property which determines visibility range.
For performance reasons we'll also add a new entity flag, so that
visibility calculating methods can do a quick lookup without having to
search through all attributes.
2010-07-13 10:56:52 +02:00
Alistair Riddoch
5292256681 Add AreaProperty to those managed here. 2009-12-31 15:08:21 +00:00
Alistair Riddoch
9b0e87d277 Add "spawn" properties to the property factory. 2009-12-30 01:03:29 +00:00
Al Riddoch
8f89c49499 2008-11-30 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Makefile.am: Add ArithmeticFactory to the build in this
	  directory.

	* data/characters.xml: Add test statistics to the class.

	* rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h:
	  Add an install method which creates a script instance.

	* rulesets/mason/world/statistics/Statistics.py: Make the reference
	  to the owner optional.

	* server/CorePropertyManager.cpp: Add "statistics" to the factory.

	* server/Makefile.am, server/ArithmeticFactory.cpp,
	  server/ArithmeticFactory.h: Remove unused ArithmeticFactory code
	  from the build.
2008-11-30 01:03:26 +00:00
Al Riddoch
a80f85e85a 2008-10-01 Al Riddoch <alriddoch@googlemail.com>
* rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h: Make all the
	  property access functions that should never be used to modify a
	  property const. Remove requirePropertyClass() as it pretty much
	  can't be const.

	* rulesets/Entity.cpp, rulesets/Entity.h: Make overriden
	  getProperty() const as it is in the base class. Add new
	  property access functions for code that needs to modify the
	  properties which ensures class properties never get modified
	  through the Entity interface.

	* rulesets/Character.cpp, rulesets/Plant.cpp, rulesets/Py_Thing.cpp,
	  rulesets/TerrainModProperty.cpp, server/CorePropertyManager.cpp:
	  Change all the code that accesses properties to use the right
	  functions.
2008-10-01 18:20:57 +00:00
Al Riddoch
660abec7d2 2008-10-01 Al Riddoch <alriddoch@googlemail.com>
* rulesets/LocatedEntity.h: Rename some member functions and templates
	  to make more sense and be consistent.

	* rulesets/Character.cpp, rulesets/Plant.cpp,
	  server/CorePropertyManager.cpp: Fix the code to use the new names.
2008-10-01 16:30:29 +00:00
Al Riddoch
f2706e8114 2008-09-29 Al Riddoch <alriddoch@googlemail.com>
* server/CorePropertyManager.cpp: Update operation handlers to access
	  properties in the cleanest most type safe way possible.
2008-09-29 02:53:33 +00:00
Al Riddoch
8ad9cac866 2008-09-27 Al Riddoch <alriddoch@googlemail.com>
* server/CorePropertyManager.cpp, server/CorePropertyManager.h:
	  Re-work the property manager to always create a property,
	  using closest match specialisations of the template where
	  possible. Replace all factories which did create DynamicProperty
	  objects with Property objects instead, as they are now functionaly
	  the same.
2008-09-27 16:22:40 +00:00
Al Riddoch
1f1d8fbdf8 2008-09-16 Al Riddoch <alriddoch@googlemail.com>
* server/CorePropertyManager.cpp: Add the simple property to the
	  property manager.
2008-09-16 18:40:22 +00:00
Al Riddoch
0cc641c014 2008-09-12 Al Riddoch <alriddoch@googlemail.com>
* rulesets/InternalProperties.cpp, rulesets/InternalProperties.h,
	  server/CorePropertyManager.cpp: Add a pair of new property classes,
	  one to schedule an immediate setup operation, and one to schedule
	  an immediate tick operation.
2008-09-12 01:32:03 +00:00
Al Riddoch
d57de81925 2008-09-10 Al Riddoch <alriddoch@googlemail.com>
* rulesets/TerrainModProperty.cpp, rulesets/TerrainModProperty.h,
	  server/CorePropertyManager.cpp: Re-work part of the way
	  terrain mod properties are set up, removing the need for
	  a setup handler, and using install instead.
2008-09-10 14:16:12 +00:00
Al Riddoch
02cfd3ac39 2008-09-09 Al Riddoch <alriddoch@googlemail.com>
* server/CorePropertyManager.cpp: Replace the old transient property
	  and handler with the new one.
2008-09-09 18:07:35 +00:00
Al Riddoch
fab8a833ff 2008-09-08 Al Riddoch <alriddoch@googlemail.com>
* rulesets/ActivePropertyFactory_impl.h: Re-work the active property
	  factories so they just pass handler information to the property
	  classes rather than installing it themselves, so the property
	  can now handle installing the handlers each time they are installed
	  on an entity, making class default properties work.

	* client/ClientPropertyManager.cpp, client/ClientPropertyManager.h,
	  common/PropertyFactory.h, common/PropertyFactory_impl.h,
	  common/PropertyManager.h, rulesets/ActivePropertyFactory.h,
	  server/CorePropertyManager.cpp, server/CorePropertyManager.h:
	  Modify the property manager and property factory interfaces so they
	  do not take a pointer to the owner, as this is never required any
	  more.

	* rulesets/Character.cpp, rulesets/Entity.cpp: Modify code that uses
	  property managers to use the new interface.

	* rulesets/SolidProperty.cpp, rulesets/SolidProperty.h: Make use of
	  the bool flag to implement this, preventing it from being tied to
	  having a pointer to the owner at creation time.

	* rulesets/StatusProperty.cpp, rulesets/StatusProperty.h: Remove
	  the need for an owner pointer at construction time by using the
	  apply method.

	* rulesets/TerrainModProperty.cpp, rulesets/TerrainModProperty.h:
	  Use new MultiActivePropertyManager and install method to handle
	  installing handlers rather than relying on the factory to do it.

	* server/CorePropertyManager.cpp: Change many of the property
	  factories now that none get get an owner pointer.

	* server/EntityFactory.cpp: Set up default properties on all type
	  nodes when a new class is installed, and don't apply instance
	  properties based on class defaults, relying on class properties.

	* rulesets/Entity.cpp: Remove hard coded BBox property now that the
	  functionality is handled by a more special property.
2008-09-08 00:17:08 +00:00
Al Riddoch
8863140a37 2008-09-03 Al Riddoch <alriddoch@googlemail.com>
* server/Persistance.cpp: Correct seem seriously wrong error
	  messages.
2008-09-03 22:53:58 +00:00
Al Riddoch
dcc25e8e01 2008-08-18 Tamas Bates <rhymer@gmail.com>
* rulsets/TerrainModProperty.cpp, rulesets/TerrainModProperty.h: Add a
	  function to easily remove a terrain mod from the terrain.

	* server/CorePropertyManager.cpp: Fix the delete handler for terrain
	  mods to correctly clear them from the terrain when their owning entity
	  is deleted.
2008-08-18 18:59:48 +00:00
Al Riddoch
8cf9a1f05c 2008-08-17 Tamas Bates <rhymer@gmail.com>
* rulesets/TerrainModProperty.cpp, rulesetes/TerrainModProperty.h: Add
	  a member to store the pointer returned from Terrain::addMod(). Revise
	  set() to use this pointer.

	* rulesets/TerrainProperty.cpp, rulesets/TerrainProperty.h: Update the
	  API for controlling modifiers to use the pointer returned by
	  Terrain::addMod() when adding or updating modifiers.

	* server/CorePropertyManager.cpp: Update the handler for Move Operations
	  on terrain modifiers so that it correctly uses the new position.
2008-08-17 18:12:09 +00:00
Al Riddoch
ff9edab26c 2008-08-14 Al Riddoch <alriddoch@googlemail.com>
Changes by Tamas Bates  <rhymer@gmail.com>

	* rulesets/TerrainProperty.cpp, rulesets/TerrainProperty.h: Add an
	  API for controlling modifiers to the terrain.

	* rulesets/TerrainModProperty.cpp, rulesets/TerrainModProperty.h:
	  Implement a new property for entities which affect the height
	  of the terrain.

	* server/CorePropertyManager.cpp: Add handlers to deal with
	  operations that manipulate the terrain when a terrain mod
	  property changes.

	* rulesets/mason/define_world.py: Add a test function for
	  terrain modification properties.
2008-08-14 00:03:12 +00:00
Al Riddoch
492380bea4 2007-12-20 Al Riddoch <alriddoch@zepler.org>
* common/PropertyFactory.h, common/PropertyFactory_impl.h,
	  rulesets/ActivePropertyFactory.h,
	  rulesets/ActivePropertyFactory_impl.h,
	  rulesets/EntityPropertyFactory.h,
	  rulesets/EntityPropertyFactory_impl.h,
	  server/CorePropertyManager.cpp:
	  Rename all property factory classes to have PropertyFactory as the
	  suffix.
2007-12-20 18:47:28 +00:00
Al Riddoch
f2b3cfe41e 2007-12-20 Al Riddoch <alriddoch@zepler.org>
* common/PropertyFactory.cpp, common/PropertyFactory.h,
	  rulesets/ActivePropertyFactory.h, rulesets/EntityPropertyFactory.h,
	  server/CorePropertyManager.cpp, server/CorePropertyManager.h:
	  Rename abstract base class for property factorys to PropertyKit.
2007-12-20 18:42:43 +00:00
Al Riddoch
1f0c5d1f4d 2007-12-03 Al Riddoch <alriddoch@zepler.org>
* data/animals.xml: Give all the animals BIOMASS.

	* data/characters.xml: Add mass to some character classes that were
	  missing it.

	* rulesets/Character.cpp, rulesets/Character.h, rulesets/Entity.cpp,
	  rulesets/Entity.h, rulesets/Plant.cpp, rulesets/Statistics.cpp,
	  rulesets/World.cpp, server/CorePropertyManager.cpp,
	  server/Persistor.cpp, server/Persistor_impl.h,
	  server/Restorer_impl.h: Remove the hard coded mass property from
	  Entity.

	* rulesets/mason/world/statistics/Statistics.py: Fix scripts which
	  assume entities will have mass.
2007-12-03 23:18:51 +00:00
Al Riddoch
a32e84cfdc 2007-12-03 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/Character.h, rulesets/Entity.cpp,
	  rulesets/Entity.h, rulesets/Plant.cpp, rulesets/Py_Thing.cpp,
	  rulesets/StatusProperty.cpp, rulesets/attributes.h,
	  server/CorePropertyManager.cpp, server/Persistor.cpp,
	  server/Persistor_impl.h, server/Restorer.cpp,
	  server/Restorer_impl.h: Remove the hard coded status property from
	  Entity, and the hard coded food property from character. Fix
	  the logic handling digestion and plants to use the new softer
	  properties.
2007-12-03 20:40:55 +00:00
Al Riddoch
bc880b3fe2 2007-11-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/StatusProperty.cpp, rulesets/StatusProperty.h:
	  Add a dynamic property that deletes the entity when it goes
	  below zero, removing the need for the hard coded property
	  of the same name.

	* rulesets/Makefile.am: Add the new property to the build.

	* server/CorePropertyManager.cpp: Add the new property to the system.

	* rulesets/mason/define_world.py: Add a test for setting the status
	  to below zero.

	* rulesets/Entity.cpp: Remove the hard property for status.

	* rulesets/Thing.cpp: Remove the code that checks the hard
	  status property to see if the entity needs to be deleted.
2007-11-29 01:13:27 +00:00
Al Riddoch
095f6c7058 2007-07-26 Al Riddoch <alriddoch@zepler.org>
* server/CorePropertyManager.cpp: Add a new active property handler,
	  that schedules the destruction of an entity after a timeout.

	* data/mason.xml: Add biomass and transient properties to Acorn,
	  making most of the script obsolete.

	* rulesets/mason/world/objects/plants/seeds/Acorn.py: Remove handlers
	  for eating and handling decay from the script, now that this
	  functionality is taken by properties.
2007-07-26 10:43:30 +00:00
Al Riddoch
58da870ddf 2007-06-22 Al Riddoch <alriddoch@zepler.org>
* server/CorePropertyManager.cpp: Finish installing the burn speed
	  property, now tested.

	* rulesets/Thing.cpp, rulesets/Thing.h: Remove legacy Burn operation
	  handler.
2007-06-22 12:42:35 +00:00
Al Riddoch
8b9be9421a 2007-06-21 Al Riddoch <alriddoch@zepler.org>
* server/CorePropertyManager.cpp: Add a new active dynamic property
	  "burn_speed" for things that can burn.
2007-06-21 21:02:39 +00:00
Al Riddoch
bb6ba14903 2007-06-21 Al Riddoch <alriddoch@zepler.org>
* rulesets/ActivePropertyFactory.h,
	  rulesets/ActivePropertyFactory_impl.h: Add a new type of property
	  builder than can install multiple operation handlers.

	* server/CorePropertyManager.cpp: Add a new active dynamic property
	  "biomass" for things which can be eaten, which handles the Eat
	  operation.

	* rulesets/Food.cpp, rulesets/Food.h: Remove the old Eat operation
	  handler.

	* data/basic.xml, data/mason.xml: Give all the food entity rules
	  some biomass.
2007-06-21 20:26:53 +00:00
Al Riddoch
7f2891c0c4 2007-01-27 Al Riddoch <alriddoch@zepler.org>
* rulesets/ActivePropertyFactory_impl.h: Correct the header guard
	  comments.

	* rulesets/SolidProperty.cpp, rulesets/SolidProperty.h: New property
	  to handler whether an entities bbox is solid or not.

	* rulesets/EntityPropertyFactory.cpp, rulesets/EntityPropertyFactory.h,
	  rulesets/EntityPropertyFactory_impl.h: New property factory
	  for properties the contructor of which takes an entity pointer of
	  the owning entity.

	* server/CorePropertyManager.cpp: Install the SOLID property on demand.

	* data/basic.xml: Make area entities non-solid by default, so you don't
	  collide with them.
2007-01-27 16:35:36 +00:00
Al Riddoch
664e4b6b6c 2007-01-21 Al Riddoch <alriddoch@zepler.org>
* server/CorePropertyManager.cpp: Fix the creation of entities
	  as a result of the decays property so they don't get velocity
	  and bbox from the entity that spawned them.
2007-01-21 19:53:37 +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
e656990464 2007-01-11 Al Riddoch <alriddoch@zepler.org>
* server/CorePropertyManager.cpp: Modify DECAYS Delete handler so
	  that the parent entity handles the creation of entities that
	  have resulted from the decay.

	* rulesets/Character.cpp: Call Entity::operation() from operation()
	  to ensure operation handlers are called, and all future
	  modifications get picked up too.

	* data/basic.xml, data/mason.xml: Add a DECAYS property leaving a
	  skull to all humanoid classes.
2007-01-11 00:26:44 +00:00
Al Riddoch
cc98de2816 2007-01-10 Al Riddoch <alriddoch@zepler.org>
* common/types.h: Add an entity pointer to the handler function
	  pointer arguments.

	* rulesets/ActivePropertyFactory_impl.h: Fix the guard comment.

	* rulesets/Character.cpp: Remove debugging output.

	* rulesets/Entity.cpp: Fix new property code so it now sets the
	  value. Improve the debug reporting when dealing with op handlers.

	* rulesets/mason/define_world.py: Test the decays property.

	* server/CorePropertyManager.cpp: Add a DECAYS property and a
	  test handler for it.
2007-01-10 21:58:49 +00:00
Al Riddoch
be32cb9565 2007-01-03 Al Riddoch <alriddoch@zepler.org>
* server/CorePropertyManager.cpp: Get rid of a warning about a missing
	  return value.

	* tests/AtlasFileLoadertest.cpp: Fix a warning about comparing signed
	  and unsigned integers.
2007-01-03 22:29:46 +00:00
Al Riddoch
d89d57f6e6 2006-12-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/OutfitProperty.cpp, rulesets/OutfitProperty.h:
	  Remove the flags constructor argument, as this type of property
	  doesn't work that way.

	* server/CorePropertyManager.cpp: Add OUTFIT property to the
	  dynamic properties handled by the property manager.
2006-12-29 00:41:18 +00:00
Al Riddoch
59da4c51dc 2006-12-03 Al Riddoch <alriddoch@zepler.org>
* common/types.h: Add a function pointer type, and related
	  typedefs for functions which handle an operation.

	* rulesets/Entity.cpp, rulesets/Entity.h: Add a map of operation
	  handlers so that any operation type can be handled by data
	  defined handlers.

	* rulesets/ActivePropertyFactory.cpp, rulesets/ActivePropertyFactory.h,
	  rulesets/ActivePropertyFactory_impl.h: Add a new type of property
	  factory, which installs a handler when the property is added to
	  an entity.

	* server/CorePropertyManager.cpp: Test out the new property factory
	  and handler mechanism with a new property called "attachment".
2006-12-03 06:31:43 +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
e879f341f9 2006-10-24 Al Riddoch <alriddoch@zepler.org>
* man/Makefile.am: Add rules to create man pages for every command,
	  which refer to the combined pages for all commands.

	* man/cyaddrules.1, man/cyconvertrules.1, man/cydumprules.1,
	  man/cyloadrules.1, man/cypasswd.1: Generate new pages as described
	  above.

	* man/cycmd.sgml: Fix argument name in cycmd man page.

	* man/cyclient.1, man/cycmd.1, man/cycmd.sgml, man/cyphesis-tools.1,
	  man/cyphesis.1: Re-generate existing man pages.

	* common/PropertyFactory.h, common/PropertyFactory_impl.h: Pass in
	  pointer to the entity when creating a new property using the
	  factory.

	* server/CorePropertyManager.cpp: Make sure the entity pointer is
	  passed to the property factory as required.
2006-10-23 23:38:41 +00:00
Al Riddoch
a894a1b324 2006-08-07 Al Riddoch <alriddoch@zepler.org>
* server/CorePropertyManager.cpp: Delete all the property
	  factories on shutdown, to keep the memory usage clean.
2006-08-07 20:02:54 +00:00
Al Riddoch
d55f933d8c 2006-07-05 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.cpp: Remove debug output.

	* server/CorePropertyManager.cpp: Remove more debug output.
2006-07-04 23:48:19 +00:00
Al Riddoch
1d53fa068f 2006-07-03 Al Riddoch <alriddoch@zepler.org>
* client/ClientPropertyManager.cpp, client/ClientPropertyManager.h:
	  A new class as a dummy property manager for the client side.
	  Never creates property objects.

	* client/client.cpp: Instantiate the client property manager
	  during client initialisation.

	* server/EntityFactory.cpp: Instatiate the server property manager
	  during server intialisation.

	* common/PropertyManager.h: Add the singletons accessor, and
	  make the addProperty member return a pointer to the property.

	* server/CorePropertyManager.h, server/CorePropertyManager.cpp:
	  Implement creating properties for server side entity objects.

	* rulesets/Entity.cpp: Use the property manager singleton to
	  create properties if a new attribute is set which is not already
	  a property, and its also not already a soft attribute.
2006-07-03 01:29:07 +00:00
Al Riddoch
b8d4454f46 2006-06-29 Al Riddoch <alriddoch@zepler.org>
* server/CorePropertyManager.cpp: Add properties for START_INTERSECTIONS
	  and END_INTERSECTIONS.
2006-06-29 15:45:55 +00:00
Al Riddoch
aedb277897 2006-06-29 Al Riddoch <alriddoch@zepler.org>
* common/DynamicProperty.h, common/DynamicProperty_impl.h:
	  Add a second dynamic property template which can wrap any
	  property class, not just instances of Property<>.

	* server/CorePropertyManager.cpp: Install a property factory for
	  COORDS, to handle the coordinates in a line.

	* common/DynamicProperty.cpp, common/PropertyFactory.cpp: Remove
	  unnecessary template instanciations.
2006-06-29 14:57:19 +00:00
Al Riddoch
cec9814a60 2006-06-26 Al Riddoch <alriddoch@zepler.org>
* common/DynamicProperty.cpp, common/DynamicProperty.h,
	  common/DynamicProperty_impl.h: New property class for handling
	  properties or attributes added on the fly which need to store the
	  value.

	* common/PropertyFactory.cpp, common/PropertyFactory_impl.h,
	  server/CorePropertyManager.cpp: Use DynamicProperty in the
	  property factories for properties created on the fly.
2006-06-26 15:50:43 +00:00
Al Riddoch
eb64132657 2006-06-26 Al Riddoch <alriddoch@zepler.org>
* configure.ac: Add check for recent gcc versions, and turn of
	  strict aliasing on versions which have trouble with python
	  pointer casting.

	* common/PropertyFactory_impl.h, server/CorePropertyManager.cpp:
	  Return safe values from function stubs to get rid of compiler
	  warnings.
2006-06-26 15:28:43 +00:00
Al Riddoch
87505c6098 2006-06-26 Al Riddoch <alriddoch@zepler.org>
* common/PropertyFactory.cpp, common/PropertyFactory.h,
	  common/PropertyFactory_impl.h, common/PropertyManager.cpp,
	  common/PropertyManager.h: Add new classes to automate the
	  creation of property objects for known property types.

	* server/CorePropertyManager.cpp, server/CorePropertyManager.h:
	  Manager object that will coordinate creating properties
	  when they are added to entities.
2006-06-26 00:21:32 +00:00