* rulesets/mason/world/statistics/Statistics.py: Make this a new
style class so properties work right, and implement it all
as properties.
* rulesets/StatisticsProperty.cpp: Move the setup of the script
instance into apply rather than install, otherwise it doesn't get
called in the right place.
* rulesets/ArithmeticScript.h: Add a set method to the interface.
* rulesets/PythonArithmeticScript.cpp,
rulesets/PythonArithmeticScript.h: Implement getting using
PyObject_GenericGetAttr() as it works. Add a completely new set
function.
* rulesets/Entity.cpp: When a new property is installed it needs
to be applied.
* 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.
* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Plant.cpp,
rulesets/Stackable.cpp: Fix up places that use the property
manager interface. Fix explicit reference to DynamicProperty.
* data/basic.xml, data/characters.xml, data/mason.xml: Add tick
properties to a bunch of entity classes so they no longer need
a setup operation to get them going.
* rulesets/mason/world/objects/Weather.py,
rulesets/mason/world/objects/elements/Fire.py,
rulesets/mason/world/objects/plants/seeds/Apple.py: Remove setup
handlers from a bunch of scripts as it is now handled by
properties.
* data/buildings.xml: Add setup property to entity classes which
really need a setup op at startup.
* client/BaseClient.cpp: Send a look when creating the avatar, so
that notifications get back without the need for a special case.
* common/op_switch.h, rulesets/Creator.cpp, rulesets/Entity.cpp,
rulesets/Entity.h, server/WorldRouter.cpp:
Remove the setup operation sent to all entities on startup by
default. Get rid of some special cases that depended on it.
* rulesets/InternalProperties.cpp, rulesets/InternalProperties.h:
Make the tick property schedule the operation on apply(), and
use the property value as the time to schedule it.
* 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.
* rulesets/Entity.h: Make flags protected, and add convenient methods
to set and clear flags. Add a flag for indicating that the entity
is queued for a storage update.
* rulesets/Entity.cpp: Reset the clean flag correcly when the entity
is made dirty.
* server/StorageManager.cpp: Hook up Entity::updated, and implement
queueing things for update and making sure they only get added once.
* rulesets/Entity.h: Move entity flags to the top of the header.
Replace destroyed and perceptive booleans with flag values,
and re-work check methods accordingly.
* rulesets/Entity.cpp, rulesets/Creator.cpp, rulesets/Character.cpp:
Ensure that destroyed and perceptive flags are used correctly.
* 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.
* rulesets/LocatedEntity.h: Add onUpdated() virtual method to be
called when the attributes of an Entity are changed.
* rulesets/Entity.cpp, rulesets/Entity.h, rulesets/LocatedEntity.cpp,
rulesets/Thing.cpp, server/WorldRouter.cpp: Implement onUpdated()
to emit the updated signal on Entity, and change all code to
call onUpdated instead of emiting the signal.
* common/BaseEntity.cpp, common/BaseEntity.h: Remove generic operation
routing code.
* common/op_switch.h: Remove all OOG operations from the standard
op switch.
* rulesets/Entity.cpp, rulesets/Entity.h: Replace generic operation
routing with a more specific IG routing implementation.
* rulesets/BaseMind.cpp: Add a mind specific operation router
implementation.
* server/Account.cpp, server/Account.h: Remove handling of Login,
which should never got to Account. Add base handler for Get,
as it needs to be overriden in Admin.
* rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h: Add a virtual
function that is called when the location of an entity changes.
* rulesets/Entity.cpp, rulesets/Entity.h: Implement the virtual
function called when location changes and use it to call the
containered signal. Remove the containered_oneshots list, and
make containered inherently one shot only.
* rulesets/OutfitProperty.cpp: Remove the use of containered_oneshots
is this mechanism is obsolete and has been removed.
* rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h:
Don't allocated storage for m_contains by default, only
on demand. Add a convenience method which checks, and
allocates the storage if required. Set up the ID property
on this base class rather then Entity.
* rulesets/Py_Thing.cpp: Remove special handling of ID attribute
as it is now handled by the property.
* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/MemMap.cpp,
rulesets/Motion.cpp, rulesets/Py_Mind.cpp, rulesets/Py_Thing.cpp,
rulesets/Thing.cpp, rulesets/World.cpp, server/WorldRouter.cpp:
Make sure all parts of the code where contains is used have
the right checks, as it could be null.
* rulesets/Entity.cpp, rulesets/LocatedEntity.cpp: Move the code the
decremements the reference to containing entity into the
LocatedEntity destructor where it belongs.
* rulesets/Character.cpp, rulesets/Entity.cpp,
rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h,
rulesets/MemMap.cpp, rulesets/Motion.cpp, rulesets/Py_Mind.cpp,
rulesets/Py_Thing.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
server/WorldRouter.cpp: Change LocatedEntity::m_contains into
a pointer so that the majority of entities that can not contain
anything don't waste the storage.
* common/TypeNode.h, common/TypeNode.cpp: Move TypeNode into
its own files.
* common/Makefile.am, common/inheritance.cpp, common/inheritance.h:
Add the new files to the build and remove the old implementation.
* client/Py_CreatorClient.cpp, rulesets/Character.cpp,
rulesets/Entity.cpp, rulesets/MemMap.cpp,
rulesets/MindFactory.cpp, rulesets/Py_Mind.cpp,
rulesets/Py_Thing.cpp, rulesets/Stackable.cpp,
server/WorldRouter.cpp: Fix up the includes for all code that
uses TypeNode.
* rulesets/Entity.cpp, rulesets/Entity.h, rulesets/LocatedEntity.cpp,
rulesets/LocatedEntity.h: Remove raw atlas attributes, and use
properties for everything, cutting down the differences in
interface.
* rulesets/Py_Thing.cpp, rulesets/Thing.cpp: Remove code that accessed
soft attributes directly.
* 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.
* rulesets/BaseMind.cpp, rulesets/BaseMind.h, rulesets/Entity.cpp
rulesets/Entity.h: Remove the scriptSubscribed methods which
were empty and unused.
* rulesets/Python_API.cpp, rulesets/Python_Script_Utils.h: Remove
Subscribe_Script() as it is useless now.
* server/ScriptFactory.cpp: Remove call to Subscribe_Script().
* 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.
* 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.
* client/CreatorClient.cpp, client/CreatorClient.h,
client/Py_CreatorClient.cpp, common/BaseWorld.h, common/types.h,
modules/Location.cpp, modules/Location.h,
rulesets/AtlasProperties.cpp, rulesets/AtlasProperties.h,
rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Character.h,
rulesets/Entity.cpp, rulesets/Entity.h,
rulesets/EntityProperties.cpp, rulesets/LocatedEntity.cpp,
rulesets/LocatedEntity.h, rulesets/MemEntity.cpp,
rulesets/MemEntity.h, rulesets/MemMap.cpp, rulesets/Motion.cpp,
rulesets/Motion.h, rulesets/Py_Location.h, rulesets/Py_Mind.cpp,
rulesets/Py_Thing.cpp, rulesets/Py_Thing.h,
rulesets/PythonMindScript.h, rulesets/PythonScript.h,
rulesets/PythonThingScript.cpp, rulesets/PythonThingScript.h,
rulesets/Python_API.cpp, rulesets/Script.cpp, rulesets/Script.h,
rulesets/Thing.cpp, rulesets/World.cpp, server/WorldRouter.cpp,
server/WorldRouter.h: Refactor all the entity code so there is now
a new base class for entities in the world simulation, and in the
mind which only contains things which are trully common to both.
This moves a lot of functionality which should not have been
present in mind entities away, and makes that code safer and more
efficient.
* tests/TestWorld.h: Update the test world API to match the base
class.
* 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.
* 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.
* 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.
* rulesets/Entity.cpp: Initialise motion pointer to zero, so
so tests know whether it is there.
* rulesets/Thing.cpp: Don't attempt to do a movement update if
LOC is zero. It is a sign something not quite right is going on.
* tests/IGEntityExerciser.h: Check motion is not null before using
it.
* common/log.cpp, common/log.h: Switch to taking a C++ string reference
rather than a char *, as it is not really an optimisation, and it
makes the code simpler to read and write.
* client/BaseClient.cpp, client/ClientConnection.cpp,
common/AtlasFileLoader.cpp, common/BaseEntity.cpp,
common/Database.cpp, common/globals.cpp, common/id.cpp,
common/inheritance.cpp, common/log.cpp, common/log.h,
rulesets/Character.cpp, rulesets/Creator.cpp, rulesets/Entity.cpp,
rulesets/MemMap.cpp, rulesets/Motion.cpp, rulesets/Pedestrian.cpp,
rulesets/Py_Object.cpp, rulesets/Py_RootEntity.cpp,
rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
rulesets/Python_API.cpp, rulesets/Thing.cpp, server/Account.cpp,
server/Admin.cpp, server/ArithmeticFactory.cpp,
server/CommClient.cpp, server/CommListener.cpp,
server/CommMDNSPublisher.cpp, server/CommServer.cpp,
server/Connection.cpp, server/EntityFactory.cpp,
server/Persistance.cpp, server/Restoration.cpp,
server/ScriptFactory.cpp, server/TaskFactory.cpp,
server/WorldRouter.cpp, server/server.cpp: Convert over to using
new API correctly.
* data/mason.xml: Add biomass and transient to fircone, making its
script obsolete:
* rulesets/Entity.h, rulesets/Entity.cpp: Set argument names on
some methods. Add a new method allowing a property to be set
externally.
* server/ExternalProperty.cpp, server/ExternalProperty.h: Add a new
property which reflects whether an entity is connected to the
outside world via an external mind.
* server/Connection.cpp, server/Connection.h: Add a new method which
hooks up an avatar to the connection, installing an ExternalProperty
if necessary.
* server/Account.cpp: Use the new Connection method to hook up
existing avatars.
* 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.
* 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.
* rulesets/Entity.h, rulesets/Entity.cpp: Add a mechanism to make
signal connection to Entity::containered single shot only.
* rulesets/OutfitProperty.cpp: Make the connect to garments
containered signal single shot, to avoid having to disconnect it.
* rulesets/OutfitProperty.cpp, rulesets/OutfitProperty.h:
Add a virtual destructor, for strict correctness.
* rulesets/Entity.cpp: Clean up variable names in destroy().
Moving moving contents into LOC on destruction, remove the
ref counts to the destroyed entity held by its contents.
This means Characters can now get deleted.
* rulesets/AtlasProperties.cpp, rulesets/AtlasProperties.h:
Add 3 custom property classes used to handle very commonly
used properties that are hard coded in Atlas more efficiently.
* rulesets/Entity.cpp: Use the new performance property code in
Entity.
* rulesets/Character.cpp, rulesets/Creator.cpp, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/Pedestrian.cpp, rulesets/Py_Thing.cpp,
rulesets/Stackable.cpp, rulesets/Thing.cpp, rulesets/World.cpp:
Remove m_world member variable from all Entity classes, and
access the world manager object as a singleton.
* client/CharacterClient.cpp, client/ClientConnection.h,
rulesets/Character.cpp, rulesets/Character.h, tools/cyaddrules.cpp,
tools/cyconfig.cpp, tools/cyconvertrules.cpp, tools/cyctrl.cpp,
tools/cydumprules.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp:
Add inline documentation.
* client/CharacterClient.h, client/CharacterClient.cpp: Remove
overriden sight operation handlers, as they are no longer
present in the base class, and will never be called.
* client/ClientConnection.h: Remove obsolete unimplemented template
declaration.
* rulesets/Entity.cpp: Remove documentation for an argument that was
never there.
* tools/cyctrl.cpp: Mark as removed from the build.
* Add a FIXME about removing hard coded gender property
* 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".