Commit graph

373 commits

Author SHA1 Message Date
Alistair Riddoch
68bd0c6e25 Refactor TaskFactory for more flexible activation matching
We can now match the target based on different critea by configuring the
factory to do different checks
2011-12-06 10:07:25 +00:00
Alistair Riddoch
c13ccca0b3 Remove obsolete includes 2011-12-02 03:35:00 +00:00
Alistair Riddoch
7025431b94 Clean up startup logic, and fix error
The code was not previously sending out the Sight(Action) op, as it was
returning after task startup
2011-12-02 03:25:42 +00:00
Alistair Riddoch
111581e56a Remove obsolete m_task in Character
This pointer is made obsolete now that TasksProperty holds it
2011-12-02 02:37:42 +00:00
Alistair Riddoch
6269203f68 Remove reference to m_task 2011-12-02 01:25:13 +00:00
Alistair Riddoch
bdf3de3cd6 Cut down direct use of m_task 2011-11-30 18:52:29 +00:00
Alistair Riddoch
82cde74867 Remove unrequired reference to m_task 2011-11-25 23:39:51 +00:00
Alistair Riddoch
490d812683 Move task stopping into TasksProperty 2011-11-21 11:42:47 +00:00
Alistair Riddoch
8c52d6a1f3 Move tick processing into TasksProperty 2011-11-19 23:19:45 +00:00
Alistair Riddoch
c38a8945dd Move clearTask into TasksProperty 2011-11-18 16:26:24 +00:00
Alistair Riddoch
0a37a97e26 Move startTask functionality into TasksProperty 2011-11-17 10:41:47 +00:00
Alistair Riddoch
63b8d85f7a Ensure tasks get cleaned up on deletion
In two cases tasks were not getting cleaned up. The first was on shutdown
and the second was if the Character deleted while performing a task. The
latte is fixed by hooking into Entity::destroy. The former by decRef()ing
from the destructor
2011-10-03 19:23:55 +01:00
Alistair Riddoch
ac37383d8a Convery all the property get functions 2011-09-29 17:36:26 +01:00
Alistair Riddoch
f752240995 Use WFMath type for spatial calculations 2011-04-27 19:55:52 +01:00
Alistair Riddoch
020a4370fc Process actuate ops in main dispatch, not in mind filter 2010-11-23 16:02:12 +00:00
Alistair Riddoch
85cce5e15e Add Actuate to those ops handled by Character 2010-11-23 14:00:38 +00:00
Alistair Riddoch
0a209b3250 Add a warning check if a task seems to do nothing. 2009-08-12 11:45:05 +01:00
Alistair Riddoch
76558ef3b6 Remove obsolete setTask member function. 2009-07-29 13:03:40 +01:00
Alistair Riddoch
57f3c92477 Use a single updateTask method whenever task data needs to be updated. 2009-07-28 19:04:49 +01:00
Alistair Riddoch
f21b2a597c Initiate combat tasks using startTask(). 2009-07-28 18:41:03 +01:00
Alistair Riddoch
65ff81f59c Replace call to many task related functions to a single call to startTask(). 2009-07-28 18:27:51 +01:00
Alistair Riddoch
70f25af6c8 Add a new unused method which handles all the steps of setting up a task. 2009-07-28 16:53:00 +01:00
Alistair Riddoch
188b6ecc5f Add handler for Use ops, and don't process them in the mind filter. 2009-07-24 20:18:11 +01:00
Alexey Torkhov
75b62e6925 Typo. 2009-07-14 19:33:07 +04:00
Alistair Riddoch
d291124470 Add handlers for thought and goal_info operation handlers. 2009-07-05 19:04:35 +01:00
Alistair Riddoch
45b2904865 Fix a typo in the debug output. 2009-06-29 23:14:55 +01:00
Alistair Riddoch
e336c47821 Add some comments. 2009-06-18 01:17:30 +01:00
Alistair Riddoch
247499f34d Ensure that a TasksProperty is installed whenever tasks are updated. 2009-06-18 01:15:53 +01:00
Al Riddoch
ab54d0fea2 2009-02-02 Al Riddoch <alriddoch@googlemail.com>
* common/Identified.cpp, common/Identified.h:
	  Flatten down the base classes into one called Router.

	* client/CharacterClient.cpp, client/CreatorClient.cpp,
	  rulesets/BaseMind.cpp, rulesets/Character.cpp,
	  rulesets/Creator.cpp, rulesets/Entity.cpp,
	  rulesets/LocatedEntity.cpp, rulesets/MemEntity.cpp,
	  rulesets/Plant.cpp, rulesets/Stackable.cpp,
	  rulesets/Thing.cpp, rulesets/World.cpp,
	  server/Account.cpp, server/Admin.cpp,
	  server/Connection.cpp, server/ExternalMind.cpp,
	  server/Lobby.cpp, server/Master.cpp,
	  server/Peer.cpp, server/Player.cpp,
	  server/ServerRouting.cpp, server/SlaveClientConnection.cpp,
	  server/TrustedConnection.cpp, tests/LocatedEntitytest.cpp,
	  tests/ThingupdatePropertiestest.cpp: Update all the operation
	  routing classes to use the modified base class correctly.
