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/Database.cpp, common/globals.cpp, common/id.cpp,
common/log.cpp, modules/DateTime.cpp, rulesets/Container.h,
rulesets/Statistics.h, server/CommListener.cpp,
server/CommServer.cpp, tools/cyconfig.cpp, tools/cyconvertrules.cpp:
Add includes required for recent compilers which include less
stuff implicitly in standard headers.
* 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.
* modules/Location.h, rulesets/Py_BBox.h, rulesets/Py_Point3D.h,
rulesets/Py_Quaternion.h, rulesets/Py_Vector3D.h,
server/CommMDNSPublisher.cpp: Use double quotes not angle brackets
when including headers out of the cyphesis source tree.
* modules/EntityRef.cpp, modules/EntityRef.h: Add a new class to handle
a weak reference to an Entity.
* tests/EntityReftest.cpp: Test the weak reference class.
* common/BaseEntity.h, common/BaseWorld.h, common/Property.h,
modules/Location.h, rulesets/Entity.cpp, rulesets/Entity.h,
server/Account.cpp, server/Account.h, server/Admin.cpp,
server/Admin.h, server/Connection.cpp, server/Connection.h,
server/Persistor.cpp, server/Persistor.h, server/Persistor_impl.h,
tools/cycmd.cpp: Update usage of sigc++ to the native 2.0 API
rather than the deprecated compatability API. Eleminate the
manual disconnection code for deleted objects, as this is now
handled automatically by sigc::trackable.
* common/const.h: Add a second const for the non-squared default
box size for visibility calculations.
* modules/Location.cpp: Initialise cached box size members with
defaults from consts.
* rulesets/basic/mind/goals/common/move.py: Don't remove focus
knowledge about item just because it has been picked up. This
fixes eating acorns.
* rulesets/basic/mind/goals/common/misc_goal.py: Remove focus knowledge
when something is eaten.
* modules/Location.h, modules/Location.cpp: Add members to store
box diagonal size and bounding radius.
* tests/Locationtest.cpp: Test that the diagonal size and bounding
radius are updated correctly.
* modules/Location.h, modules/Location.cpp: Add methods to modify
bbox, and to report if it has been modifed so that cached values
can be computed.
* common/Property.h, common/Property_impl.h: Add a new type of
Property which emits a signal when modified.
* rulesets/EntityProperties.cpp, rulesets/Entity.cpp: Implement
signal Property and use it for bbox, so linking its signal
to Location so that the necessary values can be computed after
modification.
* rulesets/Character.cpp: Re-order code so that its not necessary
to lookup an entity that is to be moved unless we already know
its not the current entity.
* rulesets/Character.cpp: Implement destination based movement when
the target position is specified with a different LOC to the
current LOC of the character.
* modules/Location.cpp: Document the functions used to determine
relative distance vectors.
* modules/Location.cpp, modules/Location.h:
Add const accessors for location data, in preparation for
adding cached collision data which must be updated every
time data is modified.
* physics/Collision.cpp, rulesets/Character.cpp, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/MemMap.cpp, rulesets/Movement.cpp,
rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
rulesets/Py_Location.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
server/Account.cpp, server/EntityFactory.cpp, server/Persistor.cpp,
server/Persistor_impl.h, server/Restorer_impl.h,
server/WorldRouter.cpp, tests/Locationtest.cpp:
Use the const accessors whenver reading data from Location.
* modules/Location.cpp: Fix a bug where POS was being corrupted
whenever velocity was supposed to be set.
* rulesets/basic/mind/goals/humanoid/mason.py: Convert ID to entity
before checking location.
* rulesets/mason/mind/PigMind.py: Convert ID to entity before
passing location to another function.
* modules/Location.h, modules/Location.cpp: Remove handling of
LOC attribute from readFromEntity() as every use of this function
has differen requirements.
* rulesets/MemMap.cpp: Implement setting LOC so that the minimum
of lookups in the world dictionary are required.
* server/EntityFactory.cpp: Implement setting LOC in a much simpler
way, as its always uninitialised at this point.
* client/BaseClient.cpp: Add a note that LOC is currently unhandled,
as there is nothing sane to do with it.
* modules/Location.cpp, modules/Location.h: Add a new method to
read location data from an Atlas Entity.
* rulesets/MemMap.cpp, server/EntityFactory.cpp, client/BaseClient.cpp:
Switch to using new function rather than Entity::getLocation.
* rulesets/Entity.h, rulesets/Entity_getLocation.h: Remove obsolete
getLocation method.
* modules/Location.cpp, modules/Location.h, rulesets/Python_API.cpp:
Implement a function for determining the horizontal distance
between two locations neglecting height difference, as for
locations on the terrain it is not relevant.
* rulesets/basic/mind/goals/common/move.py: Improve the coding of
the move_me_to_it goal, so distance determination is more effective.
Make distance independant of height.
Relax distances at which character is concidered to have arrived at
its destination.
* rulesets/basic/mind/Goal.py: Modify goal so that it understands
that a subgoal can be unfulfilled, but still not need to take any
action.
* modules/Location.h, rulesets/Pedestrian.cpp, rulesets/Thing.cpp,
server/WorldRouter.cpp: Store the last movement update time
in location, so it can be used for interpolation elsewhere.
Don't yet update it in the main Move code is this causes movement
jitter.
* modules/Location.cpp, modules/Location.h: Rejig flags on Location
so that there is one to indicate contents should be checked for
collision, and one to indicate contents is not a collision volume.
* rulesets/Movement.cpp: Modify collision code to check if an
entity is supposed to be checked for collisions.
* rulesets/Structure.cpp: Tweak the flag set on structures to
correctly show that their contents should be checked for collision.
* data/mason.xml: Make ploughed field into an area, and sort
out its bbox to be the right size.
* cyphesis.spec.in: Ensure rpm spec correctly obsoletes the old
mason and service rpms.
* modules/Location.cpp: Get rid of accidentally commited change
that screws up orientation.
* rulesets/Character.cpp: Provide more info about ops which
have TO set incorrectly.
* rulesets/MemMap.cpp: Don't set TO on look ops from memory.
* rulesets/basic/mind/NPCMind.py: Don't set TO on tick ops
from the mind.
* rulesets/Character.cpp: Add notes, and a check to ensure that
ops from the mind don't have TO set.
* rulesets/basic/mind/NPCMind.py,
rulesets/basic/mind/goals/common/misc_goal.py,
rulesets/basic/mind/goals/humanoid/mason.py: Don't set TO or FROM
on goals from the mind.