Remove the dictionary for storing arbitrary Python attributes on the
task, as the underlying generic calls do this for subclasses, and it
is undesirable to be able to store attributes on the bare wrapper
* rulesets/Py_BBox.cpp, rulesets/Py_Location.cpp, rulesets/Py_Map.cpp,
rulesets/Py_Mind.cpp, rulesets/Py_Object.cpp,
rulesets/Py_Operation.cpp, rulesets/Py_Oplist.cpp,
rulesets/Py_Optime.cpp, rulesets/Py_Quaternion.cpp,
rulesets/Py_RootEntity.cpp, rulesets/Py_Task.cpp,
rulesets/Py_Thing.cpp, rulesets/Py_World.cpp,
rulesets/Python_API.cpp: Replace calls to PyMem_DEL with calls
to PyObject_Free. Thanks to Kai for doing most of the digging
on this one.
* rulesets/Py_Task.cpp: Allow progress to be set as an integer from
a task script.
* data/mason.xml, rulesets/mason/world/tasks/Slice.py: Add a new
slice task for sawing logs into boards.
* rulesets/TaskScript.h: Add accessor for the script object associated
with a task.
* rulesets/Py_Task.cpp: Add a function to wrap a task which uses the
tasks existing python object if it has one.
* rulesets/Py_Task.cpp: Missing missing return when an error is
detected.
* rulesets/Python_API.cpp: Remove obsolete Vector3D and Point3D
constructors and method tables, now replaced by init method
implementations.
* server/EntityFactory.cpp: Comment out as yet unused code for
updating a task factory from an admin client.
* rulesets/Py_BBox.cpp: Add method exposing boxSquareBoundingRadius
to python.
* rulesets/Task.cpp, rulesets/Task.h: Add method to generate the
next tick for this task, using a given interval. Fix setting
progress and rate, so both can be zero.
* rulesets/Py_Task.cpp: Expose nextTick() method to python.
Allow rate to be set as an integer from python, so it can be zero.
* rulesets/mason/world/tasks/Combat.py: Use next_tick() for all
tick ops.
* rulesets/mason/world/tasks/Logging.py,
rulesets/mason/world/tasks/Raise.py,
rulesets/mason/world/tasks/Ram.py,
rulesets/mason/world/tasks/Sharpen.py: Add range checks, and use
next_tick() to simplify tick op generation.
* rulesets/Task.cpp, rulesets/Task.h: Add two members to task,
progress and rate which handle the progress towards completion,
and the rate at which it is changing. Add a member function which
adds an atlas representation of the task as an attribute to an
Atlas entity.
* rulesets/Py_Task.cpp: Expose progress and rate attributes allowing
them to be set.
* server/TaskFactory.cpp: Set the name of a task when it is created
by its factory.
* rulesets/mason/world/tasks/Logging.py: Set the progress and rate
of the logging task as it progresses.
* rulesets/Character.h, rulesets/Character.cpp: Add updateTask()
method to be called when task ticks. Make initTask, updateTask
and clearTask emit Set operations which set the TASK attribute
on the character to reflect the current status of the task.
* rulesets/mason/world/tasks/Logging.py,
rulesets/mason/world/tasks/Raise.py,
rulesets/mason/world/tasks/Ram.py,
rulesets/mason/world/tasks/Sharpen.py: Add serial numbers to
tick ups.
* rulesets/mason/world/tasks/Combat.py: Fix the attacker initiative
and detect if combat is obsolete if a character has been defeated.
* rulesets/Task.h: Add an accessor to return an incremented serial
number for a new tick op.
* rulesets/Py_Task.cpp: Add python wrapper for new tick accessor.
* rulesets/Character.cpp: Add debug output to code enforcing
old task ticks.
* rulesets/Character.cpp: Improve error logging in task setup.
* rulesets/Task.h, rulesets/Py_Task.cpp: Add an accessor for the
refcount of a task, and expose it to the script interface.
* rulesets/mason/world/tasks/Combat.py: Add a check that there are
still at least two participants in combat, or end the task.
* rulesets/Character.cpp, rulesets/StatisticsProperty.h,
rulesets/StatisticsProperty.cpp: Add a property handler for
statistics.
* rulesets/Character.cpp: When setting task, check if an existing
task needs to be cleared first. When clearing a task, check
whether a task exists or not.
* rulesets/Character.cpp: When initiating combat task from task
factory, check to see if the task is successfully created before
using it.
* rulesets/Py_Property.cpp, rulesets/Py_Property.h: New python wrapper
class for entity properties.
* rulesets/Py_Mind.cpp: Re-work getattr logic to make it clearer.
* rulesets/Py_Object.cpp: Return Py_None when an Atlas Element cannot
be converted to python. This ensures that this function never returns
null.
* rulesets/Py_Statistics.cpp: Add temporary handlers for hardcoded
statistics for "attack", "defence", and "strength".
* rulesets/Py_Task.cpp: Add wrappers for methods Task.irrelevant and
Task.obsolete, as these are now required in combat scripts.
* rulesets/Py_Task.h: Fix the PyTask_Check macro, which was miscoded.
* rulesets/Py_Thing.cpp: Add wrapper for Entity.send_world so that
scripts can channel ops through entities.
* rulesets/Py_Thing.h, rulesets/Py_Thing.cpp: Add an addition structure
for directlty wrapping Character in a type safe way. Add method
structure pointer to Entity and Character wrappers so that
the same getattr method is used for both. Add new method table for
Character including wrappers for set_task and clear_task, allowing
task scripts to add themselves and remove themselves from
characters. Modify wrapEntity() to ensure that Character entities
get the right wrapper.
* rulesets/Py_Thing.cpp: Re-work getattr code so that properties and
soft attributes are checked individually, rather than in a single
call to Entity.get. Use new python property wrappers to wrap
properties explicitly if required rather than converting to Atlas
then to generic Python data.
* rulesets/TerrainProperty.h: Fix incorrect class description in
documentation.
* rulesets/mason/world/tasks/Combat.py: Complete implementation of
simple example combat.
* server/TaskFactory.cpp: Remove debug output.
* rulesets/Py_Statistics.cpp, rulesets/Py_Task.cpp: Modify
getattr handlers for "character" to use wrapEntity.
* rulesets/Task.h: Add accessor for character that owns this task.
* rulesets/Py_Thing.cpp: Clean up error messages. Delay initialisation
of entity's python attribute store until its required.
* rulesets/Py_Task.cpp, rulesets/Py_Task.h: Basic python wrappers
written for Task.