Commit graph

175 commits

Author SHA1 Message Date
Erik Ogenvik
4680f81ffb Altered signature to prevent ambiguity. 2016-01-20 15:34:48 +01:00
Erik Ogenvik
8a161407f2 Let "transforms" property determine pos and orient
Instead of directly setting position and orientation we've now
added a "transforms" property. This property contains zero or many
transformations. The result of these is what drives changes to an
entity's position and orientation.
By cleanly separate disrete transformations we can more easily undo
or alter them. This allows us to do things where the position or
orientation of an entity is affected by other properties, or other
entities.

The client protocol is intact. Changes to position and orientation is
still sent the same way, by specifying "pos" and "orientation". However,
these values will now not be written directly to corresponding values on
 the entity. Instead they will first be written to the "transforms" property,
with the final values being a result of combining all data in the property.
2016-01-20 15:34:48 +01:00
Erik Ogenvik
dccaec3c41 Don't set default attributes when restoring.
When we're restoring from storage we don't want to apply any properties
at all when the entity is created, since we'll do that ourselves in a
later pass. This is done by submitting an invalid RootOperation pointer.
2014-09-15 21:11:35 +02:00
Erik Ogenvik
45555fd698 Use custom format for archetypes.
This required the EntityKit to be refactored, so that most fields are
pushed into EntityFactory. Due to the nature of how the rule handlers
and the factories interact the code is pretty messy. It works, but it's
tangled and not really clean.
2013-11-15 21:39:35 +01:00
Erik Ogenvik
0974c28f3c Use standard format for exported entities. 2013-11-15 21:39:35 +01:00
Erik Ogenvik
de230e5833 Moved creation logic to the factory.
This is in preparation for nested entity creation and archetypes.
2013-11-15 21:38:24 +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
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
6efe646c9a Move EntityKit into common 2011-12-21 00:17:06 +00:00
Alistair Riddoch
4d25e36790 Fix includes
This class doesn't actually need the concrete factory
2011-12-20 15:27:49 +00:00
Alistair Riddoch
1f4b7bf1b9 Move PythonScriptFactory into the correct named file in the right place 2011-12-15 18:26:37 +00:00
Alistair Riddoch
325d9265f3 Remove updateChildren to updateProperties
This name makes more sense, and now the interface is more consistent.
2011-12-13 00:40:43 +00:00
Alistair Riddoch
a59c17f109 Remove now empty method 2011-12-13 00:39:08 +00:00
Alistair Riddoch
e7466a5230 Simplify the way properties are propagated to child types 2011-12-13 00:34:41 +00:00
Alistair Riddoch
9f9f4c33dc Remove python include from non-python file 2011-12-12 22:27:12 +00:00
Alistair Riddoch
2f90f90dcb Add addProperties() to EntityKit, reducing complexity in Ruleset 2011-09-16 10:50:47 +01:00
Alistair Riddoch
d778be9aff Replicate the remainder of updateChildrenProperties in TypeNode
Fix up stubs
2011-09-15 23:54:33 +01:00
Alistair Riddoch
ef03d69b97 Add updateChildren() to EntityKit
This is code copied from Ruleset, but it doesn't really seem to belong there.
2011-09-15 23:05:41 +01:00
Alistair Riddoch
1172f0388c Simplify the template factory interface to make de-coupling easier. 2010-07-15 13:09:27 +01:00
Alistair Riddoch
915675f77c Remove unused dependency on EntityBuilder. 2009-08-19 02:44:58 +01:00
Alistair Riddoch
376c2cb3b2 Rename file from PersistentThingFactory to EntityFactory to match class. 2009-03-22 15:30:23 +00:00
Al Riddoch
84c1a94412 Rename files for EntityBuilder from EntityFactory to match the class rename. 2009-03-12 00:50:25 +00:00
Al Riddoch
233b8bedd2 2008-11-29 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp, rulesets/Character.h: Remove all traces
	  of the hard coded statistics property from Character.

	* rulesets/Py_Property.cpp: Don't use Py_StatisticsProperty as the
	  default wrapper for a statistics property because it will no
	  longer work this way.

	* rulesets/Python_API.cpp: Remove the setup for the Statistics
	  wrapper.

	* rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h:
	  Change the footprint of this class so it is no longer hooked
	  into part of the Character class, and instead handles looking
	  up values from the script directly, and owns the script itself.

	* server/ArithmeticFactory.cpp, server/ArithmeticFactory.h,
	  server/EntityFactory.cpp, server/EntityFactory.h,
	  server/PersistantThingFactory.cpp: Remove setup of hard coded
	  statistics property.

	* rulesets/Statistics.h, rulesets/Statistics.cpp,
	  rulesets/Py_Statistics.h, rulesets/Py_Statistics.cpp,
	  rulesets/Makefile.am: Remove clases that are no longer used.
