While there is still probably a converstion going on, I'd rather keep
our code cleaner and avoid explicitly converting here. If Python has to do
the conversion in PyArg_ParseTuple, then so be it.
* rulesets/mason/world/tasks/Logging.py: Implement logging entirely
in the task, instead of relying on functionality in the plant
class.
* rulesets/Py_Quaternion.cpp: Implement rotation method as in the
the wfmath class, as required for Logging.
* rulesets/Plant.cpp: Add an error message if the old plant
functionality gets called.
* rulesets/basic/world/objects/tools/Axe.py: Add an error message
noting that this method should not be called.
* 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_Quaternion.cpp: Rename valid() method to is_valid()
for API consistency.
* rulesets/mason/world/tasks/Logging.py,
rulesets/mason/world/tasks/Raise.py: Update scripts to the changes
API.
* rulesets/Python_API.cpp: Improve the quaternion constructor
so it can build one from an axis and an angle of rotation.
* rulesets/Py_Quaternion.cpp: Add support for multiplying quaternions
together.
* data/mason.xml: Add rules for a pole tool, together with
operations and tasks associated with the pole.
* rulesets/mason/world/tasks/Raise.py: Add a task used with the
pole to lever items into different orientations. When used on an
entity, the entity is oriented away from the users current
position, rotating around a horizontal axis.
* rulesets/Py_Vector3D.cpp: Fix incorrect METH_VARARGS function type
of the three rotateN methods, as it should have been converted to
METH_O. Add a new rotate method used to rotate a vector using a
quaternion.
* rulesets/Py_Quaternion.cpp: Add a method to check the validity of
the quaternion, and a type method to create a string representation
of the quaternion.
* rulesets/Character.cpp: Remove commented out legacy hard coded
combat task setup. Now all tasks are scripts.
* rulesets/mason/world/tasks/Logging.py: Break logging down into
something that happens over many ticks, using the orientation of
the tree to determine if its felled yet.
* rulesets/Py_BBox.cpp, rulesets/Py_Optime.cpp,
rulesets/Py_Statistics.cpp, rulesets/Py_Thing.cpp: Ensure that
setattr returns an exception if the attribute is not a valid one.
* rulesets/Py_Map.cpp, rulesets/Py_Point3D.cpp,
rulesets/Py_Quaternion.cpp, rulesets/Py_World.cpp,
rulesets/Py_WorldTime.cpp: Remove setattr, as no attributes can
be set on this type.
* rulesets/Py_Mind.cpp, rulesets/Py_Oplist.cpp,
rulesets/Py_Vector3D.cpp: Clean up type structure.
* rulesets/basic/mind/goals/common/move.py: Remove attempt
to set "rotation" attribute on location, as its obsolete
and pointless.
* rulesets/Py_Location.cpp, rulesets/Py_Map.cpp, rulesets/Py_Mind.cpp,
rulesets/Py_Object.cpp, rulesets/Py_Operation.cpp,
rulesets/Py_Quaternion.cpp, rulesets/Py_Thing.cpp,
rulesets/Py_Vector3D.cpp, rulesets/Python_API.cpp:
Change some methods to use METH_NOARGS for simplicity.
* client/Py_CreatorClient.cpp, client/Py_CreatorClient.h,
rulesets/Py_BBox.cpp, rulesets/Py_BBox.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_Quaternion.cpp, rulesets/Py_Quaternion.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/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
rulesets/Python_API.cpp:
Clean up python API code, with decent names for types,
decent error reporting, and making the more paranoid checks
only present in debug build.
* common/BaseEntity.cpp, common/BaseEntity.h, server/Account.cpp:
Remove pointless method setRefnoOp, and put it in the body as
an inline method.
* common/BaseEntity.h, common/BaseWorld.cpp, common/Setup.h,
common/Tick.h, common/operations.h, common/custom.cpp,
common/types.h, common/utility.cpp, common/utility.h,
modules/Location.h, physics/Vector3D.h, rulesets/BaseMind.cpp,
rulesets/Script.h, server/EntityFactory.h:
Clean up the dependency trees using more forward declarations.
* common/inheritance.cpp, common/inheritance.h:
Move most of the implementation into the .cpp file as its
not suited to inlining.
* rulesets/MemMap.cpp, rulesets/MemMap.h, rulesets/MemMap_methods.h:
Move contents of MemMap_methods.h into the .cpp file, as it is
not suited to inlining, and remove the file from the build.
* rulesets/Py_Vector3D.cpp, rulesets/Py_Quaternion.cpp,
rulesets/Py_BBox.cpp: Add in-place construction and
destruction for all three python types which embed C++ objects.
* rulesets/Py_BBox.cpp, rulesets/Py_Quaternion.cpp,
rulesets/Python_API.cpp, server/Restorer_impl.h:
Add some casts and tweaks so that wrappers and
database code work with wfmath structures.
* client/CreatorClient.cpp: Fix operation semantics for admin
puppetting to new convention.
* common/Database.cpp: Add optional support for database password.
* physics/Quaternion.h: Add extra way of setting up a Quaternion.
* rulesets/MindFactory.cpp, server/Connection.cpp:
Move some output into debugging.
* rulesets/Python_API.cpp, rulesets/Py_Quaternion.h,
rulesets/Py_Quaternion.h: Add support for quaternions into the
scripting API.
* rulesets/mason/define_world.py: Switch to using quaternions to
send orientation data to the server.