Commit graph

89 commits

Author SHA1 Message Date
Erik Ogenvik
a3560c817f Use "propel" property for movement.
Clients shouldn't set the "velocity", instead setting the "propel"
property.
2018-02-11 21:15:35 +01:00
Erik Ogenvik
e7fa53214b Use nullptr instead of NULL. 2018-02-06 13:45:11 +01:00
Erik Ogenvik
7127d39f13 More work on moving to left hand coord system. 2018-02-06 13:45:10 +01:00
Erik Ogenvik
7aaa9b9ba7 Optimize includes. 2017-03-19 21:36:52 +01:00
Erik Ogenvik
ed8890bcb5 Spelling. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
a8e606c449 Fixed handling of invalid pos in location.
Shouldn't check too early, since queries where the top locations are the
same but with invalid pos would fail.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
5bf665ab8a Added angular velocity.
The vector is the axis, and its magnitude is the angle.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
0c5794977b If any pos is invalid, dist calc can't be done. 2016-06-26 13:16:11 +02:00
Erik Ogenvik
333506918f Print out better error messages. 2016-05-15 23:39:55 +02:00
Erik Ogenvik
657f644e3b Expand with function returning ancestor too. 2014-09-15 21:11:36 +02: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
8bf6ab2e04 Use new Quaternion constructor 2012-03-05 09:30:49 +00:00
Alistair Riddoch
1ab89f1585 Remove constant from function definitions too 2012-01-31 11:06:51 +00:00
Alistair Riddoch
c6bd3094c5 Use C++ std::sqrt for efficiency 2011-04-27 19:46:13 +01:00
Alistair Riddoch
a23209d894 Add function to override visibility of an Entity 2011-01-07 22:38:49 +00:00
Al Riddoch
175c0fd9ce 2008-11-17 Al Riddoch <alriddoch@googlemail.com>
* modules/Location.cpp: Clean up data types.
2008-11-17 15:31:40 +00:00
Al Riddoch
c11cacfdb4 2008-11-17 Al Riddoch <alriddoch@googlemail.com>
* modules/Location.h, modules/Location.cpp: Add a new function for
	  reading location data from an Atlas message.
2008-11-17 15:13:14 +00:00
Al Riddoch
88f0bcc7d2 2008-09-10 Al Riddoch <alriddoch@googlemail.com>
* modules/Location.h, modules/Location.cpp: Remove unused
	  acceleration and angular velocity variables.