2009-02-02 02:28:45 +00:00
Al Riddoch
4d37d77dd7 2008-12-01 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp, rulesets/Character.h: Remove an unused flag
	  used to signal a character is dead.
2008-12-07 03:51:06 +00:00
Al Riddoch
233b8bedd2 2008-11-29 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp, rulesets/Character.h: Remove all traces
	  of the hard coded statistics property from Character.

	* rulesets/Py_Property.cpp: Don't use Py_StatisticsProperty as the
	  default wrapper for a statistics property because it will no
	  longer work this way.

	* rulesets/Python_API.cpp: Remove the setup for the Statistics
	  wrapper.

	* rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h:
	  Change the footprint of this class so it is no longer hooked
	  into part of the Character class, and instead handles looking
	  up values from the script directly, and owns the script itself.

	* server/ArithmeticFactory.cpp, server/ArithmeticFactory.h,
	  server/EntityFactory.cpp, server/EntityFactory.h,
	  server/PersistantThingFactory.cpp: Remove setup of hard coded
	  statistics property.

	* rulesets/Statistics.h, rulesets/Statistics.cpp,
	  rulesets/Py_Statistics.h, rulesets/Py_Statistics.cpp,
	  rulesets/Makefile.am: Remove clases that are no longer used.
2008-11-29 23:17:38 +00:00
Al Riddoch
065d3873f2 2008-11-24 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp: Remove the hard coded property for wielding
	  as it will always be handled dynamically as required.
2008-11-24 15:56:21 +00:00
Al Riddoch
7eec7e2b5f 2008-11-21 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp: Use std::strings rather the literals for
	  property names.
2008-11-21 15:53:11 +00:00
Al Riddoch
b8bd2e75e4 2008-11-13 Al Riddoch <alriddoch@googlemail.com>
* rulesets/BaseMind.cpp, rulesets/Character.cpp,
	  rulesets/EntityProperty.cpp, rulesets/Stackable.cpp:
	  Remove a bunch of stray debug output.
2008-11-13 02:33:04 +00:00
Al Riddoch
bdc7c2b12b 2008-11-11 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp: Back off a change which was intended
	  to suppress a warning, but did not work.
2008-11-11 00:52:11 +00:00
Al Riddoch
497377be43 2008-11-11 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp: Clean up some unused declarations and
	  headers.

	* rulesets/Plant.cpp, rulesets/Thing.cpp: Remove some unused
	  includes.
2008-11-11 00:45:52 +00:00
Al Riddoch
a8b1ab7c6d 2008-11-10 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.h, rulesets/Character.cpp: Replace hard coded
	  stamina value with a property.
2008-11-10 21:28:07 +00:00
Al Riddoch
5a5a0f0fa6 2008-11-10 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.h, rulesets/Character.cpp: Replace hard
	  coded maximum mass with an attribute check.
2008-11-10 21:13:06 +00:00
Al Riddoch
9ca9637e26 2008-11-09 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp: Suppress a warning about unused members.
2008-11-09 15:45:14 +00:00
Al Riddoch
d37d183063 2008-10-09 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp: Remove a check used during refactoring
	  and debugging.
2008-10-09 00:24:59 +00:00
Al Riddoch
a80f85e85a 2008-10-01 Al Riddoch <alriddoch@googlemail.com>
* rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h: Make all the
	  property access functions that should never be used to modify a
	  property const. Remove requirePropertyClass() as it pretty much
	  can't be const.

	* rulesets/Entity.cpp, rulesets/Entity.h: Make overriden
	  getProperty() const as it is in the base class. Add new
	  property access functions for code that needs to modify the
	  properties which ensures class properties never get modified
	  through the Entity interface.

	* rulesets/Character.cpp, rulesets/Plant.cpp, rulesets/Py_Thing.cpp,
	  rulesets/TerrainModProperty.cpp, server/CorePropertyManager.cpp:
	  Change all the code that accesses properties to use the right
	  functions.
