* client/Py_CreatorClient.cpp, client/CreatorClient.h,
client/CreatorClient.cpp, rulesets/basic/editor.py: Make a delete
method available to the client editor interface.
* 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.
* 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/Entity.h: Remove an old experimental type class, and clean
up includes.
* client/Py_CreatorClient.cpp, rulesets/MemMap.cpp,
rulesets/MindFactory.cpp, rulesets/Py_Mind.cpp,
rulesets/Py_Thing.cpp, rulesets/Stackable.cpp,
server/WorldRouter.cpp: Add necessary includes.
* 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.
* client/Py_CreatorClient.cpp, rulesets/Py_Map.cpp,
rulesets/Py_Operation.cpp, rulesets/Py_Oplist.cpp,
rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp:
Convert functions that take a single argument to use METH_O
and avoid calling PyArg_ParseTuple.
* rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
rulesets/basic/mind/goals/common/move.py: Rename
unit_vector_to_another_vector to unit_vector_to.
* client/Py_CreatorClient.cpp: Switch CreatorClient.as_entity() to
using METH_NOARGS flag, as it takes no arguments.
* rulesets/Py_Thing.cpp: Use METH_O for methods which take only
one argument, avoiding the call to PyArg_ParseTuple().
* rulesets/Character.cpp: Switch to using the test combat script.
* rulesets/Py_EntityWrapper.h, rulesets/Py_Statistics.h: Move the
generic entity wrapper structure into its own header.
* client/Py_CreatorClient.cpp, rulesets/Py_Location.cpp,
rulesets/Py_Location.h, rulesets/Py_Mind.cpp, rulesets/Py_Thing.cpp,
rulesets/Python_API.cpp: Modify PyLocation so that rather than
having a flag to indicate whether the script owns the object,
it instead stores a pointer to the entity that owns it in that
eventuality.
* rulesets/Py_Thing.cpp: Allow map and list attributes to be set from
scripts as long as the contents are Atlas compatible.
* rulesets/Python_API.cpp: Fix script output handling so only complete
lines are output.
* rulesets/mason/world/tasks/Combat.py: Add code for identifying
attacker and defender in a combat.
* rulesets/Python_API.cpp: Modify Python API so Entity() now creates
a RootEntity not a Message Element.
* client/Py_CreatorClient.cpp, client/CreatorClient.h,
client/CreatorClient.cpp: Modify CreatorClient and bindings to
take a RootEntity rather than a Message Element.
* rulesets/Py_Thing.cpp, rulesets/Py_Mind.cpp,
client/Py_CreatorClient.cpp: Remove get_xyz() from the API
available to Python. Its never necessary to deal in absolute
coordinates.
* physics/Vector3D.h, physics/Vector3D.cpp, modules/Location.h,
modules/Location.cpp: Convert to using WFMath::Point instead of
WFMath::Vector for position.
* physics/Collision.h, physics/Collision.cpp: Update collision code
to use new pos type.
* rulesets/Py_Point3D.h, rulesets/Py_Point3D.cpp: New python
wrappers for WFMath::Point.
* rulesets/Py_Location.cpp, rulesets/Py_Vector3D.cpp,
rulesets/Python_API.cpp:
Update python wrappers to take into account new pos type.
Ensure that only apropriate functionality is available for
point and vector.
* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
rulesets/Line.cpp, rulesets/Movement.cpp, rulesets/Movement.h,
rulesets/Pedestrian.cpp, rulesets/Pedestrian.h,
rulesets/Plant.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
server/EntityFactory.cpp, server/WorldRouter.cpp,
server/WorldRouter.h: Update the rest of the code for new pos
type, converting all places where entity parenting is changed
to use WFMath toParentCoords() and toLocalCoords() methods,
so that orientation is handled correctly.
* tests/transformtest.cpp: New test to ensure that toParentCoords()
and toLocalCoords() perform as expected.
* tests/Creatortest.cpp, tests/Locationtest.cpp, tests/Worldtest.cpp,
tests/collisiontest.cpp, tests/emergencetest.cpp:
Update the rest of the tests.