cyphesis/rulesets/Stackable.cpp

164 lines
4.8 KiB
C++
Raw Permalink Normal View History

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
// Cyphesis Online RPG Server and AI Engine
// Copyright (C) 2000,2001 Alistair Riddoch
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
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* rulesets/Py_Location.cpp: Added bbox and bmedian attributes of location object to python wrappers. * rulesets/Character.cpp: Added initialisation of bounding box median for characters. * modules/DateTime.*: Added configurability to date so that each period of time has definable number of divisions. Default is as per real world calendar restricted to 30 day months. * Added Fire operation handling to Thing class, so that any entity with a burn_speed attribute will burn. * Added Food C++ base class, which implements cooking. * Altered the semantics of the Eat/Fire/Nourish operations so multiple arguments are no longer required. from is used to determine the other entity involved. * Added the beginnings of an astronomy system, but not yet used anywhere. * Added appearance handling to BaseMind and Memory. * Added sequence no to all entities, which is incremented each time a move or set operation is received. sequence no "seq" is included in args of Appearance operations. * Moved functionality from Animal python base class into Character C++ base class. This much improves the performance of modelling animals, and means that player characters, and NPCs get hungry and need to eat. Reduced the speed at which animals consume energy so they don't starve quite as quickly. * Added collision prediction functions that handle both entities having velocity. * Added combine functionality to Stackable. Divide comes next. Once functional, this will become the base class for any items which will commonly be used as stacks. Al
2001-03-07 11:49:43 +00:00
* rulesets/Py_Location.cpp: Added bbox and bmedian attributes of location object to python wrappers. * rulesets/Character.cpp: Added initialisation of bounding box median for characters. * modules/DateTime.*: Added configurability to date so that each period of time has definable number of divisions. Default is as per real world calendar restricted to 30 day months. * Added Fire operation handling to Thing class, so that any entity with a burn_speed attribute will burn. * Added Food C++ base class, which implements cooking. * Altered the semantics of the Eat/Fire/Nourish operations so multiple arguments are no longer required. from is used to determine the other entity involved. * Added the beginnings of an astronomy system, but not yet used anywhere. * Added appearance handling to BaseMind and Memory. * Added sequence no to all entities, which is incremented each time a move or set operation is received. sequence no "seq" is included in args of Appearance operations. * Moved functionality from Animal python base class into Character C++ base class. This much improves the performance of modelling animals, and means that player characters, and NPCs get hungry and need to eat. Reduced the speed at which animals consume energy so they don't starve quite as quickly. * Added collision prediction functions that handle both entities having velocity. * Added combine functionality to Stackable. Divide comes next. Once functional, this will become the base class for any items which will commonly be used as stacks. Al
2001-03-07 11:49:43 +00:00
// A stackable object, ie one which can represent multiple object of the
// same type. Used for things like coins.
#include "Stackable.h"
#include "Script.h"
* rulesets/Py_Location.cpp: Added bbox and bmedian attributes of location object to python wrappers. * rulesets/Character.cpp: Added initialisation of bounding box median for characters. * modules/DateTime.*: Added configurability to date so that each period of time has definable number of divisions. Default is as per real world calendar restricted to 30 day months. * Added Fire operation handling to Thing class, so that any entity with a burn_speed attribute will burn. * Added Food C++ base class, which implements cooking. * Altered the semantics of the Eat/Fire/Nourish operations so multiple arguments are no longer required. from is used to determine the other entity involved. * Added the beginnings of an astronomy system, but not yet used anywhere. * Added appearance handling to BaseMind and Memory. * Added sequence no to all entities, which is incremented each time a move or set operation is received. sequence no "seq" is included in args of Appearance operations. * Moved functionality from Animal python base class into Character C++ base class. This much improves the performance of modelling animals, and means that player characters, and NPCs get hungry and need to eat. Reduced the speed at which animals consume energy so they don't starve quite as quickly. * Added collision prediction functions that handle both entities having velocity. * Added combine functionality to Stackable. Divide comes next. Once functional, this will become the base class for any items which will commonly be used as stacks. Al
2001-03-07 11:49:43 +00:00
#include "common/BaseWorld.h"
#include "common/log.h"
#include "common/Property.h"
#include "common/TypeNode.h"
#include <Atlas/Objects/Operation.h>
#include <Atlas/Objects/Anonymous.h>
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
using Atlas::Message::Element;
using Atlas::Objects::Root;
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
using Atlas::Objects::Operation::Create;
using Atlas::Objects::Operation::Delete;
using Atlas::Objects::Operation::Set;
using Atlas::Objects::Operation::Sight;
using Atlas::Objects::Entity::Anonymous;
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
/// \brief Stackable constructor
///
/// @param id identifier of this Entity
/// @param intId identifier of this Entity
Stackable::Stackable(const std::string & id, long intId) :
2012-12-04 23:45:53 +00:00
Thing(id, intId),
m_num(1)
* rulesets/Py_Location.cpp: Added bbox and bmedian attributes of location object to python wrappers. * rulesets/Character.cpp: Added initialisation of bounding box median for characters. * modules/DateTime.*: Added configurability to date so that each period of time has definable number of divisions. Default is as per real world calendar restricted to 30 day months. * Added Fire operation handling to Thing class, so that any entity with a burn_speed attribute will burn. * Added Food C++ base class, which implements cooking. * Altered the semantics of the Eat/Fire/Nourish operations so multiple arguments are no longer required. from is used to determine the other entity involved. * Added the beginnings of an astronomy system, but not yet used anywhere. * Added appearance handling to BaseMind and Memory. * Added sequence no to all entities, which is incremented each time a move or set operation is received. sequence no "seq" is included in args of Appearance operations. * Moved functionality from Animal python base class into Character C++ base class. This much improves the performance of modelling animals, and means that player characters, and NPCs get hungry and need to eat. Reduced the speed at which animals consume energy so they don't starve quite as quickly. * Added collision prediction functions that handle both entities having velocity. * Added combine functionality to Stackable. Divide comes next. Once functional, this will become the base class for any items which will commonly be used as stacks. Al
2001-03-07 11:49:43 +00:00
{
// m_properties["num"] = new Property<int>(m_num, 0);
* rulesets/Py_Location.cpp: Added bbox and bmedian attributes of location object to python wrappers. * rulesets/Character.cpp: Added initialisation of bounding box median for characters. * modules/DateTime.*: Added configurability to date so that each period of time has definable number of divisions. Default is as per real world calendar restricted to 30 day months. * Added Fire operation handling to Thing class, so that any entity with a burn_speed attribute will burn. * Added Food C++ base class, which implements cooking. * Altered the semantics of the Eat/Fire/Nourish operations so multiple arguments are no longer required. from is used to determine the other entity involved. * Added the beginnings of an astronomy system, but not yet used anywhere. * Added appearance handling to BaseMind and Memory. * Added sequence no to all entities, which is incremented each time a move or set operation is received. sequence no "seq" is included in args of Appearance operations. * Moved functionality from Animal python base class into Character C++ base class. This much improves the performance of modelling animals, and means that player characters, and NPCs get hungry and need to eat. Reduced the speed at which animals consume energy so they don't starve quite as quickly. * Added collision prediction functions that handle both entities having velocity. * Added combine functionality to Stackable. Divide comes next. Once functional, this will become the base class for any items which will commonly be used as stacks. Al
2001-03-07 11:49:43 +00:00
}
Stackable::~Stackable()
* rulesets/Py_Location.cpp: Added bbox and bmedian attributes of location object to python wrappers. * rulesets/Character.cpp: Added initialisation of bounding box median for characters. * modules/DateTime.*: Added configurability to date so that each period of time has definable number of divisions. Default is as per real world calendar restricted to 30 day months. * Added Fire operation handling to Thing class, so that any entity with a burn_speed attribute will burn. * Added Food C++ base class, which implements cooking. * Altered the semantics of the Eat/Fire/Nourish operations so multiple arguments are no longer required. from is used to determine the other entity involved. * Added the beginnings of an astronomy system, but not yet used anywhere. * Added appearance handling to BaseMind and Memory. * Added sequence no to all entities, which is incremented each time a move or set operation is received. sequence no "seq" is included in args of Appearance operations. * Moved functionality from Animal python base class into Character C++ base class. This much improves the performance of modelling animals, and means that player characters, and NPCs get hungry and need to eat. Reduced the speed at which animals consume energy so they don't starve quite as quickly. * Added collision prediction functions that handle both entities having velocity. * Added combine functionality to Stackable. Divide comes next. Once functional, this will become the base class for any items which will commonly be used as stacks. Al
2001-03-07 11:49:43 +00:00
{
}
void Stackable::CombineOperation(const Operation & op, OpVector & res)
* rulesets/Py_Location.cpp: Added bbox and bmedian attributes of location object to python wrappers. * rulesets/Character.cpp: Added initialisation of bounding box median for characters. * modules/DateTime.*: Added configurability to date so that each period of time has definable number of divisions. Default is as per real world calendar restricted to 30 day months. * Added Fire operation handling to Thing class, so that any entity with a burn_speed attribute will burn. * Added Food C++ base class, which implements cooking. * Altered the semantics of the Eat/Fire/Nourish operations so multiple arguments are no longer required. from is used to determine the other entity involved. * Added the beginnings of an astronomy system, but not yet used anywhere. * Added appearance handling to BaseMind and Memory. * Added sequence no to all entities, which is incremented each time a move or set operation is received. sequence no "seq" is included in args of Appearance operations. * Moved functionality from Animal python base class into Character C++ base class. This much improves the performance of modelling animals, and means that player characters, and NPCs get hungry and need to eat. Reduced the speed at which animals consume energy so they don't starve quite as quickly. * Added collision prediction functions that handle both entities having velocity. * Added combine functionality to Stackable. Divide comes next. Once functional, this will become the base class for any items which will commonly be used as stacks. Al
2001-03-07 11:49:43 +00:00
{
int old_num = m_num;
const std::vector<Root> & args = op->getArgs();
std::vector<Root>::const_iterator Iend = args.end();
for (std::vector<Root>::const_iterator I = args.begin(); I != Iend; ++I) {
const Root & arg = *I;
if (!arg->hasAttrFlag(Atlas::Objects::ID_FLAG)) {
error(op, "Combine op arg has no ID", res, getId());
continue;
}
const std::string & id = arg->getId();
if (arg->getId() == getId()) {
// This is normal
continue;
}
LocatedEntity * ent = BaseWorld::instance().getEntity(id);
if (ent == NULL) {
// FIXME Send an Unseen op?
continue;
}
Stackable * obj = dynamic_cast<Stackable *>(ent);
if (obj == NULL) { continue; }
if (obj->m_type != m_type) { continue; }
m_num = m_num + obj->m_num;
// This ensures an attempt to stack this entitie multiple times will
// not result in a dupped item
obj->m_num = 0;
Delete d;
Anonymous del_arg;
del_arg->setId(id);
d->setTo(id);
d->setArgs1(del_arg);
* rulesets/Py_Location.cpp: Added bbox and bmedian attributes of location object to python wrappers. * rulesets/Character.cpp: Added initialisation of bounding box median for characters. * modules/DateTime.*: Added configurability to date so that each period of time has definable number of divisions. Default is as per real world calendar restricted to 30 day months. * Added Fire operation handling to Thing class, so that any entity with a burn_speed attribute will burn. * Added Food C++ base class, which implements cooking. * Altered the semantics of the Eat/Fire/Nourish operations so multiple arguments are no longer required. from is used to determine the other entity involved. * Added the beginnings of an astronomy system, but not yet used anywhere. * Added appearance handling to BaseMind and Memory. * Added sequence no to all entities, which is incremented each time a move or set operation is received. sequence no "seq" is included in args of Appearance operations. * Moved functionality from Animal python base class into Character C++ base class. This much improves the performance of modelling animals, and means that player characters, and NPCs get hungry and need to eat. Reduced the speed at which animals consume energy so they don't starve quite as quickly. * Added collision prediction functions that handle both entities having velocity. * Added combine functionality to Stackable. Divide comes next. Once functional, this will become the base class for any items which will commonly be used as stacks. Al
2001-03-07 11:49:43 +00:00
res.push_back(d);
}
if (old_num == m_num) {
return;
}
Set set;
Anonymous set_arg;
set_arg->setId(getId());
set_arg->setAttr("num", m_num);
set->setArgs1(set_arg);
set->setTo(getId());
Sight sight;
sight->setArgs1(set_arg);
res.push_back(sight);
* rulesets/Py_Location.cpp: Added bbox and bmedian attributes of location object to python wrappers. * rulesets/Character.cpp: Added initialisation of bounding box median for characters. * modules/DateTime.*: Added configurability to date so that each period of time has definable number of divisions. Default is as per real world calendar restricted to 30 day months. * Added Fire operation handling to Thing class, so that any entity with a burn_speed attribute will burn. * Added Food C++ base class, which implements cooking. * Altered the semantics of the Eat/Fire/Nourish operations so multiple arguments are no longer required. from is used to determine the other entity involved. * Added the beginnings of an astronomy system, but not yet used anywhere. * Added appearance handling to BaseMind and Memory. * Added sequence no to all entities, which is incremented each time a move or set operation is received. sequence no "seq" is included in args of Appearance operations. * Moved functionality from Animal python base class into Character C++ base class. This much improves the performance of modelling animals, and means that player characters, and NPCs get hungry and need to eat. Reduced the speed at which animals consume energy so they don't starve quite as quickly. * Added collision prediction functions that handle both entities having velocity. * Added combine functionality to Stackable. Divide comes next. Once functional, this will become the base class for any items which will commonly be used as stacks. Al
2001-03-07 11:49:43 +00:00
}
void Stackable::DivideOperation(const Operation & op, OpVector & res)
* rulesets/Py_Location.cpp: Added bbox and bmedian attributes of location object to python wrappers. * rulesets/Character.cpp: Added initialisation of bounding box median for characters. * modules/DateTime.*: Added configurability to date so that each period of time has definable number of divisions. Default is as per real world calendar restricted to 30 day months. * Added Fire operation handling to Thing class, so that any entity with a burn_speed attribute will burn. * Added Food C++ base class, which implements cooking. * Altered the semantics of the Eat/Fire/Nourish operations so multiple arguments are no longer required. from is used to determine the other entity involved. * Added the beginnings of an astronomy system, but not yet used anywhere. * Added appearance handling to BaseMind and Memory. * Added sequence no to all entities, which is incremented each time a move or set operation is received. sequence no "seq" is included in args of Appearance operations. * Moved functionality from Animal python base class into Character C++ base class. This much improves the performance of modelling animals, and means that player characters, and NPCs get hungry and need to eat. Reduced the speed at which animals consume energy so they don't starve quite as quickly. * Added collision prediction functions that handle both entities having velocity. * Added combine functionality to Stackable. Divide comes next. Once functional, this will become the base class for any items which will commonly be used as stacks. Al
2001-03-07 11:49:43 +00:00
{
int old_num = m_num;
const std::vector<Root> & args = op->getArgs();
std::vector<Root>::const_iterator Iend = args.end();
for (std::vector<Root>::const_iterator I = args.begin(); I != Iend; ++I) {
const Root & arg = *I;
if (arg->hasAttrFlag(Atlas::Objects::ID_FLAG)) {
if (arg->getId() != getId()) {
log(ERROR, "Divide operation has wrong ID in args");
}
continue;
}
int new_num = 1;
Element num_attr;
if (arg->copyAttr("num", num_attr) != 0 && num_attr.isInt()) {
new_num = num_attr.asInt();
}
if (m_num <= new_num) {
log(ERROR, "Attempt to divide entity into a chunk larger than the original");
continue;
}
m_num -= new_num;
Anonymous create_arg;
create_arg->setParents(std::list<std::string>(1, m_type->name()));
if (new_num > 1) {
create_arg->setAttr("num", new_num);
}
Create c;
c->setArgs1(create_arg);
c->setTo(getId());
res.push_back(c);
}
2002-05-18 Al Riddoch <alriddoch@zepler.org> * client/ObserverClient.cpp, server/Account.cpp, server/Connection.h, server/Routing.h: Formatting cleanup * client/Py_CreatorClient.cpp, 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/Plant.cpp, rulesets/Plant.h, rulesets/Py_Mind.cpp, rulesets/Py_Thing.cpp, rulesets/Stackable.cpp, rulesets/Stackable.h: Replace operator[] with get() method for querying attributes. Make this get() method const, and re-write the internals so that it more cleanly handles attributes. * common/BaseWorld.h: Re-write world.getObject() so that it no longer uses std::map::operator[], as the old method was inserting NULLs into the world dictionary when non-existant entities were queried. * rulesets/Character.cpp: Clean up outstanding issues when movement position is supplied, and is very close to being correct, and clarify comments about movement when neither destination nor source are provided. * rulesets/Character.cpp: Modify mind2body interface so that setting the TO of ops is done in the individual handlers, and copying the operation globally is avoided. * rulesets/MemMap_methods.h: Remove dodgy debug code. * rulesets/Pedestrian.cpp: Clarify movement fixme. * rulesets/Py_Operation.cpp: Clarify operation time handler fixme. * rulesets/Stackable.cpp: Clarify fixme's in combine and divide handlers. * server/CommServer.cpp: Remove redundant fixme. * server/Connection.cpp, server/ServerRouting.cpp, server/ServerRouting.h, server/ServerRouting_methods.h, server/server.cpp: Move inline ServerRouting::getObject into class header. * server/WorldRouter.cpp, server/WorldRouter.h: Clean up includes, and move updateTime into the main body of the file. Clean up code formatting when handling maps and dictionaries. Clarify error output and comments about NULL objects in the world dictionary.
2002-05-18 18:09:14 +00:00
// Currently does not send sight ops, as the Sight ops for this type of
// thing have not been discussed
if (old_num == m_num) {
return;
}
Set set;
Anonymous set_arg;
set_arg->setId(getId());
set_arg->setAttr("num", m_num);
set->setArgs1(set_arg);
set->setTo(getId());
Sight sight;
sight->setArgs1(set_arg);
res.push_back(sight);
* rulesets/Py_Location.cpp: Added bbox and bmedian attributes of location object to python wrappers. * rulesets/Character.cpp: Added initialisation of bounding box median for characters. * modules/DateTime.*: Added configurability to date so that each period of time has definable number of divisions. Default is as per real world calendar restricted to 30 day months. * Added Fire operation handling to Thing class, so that any entity with a burn_speed attribute will burn. * Added Food C++ base class, which implements cooking. * Altered the semantics of the Eat/Fire/Nourish operations so multiple arguments are no longer required. from is used to determine the other entity involved. * Added the beginnings of an astronomy system, but not yet used anywhere. * Added appearance handling to BaseMind and Memory. * Added sequence no to all entities, which is incremented each time a move or set operation is received. sequence no "seq" is included in args of Appearance operations. * Moved functionality from Animal python base class into Character C++ base class. This much improves the performance of modelling animals, and means that player characters, and NPCs get hungry and need to eat. Reduced the speed at which animals consume energy so they don't starve quite as quickly. * Added collision prediction functions that handle both entities having velocity. * Added combine functionality to Stackable. Divide comes next. Once functional, this will become the base class for any items which will commonly be used as stacks. Al
2001-03-07 11:49:43 +00:00
}