2008-09-10 14:10:37 +00:00
Al Riddoch
8e8df5b482 2007-12-02 Al Riddoch <alriddoch@zepler.org>
* 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.
2007-12-02 23:49:05 +00:00
Al Riddoch
9a56dac06c 2006-10-26 Al Riddoch <alriddoch@zepler.org>
* Add RCS Id keywords to every file, for better version tracking.
2006-10-26 00:48:00 +00:00
Al Riddoch
fac57eee73 2006-01-19 Al Riddoch <alriddoch@zepler.org>
* aiclient/ClientAccount.cpp, aiclient/ClientAccount.h,
	  aiclient/ClientConnection.cpp, aiclient/ClientConnection.h,
	  aiclient/client.cpp, aiclient/client.h, client/BaseClient.cpp,
	  client/BaseClient.h, client/CharacterClient.cpp,
	  client/CharacterClient.h, client/ClientConnection.cpp,
	  client/ClientConnection.h, client/CreatorClient.cpp,
	  client/CreatorClient.h, client/ObserverClient.cpp,
	  client/ObserverClient.h, client/Py_CreatorClient.cpp,
	  client/Py_CreatorClient.h, client/client.cpp,
	  client/define_world.cpp, client/define_world.h, common/Add.h,
	  common/Affect.h, common/AtlasFileLoader.cpp,
	  common/AtlasFileLoader.h, common/Attack.h, common/BaseEntity.cpp,
	  common/BaseEntity.h, common/BaseWorld.cpp, common/BaseWorld.h,
	  common/Burn.h, common/Chop.h, common/Connect.h, common/CustomOp.cpp,
	  common/CustomOp.h, common/CustomOp_impl.h, common/Cut.h,
	  common/Database.cpp, common/Database.h, common/Delve.h, common/Dig.h,
	  common/Eat.h, common/FormattedXMLWriter.cpp,
	  common/FormattedXMLWriter.h, common/Generic.h, common/Load.h,
	  common/Monitor.h, common/Mow.h, common/Nourish.h,
	  common/OOGThing.cpp, common/OOGThing.h, common/Property.cpp,
	  common/Property.h, common/Property_impl.h, common/Save.h,
	  common/Setup.h, common/Tick.h, common/Unseen.h, common/Update.h,
	  common/Use.h, common/Wield.h, common/accountbase.cpp,
	  common/accountbase.h, common/const.cpp, common/const.h,
	  common/custom.cpp, common/debug.h, common/globals.cpp,
	  common/globals.h, common/id.cpp, common/id.h, common/inheritance.cpp,
	  common/inheritance.h, common/inheritance_impl.h, common/log.cpp,
	  common/log.h, common/newid.cpp, common/nls.h, common/op_switch.h,
	  common/operations.cpp, common/operations.h, common/random.h,
	  common/refno.h, common/serialno.cpp, common/serialno.h,
	  common/system.cpp, common/system.h, common/terrain_utils.cpp,
	  common/terrain_utils.h, common/type_utils.h, common/types.h,
	  common/utility.cpp, common/utility.h, modules/DateTime.cpp,
	  modules/DateTime.h, modules/Location.cpp, modules/Location.h,
	  modules/WorldTime.cpp, modules/WorldTime.h, physics/BBox.cpp,
	  physics/BBox.h, physics/Collision.cpp, physics/Collision.h,
	  physics/Quaternion.cpp, physics/Quaternion.h, physics/Vector3D.cpp,
	  physics/Vector3D.h, physics/VectorPol.h, rulesets/Area.cpp,
	  rulesets/Area.h, rulesets/AreaProperty.cpp, rulesets/AreaProperty.h,
	  rulesets/ArithmeticScript.cpp, rulesets/ArithmeticScript.h,
	  rulesets/BaseMind.cpp, rulesets/BaseMind.h,
	  rulesets/CalendarProperty.cpp, rulesets/CalendarProperty.h,
	  rulesets/Character.cpp, rulesets/Character.h, rulesets/Combat.cpp,
	  rulesets/Combat.h, rulesets/Container.cpp, rulesets/Container.h,
	  rulesets/Creator.cpp, rulesets/Creator.h, rulesets/Entity.cpp,
	  rulesets/Entity.h, rulesets/EntityProperties.cpp,
	  rulesets/Entity_getLocation.h, rulesets/Fell.cpp, rulesets/Fell.h,
	  rulesets/Food.cpp, rulesets/Food.h, rulesets/Line.cpp,
	  rulesets/Line.h, rulesets/LineProperty.cpp, rulesets/LineProperty.h,
	  rulesets/MemEntity.cpp, rulesets/MemEntity.h, rulesets/MemMap.cpp,
	  rulesets/MemMap.h, rulesets/MemMap_methods.h,
	  rulesets/MindFactory.cpp, rulesets/MindFactory.h, rulesets/Missile.h,
	  rulesets/Motion.cpp, rulesets/Motion.h, rulesets/Movement.cpp,
	  rulesets/Movement.h, rulesets/Pedestrian.cpp, rulesets/Pedestrian.h,
	  rulesets/Plant.cpp, rulesets/Plant.h, rulesets/Py_BBox.cpp,
	  rulesets/Py_BBox.h, rulesets/Py_EntityWrapper.h,
	  rulesets/Py_Location.cpp, rulesets/Py_Location.h,
	  rulesets/Py_Map.cpp, rulesets/Py_Map.h, rulesets/Py_Mind.cpp,
	  rulesets/Py_Mind.h, rulesets/Py_Object.cpp, rulesets/Py_Object.h,
	  rulesets/Py_Operation.cpp, rulesets/Py_Operation.h,
	  rulesets/Py_Oplist.cpp, rulesets/Py_Oplist.h, rulesets/Py_Optime.cpp,
	  rulesets/Py_Optime.h, rulesets/Py_Point3D.cpp, rulesets/Py_Point3D.h,
	  rulesets/Py_Property.cpp, rulesets/Py_Property.h,
	  rulesets/Py_Quaternion.cpp, rulesets/Py_Quaternion.h,
	  rulesets/Py_RootEntity.cpp, rulesets/Py_RootEntity.h,
	  rulesets/Py_Statistics.cpp, rulesets/Py_Statistics.h,
	  rulesets/Py_Task.cpp, rulesets/Py_Task.h, rulesets/Py_Thing.cpp,
	  rulesets/Py_Thing.h, rulesets/Py_Vector3D.cpp,
	  rulesets/Py_Vector3D.h, rulesets/Py_World.cpp, rulesets/Py_World.h,
	  rulesets/Py_WorldTime.cpp, rulesets/Py_WorldTime.h,
	  rulesets/PythonArithmeticScript.cpp,
	  rulesets/PythonArithmeticScript.h, rulesets/PythonMindScript.cpp,
	  rulesets/PythonMindScript.h, rulesets/PythonScript.cpp,
	  rulesets/PythonScript.h, rulesets/PythonThingScript.cpp,
	  rulesets/PythonThingScript.h, rulesets/PythonWrapper.cpp,
	  rulesets/PythonWrapper.h, rulesets/Python_API.cpp,
	  rulesets/Python_API.h, rulesets/Python_Script_Utils.h,
	  rulesets/Script.cpp, rulesets/Script.h, rulesets/Stackable.cpp,
	  rulesets/Stackable.h, rulesets/Statistics.cpp, rulesets/Statistics.h,
	  rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h,
	  rulesets/Structure.cpp, rulesets/Structure.h, rulesets/Task.cpp,
	  rulesets/Task.h, rulesets/TaskScript.cpp, rulesets/TaskScript.h,
	  rulesets/TerrainProperty.cpp, rulesets/TerrainProperty.h,
	  rulesets/Thing.cpp, rulesets/Thing.h, rulesets/ThingFactory.cpp,
	  rulesets/ThingFactory.h, rulesets/World.cpp, rulesets/World.h,
	  rulesets/attributes.h, server/Account.cpp, server/Account.h,
	  server/Admin.cpp, server/Admin.h, server/ArithmeticFactory.cpp,
	  server/ArithmeticFactory.h, server/CommClient.cpp,
	  server/CommClient.h, server/CommIdleSocket.cpp,
	  server/CommIdleSocket.h, server/CommListener.cpp,
	  server/CommListener.h, server/CommLocalClient.cpp,
	  server/CommLocalClient.h, server/CommMDNSPublisher.cpp,
	  server/CommMDNSPublisher.h, server/CommMaster.cpp,
	  server/CommMaster.h, server/CommMetaClient.cpp,
	  server/CommMetaClient.h, server/CommPSQLSocket.cpp,
	  server/CommPSQLSocket.h, server/CommPeer.cpp,
	  server/CommPeer.h, server/CommPeerListener.cpp,
	  server/CommPeerListener.h, server/CommRemoteClient.cpp,
	  server/CommRemoteClient.h, server/CommServer.cpp,
	  server/CommServer.h, server/CommSlaveClient.cpp,
	  server/CommSlaveClient.h, server/CommSlaveListener.cpp,
	  server/CommSlaveListener.h, server/CommSocket.cpp,
	  server/CommSocket.h, server/CommUnixListener.cpp,
	  server/CommUnixListener.h, server/Connection.cpp,
	  server/Connection.h, server/Connection_methods.h,
	  server/EntityFactory.cpp, server/EntityFactory.h,
	  server/ExternalMind.cpp, server/ExternalMind.h,
	  server/Idle.cpp, server/Idle.h, server/Lobby.cpp, server/Lobby.h,
	  server/Master.cpp, server/Master.h, server/Peer.cpp, server/Peer.h,
	  server/Persistance.cpp, server/Persistance.h,
	  server/PersistantThingFactory.cpp, server/PersistantThingFactory.h,
	  server/PersistantThingFactory_impl.h, server/Persistor.cpp,
	  server/Persistor.h, server/Persistor_impl.h,
	  server/Player.cpp, server/Player.h, server/Restoration.cpp,
	  server/Restoration.h, server/Restorer.cpp, server/Restorer.h,
	  server/Restorer_impl.h, server/ScriptFactory.cpp,
	  server/ScriptFactory.h, server/ServerRouting.cpp,
	  server/ServerRouting.h, server/ServerRouting_methods.h,
	  server/SlaveClientConnection.cpp, server/SlaveClientConnection.h,
	  server/TaskFactory.cpp, server/TaskFactory.h,
	  server/TrustedConnection.cpp, server/TrustedConnection.h,
	  server/WorldRouter.cpp, server/WorldRouter.h,
	  server/server.cpp, server/server.h, server/slave.cpp,
	  tests/Areatest.cpp, tests/BaseEntitytest.cpp,
	  tests/Charactertest.cpp, tests/Containertest.cpp,
	  tests/Creatortest.cpp, tests/EntityExerciser.h,
	  tests/EntityFactorytest.cpp, tests/Entitytest.cpp,
	  tests/Foodtest.cpp, tests/IGEntityExerciser.h,
	  tests/Linetest.cpp, tests/Locationtest.cpp, tests/OOGThingtest.cpp,
	  tests/Planttest.cpp, tests/Propertytest.cpp, tests/Stackabletest.cpp,
	  tests/Structuretest.cpp, tests/Tasktest.cpp, tests/TestWorld.h,
	  tests/Thingtest.cpp, tests/WorldTimetest.cpp, tests/Worldtest.cpp,
	  tests/allOperations.h, tests/collisiontest.cpp, tests/consttest.cpp,
	  tests/distancetest.cpp, tests/emergencetest.cpp,
	  tests/inheritancetest.cpp, tests/logtest.cpp, tests/randomtest.cpp,
	  tests/systemtest.cpp, tests/transformtest.cpp,
	  tests/type_utilstest.cpp, tests/utilitytest.cpp,
	  tools/AdminClient.cpp, tools/AdminClient.h, tools/cyaddrules.cpp,
	  tools/cycmd.cpp, tools/cyconfig.cpp, tools/cyconvertrules.cpp,
	  tools/cyctrl.cpp, tools/cydbload.cpp, tools/cydumprules.cpp,
	  tools/cyisoload.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp,
	  tools/cywatchdog.cpp: Replace the copyright and license statements
	  with new versions that include disclaimer of warranty, and
	  permit distribution under later versions of the GPL.
