2010-05-11 15:34:59 -06:00
|
|
|
from ctypes import *
|
2010-08-19 11:48:24 -06:00
|
|
|
from dftypes import *
|
2010-05-11 15:34:59 -06:00
|
|
|
|
|
|
|
class Constructions(object):
|
|
|
|
def __init__(self, ptr):
|
|
|
|
self._c_ptr = ptr
|
|
|
|
|
|
|
|
def start(self):
|
|
|
|
num = c_uint()
|
|
|
|
|
|
|
|
if libdfhack.Constructions_Start(self._c_ptr, byref(num)) > 0:
|
|
|
|
return int(num.value)
|
|
|
|
else:
|
|
|
|
return -1
|
|
|
|
|
|
|
|
def finish(self):
|
|
|
|
return libdfhack.Constructions_Finish(self._c_ptr) > 0
|
|
|
|
|
|
|
|
def read(self, index):
|
|
|
|
c = Construction()
|
|
|
|
|
|
|
|
if libdfhack.Constructions_Read(self._c_ptr, c_uint(index), byref(c)) > 0:
|
|
|
|
return c
|
|
|
|
else:
|
|
|
|
return None
|