Commit graph

117 commits

Author SHA1 Message Date
Olek Wojnar
7f9ff2246d Remove CVS $Id tags
The legacy tags are causing build issues in Debian.
2013-07-15 20:31:59 +02:00
Erik Ogenvik
7adcb1d6c6 Expose whether a thing is currently visible.
This is useful in AI scripts when looking for things.
2013-06-15 23:46:59 +02:00
Alistair Riddoch
87a8f7338a Correct the error type in two cases 2012-01-04 16:52:40 +00:00
Alistair Riddoch
58c0aa0392 Remove empty method table 2011-12-27 15:02:28 +01:00
Alistair Riddoch
3775db4db1 Remove as_entity from the overloaded method table 2011-12-27 14:58:44 +01:00
Alistair Riddoch
efa6b00a88 Remove dict for custom attributes 2011-12-27 10:28:14 +01:00
Alistair Riddoch
940daf5f68 Remove methods that are inherited 2011-12-26 00:17:50 +00:00
Alistair Riddoch
5fc5aa308c Add support for mind in the new generic wrappers 2011-12-15 13:19:41 +00:00
Alistair Riddoch
8f7c07a49d Use wrapPyton template for tasks. 2011-12-14 17:42:56 +00:00
Alistair Riddoch
efbfaeef4f Convert wrapping function into a template
This enables other code to be written more generically
2011-12-14 16:37:26 +00:00
Alistair Riddoch
d4f66bbbf8 Separate wrapping new class into its own function 2011-12-14 00:41:02 +00:00
Alistair Riddoch
a8dfc319df Implement better type checks in Python wrappers
These now take into account inheritance, allowing simpler code
and better type safety.
2011-12-13 19:39:09 +00:00
Alistair Riddoch
7002533e40 Don't allow PyThing to promote an Entity to Character 2011-12-13 19:19:09 +00:00
Alistair Riddoch
f9dd66103d Make the thing types properly inherit from each other 2011-12-13 18:53:35 +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
da5cdefef7 Remove Character.clearTask wrapper
Nothing was using it, and functionality shouldn't be hard coded into
the Character class like this.
2011-11-17 16:46:17 +00:00
Alistair Riddoch
5d3d265f08 Merge PyMind code into PyThing, as it is so close 2011-11-07 19:16:50 +00:00
Alistair Riddoch
102d59ff53 Stop using noScript object for scriptless objects 2011-10-13 14:20:46 +01:00
Alistair Riddoch
a1d9c17f8a Support weak references 2011-10-12 15:29:52 +01:00
Alistair Riddoch
275506b668 Make clearTask wrapper safe
There is an assert in Character::clearTask to ensure that it is only
ever called when there is no task at shutdown. In order to ensure this is
safe in the Python API it is necessary to ensure it is never called
when there is no task, so this change adds a check to the wrapper.
2011-10-04 11:41:04 +01:00
Alistair Riddoch
527ba804f6 Fix a logic change that caused Python failures 2011-09-29 20:58:57 +01:00
Alistair Riddoch
0c4fd86b37 When setAttr is called form a script, mark the property as unsent 2011-02-27 23:56:29 +00:00
Alistair Riddoch
5e029672e2 Remove notice of changing an attribute using map data 2011-02-23 13:48:48 +00:00
Alistair Riddoch
65f63510c6 Remove notice message on unexpected attribute set 2011-02-23 13:04:51 +00:00
Alistair Riddoch
6041576e06 Correct an error message to give the correct function name. 2009-11-12 23:35:21 +00:00
Alistair Riddoch
3121e043b3 Add support to allow type to be set on entities not yet in-game. 2009-11-12 22:14:31 +00:00
Alistair Riddoch
3b72367ddd Replace the binding for obsolete setTask with a new one for startTask. 2009-07-29 12:54:24 +01:00
Alexey Torkhov
97a7b07d24 Fixing assert messages in Entity bindings. 2009-07-14 19:33:03 +04:00
Alistair Riddoch
9f4a1205f3 Clean up stray lines in new object creation functions. 2009-07-04 19:05:32 +01:00
Alistair Riddoch
4f734d050d Remove commented out obsolete implementations of new object creation. 2009-07-04 19:03:29 +01:00
Alistair Riddoch
d9459d07d6 Ensure null pointers cannot be dereferenced. 2009-07-04 14:16:13 +01:00
Alistair Riddoch
7cd79d77f7 Convert Entity wrappers to being base classes for scripts. 2009-07-01 01:59:54 +01:00
Alistair Riddoch
7cbd4082d9 Make it possible to inherit from Mind and Entity wrappers. 2009-07-01 00:50:38 +01:00
Alistair Riddoch
97816edc45 Convert Entity wrappers to use get/setattro. 2009-07-01 00:00:36 +01:00
Alistair Riddoch
534c69b54c Convert all the code relating to bindings for IG Entity to use the union
based binding for simplicity.
2009-06-12 20:19:52 +01:00
Alistair Riddoch
c73c489e58 Re-write PyEntity as a union of the possible pointer types. 2009-06-12 11:36:07 +01:00
Alistair Riddoch
bdb4c71dd3 Correct the names and doc strings of the available server Entity wrappers. 2009-06-08 01:42:25 +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
dc02e8d432 Convert tp_dealloc methods to call tp_free as they should in modern types. 2009-06-03 18:23:06 +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
2b01552036 Get rid of ugly return by value for PyObject_asMessageElement 2009-05-27 03:13:15 +01:00
Alistair Riddoch
e3f7f91a49 Re-work the way ineherited Entity wrappers work to be cleaner 2009-05-25 04:06:31 +01:00
Alistair Riddoch
891fd68c77 Add check if type is set before dereferencing 2009-05-25 03:34:47 +01:00
Alistair Riddoch
71bc877bf6 Implement init, add methods handling and get Entity wrapper working 2009-05-25 03:14:01 +01:00
Alistair Riddoch
4960ac4bd4 Fix up all the remaining wrappers to be modern bindings 2009-05-24 16:20:17 +01: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
24aa46bc4d 2008-01-05 Al Riddoch <alriddoch@googlemail.com>
* rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h:
	  Don't allocated storage for m_contains by default, only
	  on demand. Add a convenience method which checks, and
	  allocates the storage if required. Set up the ID property
	  on this base class rather then Entity.

	* rulesets/Py_Thing.cpp: Remove special handling of ID attribute
	  as it is now handled by the property.

	* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/MemMap.cpp,
	  rulesets/Motion.cpp, rulesets/Py_Mind.cpp, rulesets/Py_Thing.cpp,
	  rulesets/Thing.cpp, rulesets/World.cpp, server/WorldRouter.cpp:
	  Make sure all parts of the code where contains is used have
	  the right checks, as it could be null.
2008-01-05 14:05:05 +00:00
Al Riddoch
f82e27e107 2008-01-05 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Py_Thing.cpp: Remove the world attribute on Entity
	  wrapper.
2008-01-05 00:52:20 +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