2006-01-19 02:17:06 +00:00
Al Riddoch
e2b83394b0 2005-12-13 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-12-13 01:38:08 +00:00
Al Riddoch
ea0cc10b60 2005-11-22 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-11-22 23:31:41 +00:00
Al Riddoch
bba73b3cf6 2005-11-21 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-11-21 02:24:17 +00:00
Al Riddoch
26fbbe9d4b 2005-10-01 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-10-01 17:34:21 +00:00
Al Riddoch
a0836a6818 2005-09-28 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-09-28 23:02:50 +00:00
Al Riddoch
53ebdc74ed 2005-09-13 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-09-13 01:44:49 +00:00
Al Riddoch
9ef58988e3 2005-09-11 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-09-11 01:43:29 +00:00
Al Riddoch
372ddf5271 2005-09-10 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-09-10 10:28:45 +00:00
Al Riddoch
fdd316b628 2005-08-27 Al Riddoch <alriddoch@zepler.org>
* Port whole code base to Atlas-C++ 0.6 series. Main server binary
	  now links.
2005-08-27 14:52:12 +00:00
Al Riddoch
04a1310ed6 2005-06-23 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-06-23 12:46:28 +00:00
Al Riddoch
3b4f53b09e 2005-06-05 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-06-05 20:33:56 +00:00
Al Riddoch
bc3e37e8a3 2005-04-21 Al Riddoch <alriddoch@zepler.org>
* modules/Location.h, modules/Location.cpp: Start adding the
	  additional fields required for comeplex movement. Acceleration
	  and angular velocity added first.