2008-11-29 23:17:38 +00:00
Al Riddoch
4a147f0c97 2008-11-17 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Clean up error messages using more
	  concise types.
2008-11-17 15:45:43 +00:00
Al Riddoch
2b5bac6dd8 2008-11-13 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Use the name length constant in checks.
2008-11-13 03:36:43 +00:00
Al Riddoch
725e065bec 2008-11-13 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Check class names do not violate a
	  32 character limit before installing them, so they never get
	  as far as the database limit.

	* common/Database.cpp: Modify the rules table so it limits
	  the ID to the right size.
2008-11-13 03:13:41 +00:00
Al Riddoch
3532bbd2a4 2008-11-07 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Comment out some half written code that
	  was causing a warning.
2008-11-07 01:25:17 +00:00
Al Riddoch
765ff4b095 2008-09-27 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Now that the property manager always
	  creates something, there is no longer any need to deal with it
	  returning 0.
2008-09-27 16:25:50 +00:00
Al Riddoch
ff6663c66c 2008-09-16 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Remove the hard coded Structure class.

	* data/buildings.xml: Add a soft structure class which sets the simple
	  flag to 0.
2008-09-16 18:42:42 +00:00
Al Riddoch
d80ad46aef 2008-09-12 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Re-order the setup of class and instance
	  properties on an Entity so they are installed and applied correctly.
2008-09-12 14:01:35 +00:00
Al Riddoch
555e3f8f01 2008-09-11 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp, server/EntityFactory.h: Remove all code
	  relating to the old persistence mechanism.
2008-09-11 16:55:25 +00:00
Al Riddoch
cc67ecd3e3 2008-09-10 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: When tasks cause defaults to be changed,
	  also propagate the changes to the class properties.
	  Fixes https://bugs.launchpad.net/bugs/268725
2008-09-11 00:44:45 +00:00
Al Riddoch
a48953b212 2008-09-10 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Set the class flag on class properties.
2008-09-10 14:18:10 +00:00
Al Riddoch
83636cd64a 2008-09-09 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Implement propagating changes in the
	  default attributes of a class to the class's children.
2008-09-09 11:34:03 +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
977c0ec4d7 2008-09-01 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp, server/PersistantThingFactory.cpp,
	  server/PersistantThingFactory.h,
	  server/PersistantThingFactory_impl.h:
	  Add a count to each factory of the number of entities
	  it has created, and add a monitor watch to each one.

	* server/StorageManager.cpp, server/StorageManager.h: Add counters
	  for the various types of database query, and add monitor watches
	  for them.
2008-09-01 17:45:59 +00:00
Al Riddoch
d83aad9062 2008-08-27 Al Riddoch <alriddoch@googlemail.com>
* server/ScriptFactory.cpp: Simplify way the name of a class
	  is determined by removing the hack to upercase the type name.

	* server/EntityFactory.cpp: Break python type name on the last
	  . making the name of the class independant of the Atlas type.

	* data/basic.xml, data/buildings.xml, data/characters.xml,
	  data/clothing.xml, data/mason.xml, data/plants.xml,
	  data/tools.xml, data/weapons.xml, data/werewolf.xml: Modify all
	  python type names in the classes to include the name of the class
	  explicitly.
2008-08-27 16:42:38 +00:00
Al Riddoch
e3b8f160d3 2008-08-25 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Mark old functions relating to
	  bootstrapping world persistence as deprecated.
2008-08-25 15:42:57 +00:00
Al Riddoch
15faa7a6d7 2008-08-21 Al Riddoch <alriddoch@googlemail.com>
* rulesets/attributes.h: Remove old attribute flags used for
	  persistence from the build.

	* rulesets/Entity.h: Replace obsolete update flags with a more
	  general flags field, and define three needed to track the
	  cleanness of basic location data.

	* rulesets/Plant.cpp, rulesets/World.cpp: Remove now unused update
	  flags from property initialisation.

	* rulesets/Entity.cpp, rulesets/Thing.cpp, server/EntityFactory.cpp:
	  Replace code which updated update flags with simpler changes to
	  the new flags field.
