Commit graph

213 commits

Author SHA1 Message Date
Alistair Riddoch
977a8641f5 Clear up a couple of locations where new Python objects are not checked. 2009-08-05 02:07:54 +01:00
Alistair Riddoch
3951238240 Move the code for importing a Python module into its own function. 2009-07-02 18:06:40 +01:00
Alistair Riddoch
2891907bb0 Isolate Get_PyClass functionality to make it more useful, and expose it. 2009-07-02 17:23:02 +01:00
Alistair Riddoch
ebd0860d86 Remove the separate pointer for obsolete non-wrapping scripts and change
where references are decremented.
2009-07-01 20:26:17 +01:00
Alistair Riddoch
a71159873a No longer store a separate wrapper script object for scripted entities. 2009-07-01 20:14:45 +01:00
Alistair Riddoch
dbdec38dfa Move a Py_DECREF call into a more balanced place. 2009-06-30 20:33:48 +01:00
Alistair Riddoch
0d9c50d4c5 Remove the class case conversion as it is not required. 2009-06-30 17:53:00 +01:00
Alistair Riddoch
e43ee88926 Make all Python entity and task objects inherit from object, and add checks. 2009-06-30 15:32:21 +01:00
Alistair Riddoch
1c260a8201 Remove unnecessary tp_new implementations from all bindings that don't need them 2009-06-04 15:29:34 +01:00
Alistair Riddoch
32a7e4758f Remove unnecessary tp_new implementation for Py_World. 2009-06-04 14:53:51 +01:00
Alistair Riddoch
eedd543a1d Update I think the last types to new style bindings. 2009-06-04 12:47:53 +01:00
Alistair Riddoch
ce6ae9007a Clean up more module setup to use modern functions. 2009-06-04 02:27:08 +01:00
Alistair Riddoch
35058b523d Set up const Operation type. Use cleaner module setup functions. 2009-06-04 02:05:02 +01:00
Alistair Riddoch
fc795faf21 Remove unnecesary tp_getattr and tp_dealloc methods from stdout/stderr handlers. 2009-06-03 18:12:56 +01:00
Alistair Riddoch
4bf6963697 Rename excessively verbose PyMessageElement to PyMessage. 2009-05-27 18:22:56 +01:00
Alistair Riddoch
f1a5a44bb2 Update all includes for rename of Py_Object.h to Py_Message.h 2009-05-27 14:10:26 +01:00
Alistair Riddoch
a2b84f5c6b Add World to module so it can be instantiated directly 2009-05-27 04:06:27 +01:00
Alistair Riddoch
f9107f6c43 Make PyMap, PyTask and PyMind all directly instantiable 2009-05-25 16:34:37 +01:00
Alistair Riddoch
dca1d43dd4 Make Entity wrappers directly instantiable 2009-05-25 04:09:54 +01:00
Alistair Riddoch
50b2957492 Make Entity wrapper object directly instancable 2009-05-25 03:14:44 +01:00
Alistair Riddoch
db50776749 Call PyType_Ready on all the remaining types 2009-05-25 00:50:36 +01:00
Alistair Riddoch
af44dd33e1 Remove obsolete Entity init code 2009-05-24 00:03:51 +01:00
Alistair Riddoch
4a66504945 Convert Atlas RootEntity wrapper to modern Python binding. 2009-05-23 13:21:50 +01:00
Alistair Riddoch
f1a386e7d3 Conver the wrapper for Atlas::Message::Element into a modern Python binding. 2009-05-22 01:21:33 +01:00
Alistair Riddoch
efd916dc2d Convert Location wrapper to a modern Python binding 2009-05-22 00:37:55 +01:00
Alistair Riddoch
03ba73a004 Convert Operation wrapper to be a modern Python binding 2009-05-21 18:49:10 +01:00
Alistair Riddoch
065c4cd316 Remove unused oplist construction code 2009-05-21 16:49:56 +01:00
Alistair Riddoch
3b1708c629 Rename atlas.Message to atlas.Oplist in the Python API 2009-05-21 16:34:01 +01:00
Alistair Riddoch
ec67b5e44d Convert the Oplist wrapper to be a modern Pything binding 2009-05-21 04:40:45 +01:00
Alistair Riddoch
ed178ca0b1 Convert the Python Quaternion wrapper to being a modern Python binding 2009-05-20 20:48:54 +01:00
Alistair Riddoch
9bf7fc3eb7 Convert the Python BBox wrapper to being a modern Python binding 2009-05-20 20:01:59 +01:00
Alistair Riddoch
8ff8870a30 Move the vector and point types to the physics internal Python module 2009-05-20 19:33:39 +01:00
Alistair Riddoch
2527348089 Fix a crash which occurs when a BBox is created with no args. 2009-05-18 00:34:27 +01:00
Alistair Riddoch
1286df81a7 Rename PythonThingScript to PythonEntityScript 2009-03-22 15:58:06 +00:00
Alistair Riddoch
cd1f42c3f9 Rename Inheritance class files to match class name. 2009-03-20 15:31:38 +00:00
Al Riddoch
39b1e3b547 2009-01-31 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Python_API.cpp, rulesets/Python_API.h: Remove the
	  now obsolete unused function for running trivial Python
	  command line.