2005-04-21 01:57:16 +00:00
Al Riddoch
299efcafdc 2004-12-03 Al Riddoch <alriddoch@zepler.org>
* client/BaseClient.cpp, client/BaseClient.h,
	  client/CharacterClient.cpp, client/CharacterClient.h,
	  client/ClientConnection.cpp, client/ClientConnection.h,
	  client/CreatorClient.cpp, client/CreatorClient.h,
	  client/Py_CreatorClient.cpp, common/BaseEntity.cpp,
	  common/BaseEntity.h, common/BaseWorld.h, common/custom.cpp,
	  common/inheritance.cpp, common/inheritance.h,
	  common/inheritance_impl.h, common/op_switch.h, common/type_utils.h,
	  common/types.h, common/utility.cpp, common/utility.h,
	  modules/Location.cpp, rulesets/BaseMind.cpp, rulesets/BaseMind.h,
	  rulesets/Character.cpp, rulesets/Character.h, rulesets/Creator.cpp,
	  rulesets/Creator.h, rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/EntityProperties.cpp, rulesets/Entity_getLocation.h,
	  rulesets/Food.cpp, rulesets/Food.h, rulesets/MemMap.cpp,
	  rulesets/MemMap.h, rulesets/Missile.h, rulesets/Pedestrian.cpp,
	  rulesets/Plant.cpp, rulesets/Plant.h, rulesets/Py_Mind.cpp,
	  rulesets/Py_Object.cpp, rulesets/Py_Operation.cpp,
	  rulesets/Py_Operation.h, rulesets/Py_Thing.cpp,
	  rulesets/PythonMindScript.h, rulesets/PythonScript.h,
	  rulesets/PythonThingScript.h, rulesets/Python_API.cpp,
	  rulesets/Script.cpp, rulesets/Script.h, rulesets/Stackable.cpp,
	  rulesets/Stackable.h, rulesets/Thing.cpp, rulesets/Thing.h,
	  rulesets/World.cpp, rulesets/World.h,
	  server/Account.cpp, server/Account.h server/Admin.cpp, server/Admin.h,
	  server/CommClient.cpp, server/Connection.cpp, server/Connection.h,
	  server/EntityFactory.cpp, server/EntityFactory.h, server/Lobby.cpp,
	  server/Lobby.h, server/Persistance.cpp, server/Persistance.h,
	  server/Persistor.cpp, server/Player.cpp, server/Player.h,
	  server/ServerRouting.cpp, server/ServerRouting.h,
	  server/TrustedConnection.cpp, server/TrustedConnection.h,
	  server/WorldRouter.cpp, server/WorldRouter.h, tests/Areatest.cpp,
	  tests/Charactertest.cpp, tests/Creatortest.cpp,
	  tests/EntityExerciser.h, tests/Entitytest.cpp, tests/Foodtest.cpp,
	  tests/IGEntityExerciser.h, tests/Linetest.cpp, tests/Planttest.cpp,
	  tests/Stackabletest.cpp, tests/Structuretest.cpp, tests/Thingtest.cpp,
	  tests/Worldtest.cpp, tests/allOperations.h, tests/inheritancetest.cpp,
	  tests/utilitytest.cpp, tools/cycmd.cpp:
	  Modify the entity interface so that all Operation methods
	  take references to RootOperation, as its cleaner, and requires
	  less nasty casts. Clean up operations in headers generally.
