Unfortunately I haven't got time to properly implement updated tests for
the new classes, so in some cases I've opted for removing tests. With
more resources available it would be advantageous to implement proper
tests for all of the Comm classes, but that won't be done currently.
The "respawning" property makes an entity respawn instead of being
deleted. It intercepts the Delete op and instead of deleting the entity
it moves it to the specified spawn point.
A typical use case of this is to place the property on any user
controlled entity, thus making sure that it's never deleted and istead
respawned when killed or defeated.
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.
* common/BaseWorld.h: Modify the addEntity() function so we no longer
need to specify whether it needs to be set up, as nowhere was ever
specifying.
* server/WorldRouter.cpp, server/WorldRouter.h: Implement the modified
BaseWorld API, and ensure all entities are sent Setup operations
for now.
* tests/TestWorld.h: Update test world so it implements the interface
correctly.
* 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.
* tests/IGEntityExerciser.h: Add more test coverage for operations
to trigger errer detection in Thing.MoveOperation.
* tests/TestWorld.h: Add test code to allow entities to be added to
the test world.
* common/BaseWorld.h, rulesets/Creator.cpp, rulesets/World.cpp,
server/WorldRouter.cpp, server/WorldRouter.h, tests/TestWorld.h:
Pass perceptive entities to the world by pointer rather than
by ID, avoiding a lookup in the dictionary.
* tests/TestWorld.h: Add changes to the world interface to the world
test framework.
* tests/EntityFactorytest.cpp: Update EntityFactory tests for changes
in the API.
* tests/TestWorld.h, tests/Creatortest.cpp, tests/Worldtest.cpp:
Move test implementation of BaseWorld into its own header, as
it's used in multiple places.