2009-01-31 04:11:21 +00:00
Al Riddoch
0bbbfe7dae 2009-01-30 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Python_API.cpp, rulesets/Python_API.h: Hack in a quick
	  function for executing python commands.

	* server/CommPythonClient.cpp: Pass input from the client straight
	  into the python interpretter and see what happens.
2009-01-30 01:39: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
5f663cd03f 2008-01-05 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Py_World.h: Remove the pointer to the world router from
	  its wrapper, as all the wrapper code should now use the singleton
	  interface.

	* rulesets/Python_API.cpp, rulesets/Py_World.cpp,
	  rulesets/Py_Thing.cpp: Fix up all the code which uses the world
	  router pointer.
2008-01-05 00:05:29 +00:00
Al Riddoch
d85a0f2a9c 2008-01-04 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Python_API.cpp: Add an instance of the world wrapper to
	  the server module, which should then be used instead of the
	  world attribute on entities.
2008-01-04 23:57:30 +00:00
Al Riddoch
8e9bd398af 2008-01-04 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Python_API.cpp: Remove the server_python flag used to
	  allow scripts to run unmodified on the obsolete python prototype.

	* rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/mind/goals/animal/herd.py,
	  rulesets/basic/mind/goals/common/common.py,
	  rulesets/basic/mind/goals/common/move.py,
	  rulesets/mason/world/objects/buildings/House.py: Remove support
	  for running these scripts on the obsolete python prototype.
2008-01-04 00:45:39 +00:00
Al Riddoch
9f4078b178 2007-12-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Remove commented out call to
	  Subscribe_Script().
2007-12-04 00:07:34 +00:00
Al Riddoch
94e6a0505a 2007-12-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/BaseMind.cpp, rulesets/BaseMind.h, rulesets/Entity.cpp
	  rulesets/Entity.h: Remove the scriptSubscribed methods which
	  were empty and unused.

	* rulesets/Python_API.cpp, rulesets/Python_Script_Utils.h: Remove
	  Subscribe_Script() as it is useless now.

	* server/ScriptFactory.cpp: Remove call to Subscribe_Script().
2007-12-04 00:03:59 +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
da3d23f111 2007-11-24 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp, rulesets/Makefile.am: Remove now oboleted
	  PythonMindScript from the code, and the build.