2008-10-01 18:20:57 +00:00
Al Riddoch
660abec7d2 2008-10-01 Al Riddoch <alriddoch@googlemail.com>
* rulesets/LocatedEntity.h: Rename some member functions and templates
	  to make more sense and be consistent.

	* rulesets/Character.cpp, rulesets/Plant.cpp,
	  server/CorePropertyManager.cpp: Fix the code to use the new names.
2008-10-01 16:30:29 +00:00
Al Riddoch
5c1ed31837 2008-09-29 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp, rulesets/Plant.cpp, rulesets/Plant.h:
	  Update the metabolism code to access properties in the cleanest
	  most type safe way possible.
2008-09-29 02:52:12 +00:00
Al Riddoch
f8ce29c07b 2008-09-27 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Plant.cpp,
	  rulesets/Stackable.cpp: Fix up places that use the property
	  manager interface. Fix explicit reference to DynamicProperty.
2008-09-27 16:18:43 +00:00
Al Riddoch
d656b2c708 2008-09-23 Al Riddoch <alriddoch@googlemail.com>
* common/Property.h: Add a flag to indicate a properties value
	  has been changed, but the new value has not been broadcast.

	* rulesets/Thing.cpp: Re-write the Update handler to ignore the
	  operation arguments, and broadcast an update for all properties
	  marked as unsent.

	* rulesets/Character.cpp: Update all code which sent an update
	  operation so that it sets the flags rather than naming them
	  in the argument.
2008-09-22 23:47:04 +00:00
Al Riddoch
336ecf1486 2008-09-12 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp, rulesets/Character.h: Remove the setup
	  handler which used to install minds and send tick, as this is
	  all handled by properties now.
2008-09-12 14:04:15 +00:00
Al Riddoch
ddb0c144e7 2008-09-09 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp: Make statistics ephemeral. Remove hard
	  coded bbox.
2008-09-09 14:02:34 +00:00
Al Riddoch
fab8a833ff 2008-09-08 Al Riddoch <alriddoch@googlemail.com>
* rulesets/ActivePropertyFactory_impl.h: Re-work the active property
	  factories so they just pass handler information to the property
	  classes rather than installing it themselves, so the property
	  can now handle installing the handlers each time they are installed
	  on an entity, making class default properties work.

	* client/ClientPropertyManager.cpp, client/ClientPropertyManager.h,
	  common/PropertyFactory.h, common/PropertyFactory_impl.h,
	  common/PropertyManager.h, rulesets/ActivePropertyFactory.h,
	  server/CorePropertyManager.cpp, server/CorePropertyManager.h:
	  Modify the property manager and property factory interfaces so they
	  do not take a pointer to the owner, as this is never required any
	  more.

	* rulesets/Character.cpp, rulesets/Entity.cpp: Modify code that uses
	  property managers to use the new interface.

	* rulesets/SolidProperty.cpp, rulesets/SolidProperty.h: Make use of
	  the bool flag to implement this, preventing it from being tied to
	  having a pointer to the owner at creation time.

	* rulesets/StatusProperty.cpp, rulesets/StatusProperty.h: Remove
	  the need for an owner pointer at construction time by using the
	  apply method.

	* rulesets/TerrainModProperty.cpp, rulesets/TerrainModProperty.h:
	  Use new MultiActivePropertyManager and install method to handle
	  installing handlers rather than relying on the factory to do it.

	* server/CorePropertyManager.cpp: Change many of the property
	  factories now that none get get an owner pointer.

	* server/EntityFactory.cpp: Set up default properties on all type
	  nodes when a new class is installed, and don't apply instance
	  properties based on class defaults, relying on class properties.

	* rulesets/Entity.cpp: Remove hard coded BBox property now that the
	  functionality is handled by a more special property.
2008-09-08 00:17:08 +00:00
Al Riddoch
8c172a8c87 Remove trailing whitespace 2008-08-31 04:38:31 +00:00
Al Riddoch
187ef8fcd9 2008-08-22 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Entity.h: Move entity flags to the top of the header.
	  Replace destroyed and perceptive booleans with flag values,
	  and re-work check methods accordingly.

	* rulesets/Entity.cpp, rulesets/Creator.cpp, rulesets/Character.cpp:
	  Ensure that destroyed and perceptive flags are used correctly.
2008-08-22 03:00:38 +00:00