Materials exported funcs

develop
RusAnon 2010-05-03 18:21:55 +11:00
parent d507974e8e
commit 9f5220235a
1 changed files with 32 additions and 15 deletions

@ -3,23 +3,40 @@
Python class for DF_Hack::Materials Python class for DF_Hack::Materials
""" """
from ._pydfhack import _MaterialsManager from ._pydfhack import _MaterialsManager
class Materials(_MaterialsManager): from .mixins import NoStart
from .decorators import suspend
class Materials(NoStart, _MaterialsManager):
api = None api = None
started = False cls = _MaterialsManager
def __init__(self, api, *args, **kwds): def __init__(self, api, *args, **kwds):
_MaterialsManager.__init__(self, args, kwds) cls.__init__(self, args, kwds)
self.api = api self.api = api
def prepare(self): @suspend
""" def Read_Wood_Materials(self, *args, **kw):
Enforce Suspend/Start return self.cls.Read_Wood_Materials(self, *args, **kw)
"""
if self.api.prepare(): @suspend
if not self.started: def Read_Plant_Materials(self, *args, **kw):
self.started = self.Start() return self.cls.Read_Plant_Materials(self, *args, **kw)
return self.started
else: @suspend
return False def Read_Inorganic_Materials(self, *args, **kw):
return self.cls.Read_Inorganic_Materials(self, *args, **kw)
@suspend
def Read_Descriptor_Colors(self, *args, **kw):
return self.cls.Read_Descriptor_Colors(self, *args, **kw)
@suspend
def Read_Creature_Types(self, *args, **kw):
return self.cls.Read_Creature_Types(self, *args, **kw)
@suspend
def Read_Organic_Materials(self, *args, **kw):
return self.cls.Read_Organic_Materials(self, *args, **kw)
@suspend
def Read_Creature_Types_Ex(self, *args, **kw):
return self.cls.Read_Creature_Types_Ex(self, *args, **kw)