2008-08-21 17:10:38 +00:00
Al Riddoch
fc03d53fc6 2008-06-03 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Add some doc strings.
2008-06-03 14:12:56 +00:00
Al Riddoch
dbcc54f0da 2007-12-27 Al Riddoch <alriddoch@zepler.org>
* common/inheritance.h, server/EntityFactory.cpp: Move a typedef
	  into the only cpp file where it is used.
2007-12-27 03:19:52 +00:00
Al Riddoch
e4b45d079e 2007-12-20 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp, server/Makefile.am,
	  server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
	  server/PersistantThingFactory_impl.h, server/Persistor.h,
	  server/Restoration.cpp, server/Restorer.cpp, server/Restorer.h,
	  server/Restorer_impl.h: Remove the templated persistor code from
	  the build.
2007-12-20 21:07:51 +00:00
Al Riddoch
b0a9b8903f 2007-12-20 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Delete the peristance connector in
	  the right place.

	* server/PersistantThingFactory.h: Document what the persistor
	  connector does more clearly.
2007-12-20 20:51:28 +00:00
Al Riddoch
4b8bc982e7 2007-12-20 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp, server/EntityFactory.h,
	  server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
	  server/PersistantThingFactory_impl.h: Rename the base class for
	  Entity factories from FactoryBase to EntityKit.
2007-12-20 19:33:38 +00:00
Al Riddoch
3a2bc079e9 2007-12-20 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp, server/EntityFactory.h, server/Admin.cpp,
	  server/PersistantThingFactory.cpp, server/WorldRouter.cpp,
	  server/server.cpp: Rename EntityFactory to EntityBuilder, to make
	  it's function clearer.
2007-12-20 19:27:12 +00:00
Al Riddoch
292f16d1ea 2007-12-07 Al Riddoch <alriddoch@zepler.org>
* common/Database.h, common/Database.cpp: Add a new decoder for atlas
	  objects, and use it when getting the full contents of a table
	  full of Atlas data.

	* server/Persistance.cpp, server/Persistance.h: Modify the API
	  for getting the rules table to use atlas objects rather than
	  messages.

	* server/EntityFactory.cpp: Re-enable loading rules from the
	  Database, now that the data is available from the peristence
	  API in the right format.
2007-12-07 17:42:58 +00:00
Al Riddoch
bd3a9e153c 2007-11-28 Al Riddoch <alriddoch@zepler.org>
* client/BaseClient.cpp, client/CharacterClient.cpp,
	  client/CharacterClient.h, client/CreatorClient.cpp,
	  client/CreatorClient.h, rulesets/BaseMind.cpp, rulesets/BaseMind.h,
	  rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/MindFactory.cpp, rulesets/MindFactory.h, rulesets/Thing.cpp,
	  rulesets/World.cpp, server/Account.cpp, server/Connection.cpp,
	  server/EntityFactory.cpp, server/Persistor.cpp,
	  server/Persistor_impl.h, server/Restorer_impl.h,
	  server/WorldRouter.cpp: Remove the hard name attribute, now that
	  most entities don't set it.
2007-11-28 20:22:42 +00:00
Al Riddoch
12e5d50b5b 2007-11-26 Al Riddoch <alriddoch@zepler.org>
* common/inheritance.cpp, common/inheritance.h: Introduce a type
	  node class as a carrier for all information, including default
	  values for a type.

	* rulesets/Entity.h, rulesets/Entity.cpp, rulesets/Character.cpp:
	  Use a TypeNode pointer rather than a string giving the type
	  of an entity.

	* client/Py_CreatorClient.cpp, rulesets/MemMap.cpp, rulesets/MemMap.h,
	  rulesets/MindFactory.cpp, rulesets/MindFactory.h,
	  rulesets/Py_Mind.cpp, rulesets/Py_Thing.cpp, rulesets/Stackable.cpp,
	  rulesets/World.cpp, server/PersistantThingFactory.h,
	  server/Restorer_impl.h, server/WorldRouter.cpp:
	  Adapt all the code that deals with types. Set the type pointer
	  up correctly in BaseMind.

	* server/EntityFactory.cpp: Initialise the TypeNode pointer on new
	  entities.

	* tests/inheritancetest.cpp: Adapt the test to cope with TypeNode.
2007-11-26 02:57:04 +00:00
Al Riddoch
65f74386e6 2007-11-22 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.h, server/EntityFactory.cpp: Clean up header
	  a little. Add some alerts for consistency. Stub out a method
	  for updating a task factory from a class description.
2007-11-22 01:05:10 +00:00
Al Riddoch
78a0d9669c 2007-11-22 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.h, server/EntityFactory.cpp: Rename
	  dictionary of entity factories so that it is consistent.
2007-11-22 00:56:48 +00:00