Commit graph

15 commits

Author SHA1 Message Date
Erik Ogenvik
070b0a6c85 Check for where to plant entities.
If an entity is in mode "planted" we should check for any existing
planted entities below it, to see if we should add it on top of them, or
on top of the terrain.
2018-03-23 23:07:09 +01:00
Erik Ogenvik
839667b389 Fix tests. Also handle "id" attr.
The "id" attribute is special, so for that we'll present our data as a
simple string.
2013-11-18 22:26:35 +01:00
Erik Ogenvik
67f36ebfbf Present entity references through a map.
This changes any entity references to not present the data as a regular
string. Instead any entity reference is presented as a map, with one
entry named "$eid".
This allows clients to know what values are references to other
entities, and act upon that. This wasn't possible previously when a
simple string was used instead.
Note that those properties that implicitly refer to other entities, i.e.
"contains" and "loc" still use strings. This is because these are known
by the entity as entity referring entities.
2013-11-18 15:40:29 +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
72c956d4b4 First pass at copy method for all property classes 2013-01-07 23:03:25 +00:00
Alistair Riddoch
c323854aad Convert C cast to static_cast 2012-05-15 11:23:35 +01:00
Alistair Riddoch
ac37383d8a Convery all the property get functions 2011-09-29 17:36:26 +01: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
b8bd2e75e4 2008-11-13 Al Riddoch <alriddoch@googlemail.com>
* rulesets/BaseMind.cpp, rulesets/Character.cpp,
	  rulesets/EntityProperty.cpp, rulesets/Stackable.cpp:
	  Remove a bunch of stray debug output.
2008-11-13 02:33:04 +00:00
Al Riddoch
46e7161ff1 2008-01-06 Al Riddoch <alriddoch@googlemail.com>
* rulesets/EntityProperty.h, rulesets/EntityProperty.cpp:
	  Refactor so this property is always dynamic, and add an accessor.

	* rulesets/Character.cpp, rulesets/Character.h: Remove the hard
	  coded entity references used for wield tool, and replace with
	  a dynamic property.
2008-01-06 21:17:19 +00:00
Al Riddoch
e147182d47 2006-12-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/EntityProperty.cpp: Modify EntityProperty so it
	  shows its value as an empty ID if it is not set to anything,
	  and clears its reference if it is set to an empty string.

	* rulesets/Character.cpp: Fix the code that handles an empty wield
	  argument, so it clears the wielded entity correctly and efficiently.
2006-12-30 16:45:01 +00:00
Al Riddoch
4471772ce7 2006-12-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/attributes.h, server/Persistor_impl.h,
	  server/Restorer.cpp: Remove right_hand_wield from the
	  persistence layer, pending its complete removal.

	* rulesets/EntityProperty.h, rulesets/EntityProperty.cpp:
	  Make EntityProperty a more normal property by making it hold
	  a reference to its value, not the value itself.

	* rulesets/Character.cpp, rulesets/Character.h: Use EntityProperty
	  for right_hand_wield attribute, so it stores the value long term
	  which I think is more efficient.
2006-12-30 03:55:37 +00:00
Al Riddoch
d52e6f0fb4 2006-12-05 Al Riddoch <alriddoch@zepler.org>
* tests/EntityPropertytest.cpp: Add a complete set of unit tests for
	  EntityProperty.

	* rulesets/EntityProperty.cpp: Fix and instrument the code based
	  on the findings from the unit test.
2006-12-05 06:48:57 +00:00
Al Riddoch
97f4bc108a 2006-12-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/EntityProperty.cpp, rulesets/EntityProperty.h: Add a
	  property class that handles a weak reference to another entity.
2006-12-04 23:06:57 +00:00