2004-12-03 14:49:13 +00:00
Al Riddoch
64c3645645 2004-11-18 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp: Add some checks and error reporting that
	  prevent a segfault when distance_to is used in the mind code.
2004-11-18 18:15:13 +00:00
Al Riddoch
b8ad4d9678 2004-11-17 Al Riddoch <alriddoch@zepler.org>
* modules/Location.h, modules/Location.cpp, rulesets/Entity.h:
	  Finally remove the getXyz() implementation, this getting
	  rid of absolute coords entirely.
2004-11-17 16:09:06 +00:00
Al Riddoch
25b857aa98 2004-11-04 Al Riddoch <alriddoch@zepler.org>
* 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.
2004-11-04 21:04:01 +00:00
Al Riddoch
e13826d573 2004-11-04 Al Riddoch <alriddoch@zepler.org>
* 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.
2004-11-04 17:42:40 +00:00
Al Riddoch
e36c693654 2004-11-02 Al Riddoch <alriddoch@zepler.org>
* common/Property.cpp: Add required type checks to property set
	  methods.

	* modules/Location.cpp: Don't send LOC attribute when the
	  pointer is NULL.

	* rulesets/EntityProperties.cpp: Add a Property specialisation
	  for list of IDs.

	* rulesets/MemMap.cpp: Fix the memory code to use the correct
	  PARENTS attribute rather than type, which is not an Atlas
	  attribute.

	* tests/IGEntityExerciser.h: Add debugging output to attribute
	  checks.
