2000-11-27 18:28:20 +00:00
|
|
|
#This file is distributed under the terms of the GNU General Public license.
|
2005-12-05 21:40:45 +00:00
|
|
|
#Copyright (C) 1999-2005 Al Riddoch (See the file COPYING for details).
|
2000-11-30 12:51:59 +00:00
|
|
|
|
2009-06-30 15:32:21 +01:00
|
|
|
class Thing(object):
|
2005-12-05 21:40:45 +00:00
|
|
|
"""This is the interface class for all entity and mind scripts. It
|
|
|
|
|
provides the interface to the object in the server core."""
|
2005-12-01 02:17:06 +00:00
|
|
|
def __init__(self, cppthing):
|
2000-12-11 13:06:12 +00:00
|
|
|
#print "Thing.__init__"
|
2005-11-30 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/world/objects/Thing.py: Remove self.attributes
from the base class for all python scripts.
* rulesets/mason/world/objects/Weather.py,
rulesets/basic/world/objects/plants/Tree.py,
rulesets/basic/world/objects/animals/Animal.py,
data/basic.xml, data/mason.xml: Don't use set_kw to handle default
attributes, and add the to the .xml rules files.
* rulesets/basic/world/objects/buildings/House.py,
rulesets/basic/world/objects/buildings/StoneHouse.py,
rulesets/basic/world/objects/tools/Bow.py,
rulesets/basic/world/objects/tools/Sword.py,
rulesets/mason/world/objects/animals/Deer.py,
rulesets/mason/world/objects/animals/Pig.py,
rulesets/mason/world/objects/outdoor/Campfire.py,
rulesets/mason/world/objects/outdoor/Gravestone.py,
rulesets/mason/world/objects/plants/seeds/Acorn.py,
rulesets/mason/world/objects/plants/seeds/Apple.py,
rulesets/mason/world/objects/plants/seeds/Fircone.py,
rulesets/mason/world/objects/plants/seeds/Seed.py,
rulesets/mason/world/objects/tools/Cleaver.py,
rulesets/mason/world/objects/undead/Skeleton.py,
rulesets/werewolf/world/objects/characters/Villager.py,
rulesets/werewolf/world/objects/tools/Gallows.py:
Don't import set_kw from misc, as its now obsolete and unused.
2005-11-30 22:37:50 +00:00
|
|
|
self.cinit(cppthing)
|
2000-11-27 18:28:20 +00:00
|
|
|
def cinit(self, cppthing):
|
|
|
|
|
self.__dict__['cppthing'] = cppthing
|
|
|
|
|
def __getattr__(self, name):
|
2000-12-03 16:56:10 +00:00
|
|
|
value = getattr(self.cppthing, name)
|
2000-12-11 13:06:12 +00:00
|
|
|
#print "__getattr__",name,value
|
2000-12-03 16:56:10 +00:00
|
|
|
return value
|
2000-11-27 18:28:20 +00:00
|
|
|
def __setattr__(self, name, value):
|
2000-12-11 13:06:12 +00:00
|
|
|
#print "__setattr__",name,value
|
2000-11-27 18:28:20 +00:00
|
|
|
return setattr(self.cppthing, name, value)
|