2007-11-24 16:54:09 +00:00
Al Riddoch
87ecdcad4b 2007-07-30 Al Riddoch <alriddoch@zepler.org>
* client/Py_CreatorClient.cpp, common/Database.cpp,
	  common/accountbase.cpp, common/system.cpp, rulesets/Character.cpp,
	  rulesets/Motion.cpp, rulesets/Plant.cpp, rulesets/Py_Location.cpp,
	  rulesets/Py_Mind.cpp, rulesets/Py_Operation.cpp,
	  rulesets/Py_Point3D.cpp, rulesets/Py_Statistics.cpp,
	  rulesets/Py_Task.cpp, rulesets/Py_TerrainProperty.cpp,
	  rulesets/Py_Thing.cpp, rulesets/Py_Vector3D.cpp,
	  rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp,
	  rulesets/TerrainProperty.cpp, server/Admin.cpp,
	  server/CommServer.cpp, server/Connection.cpp,
	  server/EntityFactory.cpp, server/WorldRouter.cpp,
	  tools/cycmd.cpp, tools/cyconvertrules.cpp, tools/cyctrl.cpp:
	  Remove unnecessary () from conditional expressions, where operator
	  binding is clear.
2007-07-30 18:12:50 +00:00
Al Riddoch
7570359f75 2007-07-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/MemMap.cpp, rulesets/Motion.cpp,
	  rulesets/Python_API.cpp, rulesets/TerrainProperty.cpp,
	  rulesets/Thing.cpp, rulesets/World.cpp: Don't use camel casing for
	  local variables or function arguments.
2007-07-29 21:23:40 +00:00
Al Riddoch
2069f3dd4c 2007-07-29 Al Riddoch <alriddoch@zepler.org>
* common/log.cpp, common/log.h: Switch to taking a C++ string reference
	  rather than a char *, as it is not really an optimisation, and it
	  makes the code simpler to read and write.

	* client/BaseClient.cpp, client/ClientConnection.cpp,
	  common/AtlasFileLoader.cpp, common/BaseEntity.cpp,
	  common/Database.cpp, common/globals.cpp, common/id.cpp,
	  common/inheritance.cpp, common/log.cpp, common/log.h,
	  rulesets/Character.cpp, rulesets/Creator.cpp, rulesets/Entity.cpp,
	  rulesets/MemMap.cpp, rulesets/Motion.cpp, rulesets/Pedestrian.cpp,
	  rulesets/Py_Object.cpp, rulesets/Py_RootEntity.cpp,
	  rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
	  rulesets/Python_API.cpp, rulesets/Thing.cpp, server/Account.cpp,
	  server/Admin.cpp, server/ArithmeticFactory.cpp,
	  server/CommClient.cpp, server/CommListener.cpp,
	  server/CommMDNSPublisher.cpp, server/CommServer.cpp,
	  server/Connection.cpp, server/EntityFactory.cpp,
	  server/Persistance.cpp, server/Restoration.cpp,
	  server/ScriptFactory.cpp, server/TaskFactory.cpp,
	  server/WorldRouter.cpp, server/server.cpp: Convert over to using
	  new API correctly.

	* data/mason.xml: Add biomass and transient to fircone, making its
	  script obsolete:
2007-07-29 03:33:33 +00:00
Al Riddoch
73330b762f 2007-07-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Property.h, rulesets/Py_Property.cpp,
	  rulesets/Py_TerrainProperty.cpp, rulesets/Makefile.am,
	  rulesets/Python_API.cpp: Complete implementation of terrain
	  property wrapper.

	* rulesets/mason/world/tasks/Reap.py: Check the surface to make sure
	  it is grass. Remove deubg output.
2007-07-04 16:42:10 +00:00
Al Riddoch
f8a2731576 2007-06-19 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp, common/globals.h: Change the type and name
	  of the ruleset list to a string.

	* rulesets/Python_API.cpp, server/EntityFactory.cpp,
	  server/server.cpp, tools/cyaddrules.cpp, tools/cydumprules.cpp,
	  tools/cyloadrules.cpp: Switch to using single ruleset config
	  variable.
2007-06-19 13:19:57 +00:00