2004-11-02 17:20:34 +00:00
Al Riddoch
16d99772d2 2004-10-23 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp: Ensure that orientation is not used
	  when its invalid.

	* rulesets/Py_Mind.cpp, rulesets/Py_Thing.cpp: Assert that the
	  return value of getXyz() is valid.

	* rulesets/mason/define_world.py: Add a test function to add
	  a deer and a chicken.
2004-10-23 20:01:56 +00:00
Al Riddoch
ce8f62d539 2004-10-11 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp, modules/Location.h: Add new function for
	  usefully calculating the distance vector of another entity.

	* tests/distancetest.cpp: Update test to check new distance
	  function.

	* rulesets/Python_API.cpp: Make the new distance vector function
	  available to python rather than the relative postion function.

	* rulesets/basic/mind/Knowledge.py, rulesets/basic/mind/NPCMind.py:
	  Ensure that Knowledge really does handle arbitrary triples.

	* rulesets/basic/mind/goals/common/misc_goal.py: Add new version
	  of transaction goal for transactions for hirelings.

	* rulesets/basic/mind/goals/humanoid/transaction.py: Complete
	  the implementation of the trigger goal for hirelings.

	* rulesets/mason/define_world.py: Move the mercenaries closer to
	  origin for debugging.
2004-10-11 01:04:27 +00:00
Al Riddoch
8a11b05290 2004-10-03 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp, physics/Collision.cpp, rulesets/Character.cpp,
	  rulesets/Entity.cpp, rulesets/Movement.cpp, rulesets/Movement.h,
	  rulesets/Pedestrian.cpp: Make sure orientation is not used if it
	  is not valid.
2004-10-03 03:32:16 +00:00
Al Riddoch
64f959a28b 2004-09-24 Al Riddoch <alriddoch@zepler.org>
* modules/Location.h, modules/Location.cpp: Remove obsolete
	  broken distance functions.
2004-09-24 15:10:45 +00:00
Al Riddoch
bae8cf60ca 2004-09-24 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp, modules/Location.h: Improve algorithm
	  of distance function to handle corner cases, and add a second
	  interface so that both scalar distance and relative position
	  can be found.

	* tests/distancetest.cpp: Update tests to test for cases where
	  distance to or from an entity directly below.
2004-09-23 23:38:23 +00:00
Al Riddoch
0d1e865046 2004-09-23 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp, modules/Location.h: Add new improved
	  function to measure the distance between two entities.

	* tests/distancetest.cpp: New test for new distance measuring
	  function.
2004-09-23 22:09:45 +00:00
Al Riddoch
4855fc9bc1 2004-09-20 Al Riddoch <alriddoch@zepler.org>
* server/WorldRouter.cpp: Fixe debug output to work with new
	  pos type.

	* modules/Location.cpp: Fix one of the transforms, so distance
	  calculation works again.
2004-09-20 17:07:45 +00:00
Al Riddoch
68ab5f7fc8 2004-09-20 Al Riddoch <alriddoch@zepler.org>
* 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.
2004-09-20 10:16:04 +00:00
Al Riddoch
b256b30d90 2004-08-24 Al Riddoch <alriddoch@zepler.org>
* client/Py_CreatorClient.cpp, common/BaseEntity.cpp,
	  common/BaseEntity.h, modules/Location.cpp, modules/Location.h,
	  rulesets/Area.cpp, rulesets/Area.h, rulesets/Character.cpp,
	  rulesets/Character.h, rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/Line.cpp, rulesets/Line.h, rulesets/MemMap.cpp,
	  rulesets/Pedestrian.cpp, rulesets/Plant.cpp, rulesets/Plant.h,
	  rulesets/Py_Mind.cpp, rulesets/Py_Object.cpp, rulesets/Py_Thing.cpp,
	  rulesets/Python_API.cpp, rulesets/Stackable.cpp,
	  rulesets/Stackable.h, rulesets/Thing.cpp, rulesets/World.cpp,
	  rulesets/World.h, server/Account.cpp, server/Account.h,
	  server/Admin.cpp, server/Connection.cpp, server/Lobby.cpp,
	  server/Lobby.h, server/Player.cpp, server/Player.h,
	  server/ServerRouting.cpp, server/ServerRouting.h,
	  tests/Areatest.cpp, tests/Entitytest.cpp, tests/Foodtest.cpp,
	  tests/Linetest.cpp, tests/Planttest.cpp, tests/Stackabletest.cpp,
	  tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp:
	  Replace addToObject() with addToMessage() throughout.

	* server/Account.cpp, server/Lobby.cpp: Use BaseEntity::addToMessage().

	* server/Player.cpp: Make adding character types attribute to Message
	  more efficient.
2004-08-24 21:05:06 +00:00
Al Riddoch
96f13800c8 2004-08-07 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h, common/BaseWorld.h,
	  common/Database.cpp, common/Database.h, common/FormattedXMLWriter.cpp,
	  common/FormattedXMLWriter.h, common/accountbase.cpp,
	  common/accountbase.h, common/custom.cpp, common/inheritance.cpp,
	  common/inheritance.h, common/operations.h, common/type_utils.h,
	  common/utility.cpp, common/utility.h, modules/Location.cpp,
	  modules/Location.h, rulesets/Area.cpp, rulesets/Area.h,
	  rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Character.h,
	  rulesets/Creator.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/Entity_getLocation.h, rulesets/Food.cpp, rulesets/Line.cpp,
	  rulesets/Line.h, rulesets/MemMap.cpp, rulesets/MemMap.h,
	  rulesets/Pedestrian.cpp, rulesets/Plant.cpp, rulesets/Plant.h,
	  rulesets/Py_Mind.cpp, rulesets/Py_Object.cpp, rulesets/Py_Object.h,
	  rulesets/Py_Operation.cpp, rulesets/Py_Thing.cpp,
	  rulesets/Python_API.cpp, rulesets/Stackable.cpp, rulesets/Stackable.h,
	  rulesets/Thing.cpp, rulesets/World.cpp, rulesets/World.h,
	  server/Account.cpp, server/Account.h, server/Admin.cpp,
	  server/Admin.h, server/CommClient.cpp, server/CommClient.h,
	  server/CommListener.cpp, server/CommListener.h,
	  server/CommLocalClient.cpp, server/CommLocalClient.h,
	  server/CommMetaClient.h, server/CommPSQLSocket.h,
	  server/CommRemoteClient.cpp, server/CommRemoteClient.h,
	  server/CommServer.cpp, server/CommServer.h, server/CommSocket.cpp,
	  server/CommSocket.h, server/CommUnixListener.cpp,
	  server/CommUnixListener.h, server/Connection.cpp,
	  server/Connection.h, server/EntityFactory.cpp,
	  server/EntityFactory.h, server/Lobby.cpp, server/Lobby.h,
	  server/Persistance.cpp, server/Persistance.h,
	  server/PersistantThingFactory.h, server/Persistor.cpp,
	  server/Player.cpp, server/Player.h, server/Restorer.h,
	  server/Restorer_impl.h, server/ServerRouting.cpp,
	  server/ServerRouting.h, server/TrustedConnection.cpp,
	  server/TrustedConnection.h, server/WorldRouter.cpp,
	  server/WorldRouter.h: Convert code to using Atlas Message
	  typedefs as found in Atlas-C++ 0.6 to aid conversion later.
2004-08-16 14:26:47 +00:00