using ctypes Structure and Union class now

develop
doomchild 2010-04-03 20:57:30 -05:00
parent 49ecc368bf
commit c579d60c98
1 changed files with 196 additions and 396 deletions

@ -1,233 +1,212 @@
from pydfhack import * from pydfhack import *
from ctypes import *
class DFAPI(API): class DFAPI(API):
def Read_Designations(self, x, y, z): def Read_Designations(self, x, y, z):
d_list = [DesignationFlags(d) for d in API.Read_Designations(self, x, y, z)] temp = API.Read_Designations(self, x, y, z)
d_list = []
for i in temp:
d = []
for j in i:
d.append(DesignationFlags(j))
d_list.append(d)
return d_list return d_list
def Write_Designations(self, x, y, z, d_list):
temp = []
for i in d_list:
t = []
for j in i:
t.append(j.whole)
temp.append(t)
API.Write_Designations(self, x, y, z, temp)
def Read_Occupancy(self, x, y, z): def Read_Occupancy(self, x, y, z):
o_list = [OccupancyFlags(o) for o in API.Read_Occupancy(self, x, y, z)] temp = API.Read_Occupancy(self, x, y, z)
o_list = []
for i in temp:
o = []
for j in i:
o.append(OccupancyFlags(j))
o_list.append(o)
return o_list return o_list
class CreatureFlags1(_UnionBase): class DesignationStruct(Structure):
move_state = property(fget = lambda self: self._get_mask_bit(0), _fields_ = [("flow_size", c_uint, 3),
fset = lambda self, val: self._set_mask_bit(0, val)) ("pile", c_uint, 1),
dead = property(fget = lambda self: self._get_mask_bit(1), ("dig", c_uint, 3),
fset = lambda self, val: self._set_mask_bit(1, val)) ("smooth", c_uint, 2),
has_mood = property(fget = lambda self: self._get_mask_bit(2), ("hidden", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(2, val)) ("geolayer_index", c_uint, 4),
had_mood = property(fget = lambda self: self._get_mask_bit(3), ("light", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(3, val)) ("subterranean", c_uint, 1),
("skyview", c_uint, 1),
marauder = property(fget = lambda self: self._get_mask_bit(4), ("biome", c_uint, 4),
fset = lambda self, val: self._set_mask_bit(4, val)) ("liquid_type", c_uint, 1),
drowning = property(fget = lambda self: self._get_mask_bit(5), ("water_table", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(5, val)) ("rained", c_uint, 1),
merchant = property(fget = lambda self: self._get_mask_bit(6), ("traffic", c_uint, 2),
fset = lambda self, val: self._set_mask_bit(6, val)) ("flow_forbid", c_uint, 1),
forest = property(fget = lambda self: self._get_mask_bit(7), ("liquid_static", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(7, val)) ("moss", c_uint, 1),
("feature_present", c_uint, 1),
left = property(fget = lambda self: self._get_mask_bit(8), ("liquid_character", c_uint, 2)]
fset = lambda self, val: self._set_mask_bit(8, val))
rider = property(fget = lambda self: self._get_mask_bit(9), class DesignationFlags(Union):
fset = lambda self, val: self._set_mask_bit(9, val)) _fields_ = [("whole", c_uint, 32),
incoming = property(fget = lambda self: self._get_mask_bit(10), ("bits", DesignationStruct)]
fset = lambda self, val: self._set_mask_bit(10, val))
diplomat = property(fget = lambda self: self._get_mask_bit(11), def __init__(self, initial = 0):
fset = lambda self, val: self._set_mask_bit(11, val)) self.whole = initial
zombie = property(fget = lambda self: self._get_mask_bit(12), class OccupancyStruct(Strucure):
fset = lambda self: self._set_mask_bit(12, val)) _fields_ = [("building", c_uint, 3),
skeleton = property(fget = lambda self: self._get_mask_bit(13), ("unit", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(13, val)) ("unit_grounded", c_uint, 1),
can_swap = property(fget = lambda self: self._get_mask_bit(14), ("item", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(14, val)) ("splatter", c_uint, 26)]
on_ground = property(fget = lambda self: self._get_mask_bit(15),
fset = lambda self, val: self._set_mask_bit(15, val)) class OccupancyFlags(Union):
_fields_ = [("whole", c_uint, 32),
projectile = property(fget = lambda self: self._get_mask_bit(16), ("bits", OccupancyStruct)]
fset = lambda self, val: self._set_mask_bit(16, val))
active_invader = property(fget = lambda self: self._get_mask_bit(17), def __init__(self, initial = 0):
fset = lambda self, val: self._set_mask_bit(17, val)) self.whole = initial
hidden_in_ambush = property(fget = lambda self: self._get_mask_bit(18),
fset = lambda self, val: self._set_mask_bit(18, val)) class CreatureStruct1(Structure):
invader_origin = property(fget = lambda self: self._get_mask_bit(19), _fields_ = [("move_state", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(19, val)) ("dead", c_uint, 1),
("has_mood", c_uint, 1),
coward = property(fget = lambda self: self._get_mask_bit(20), ("had_mood", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(20, val)) ("marauder", c_uint, 1),
hidden_ambusher = property(fget = lambda self: self._get_mask_bit(21), ("drowning", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(21, val)) ("merchant", c_uint, 1),
invades = property(fget = lambda self: self._get_mask_bit(22), ("forest", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(22, val)) ("left", c_uint, 1),
check_flows = property(fget = lambda self: self._get_mask_bit(23), ("rider", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(23, val)) ("incoming", c_uint, 1),
("diplomat", c_uint, 1),
ridden = property(fget = lambda self: self._get_mask_bit(24), ("zombie", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(24, val)) ("skeleton", c_uint, 1),
caged = property(fget = lambda self: self._get_mask_bit(25), ("can_swap", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(25, val)) ("on_ground", c_uint, 1),
tame = property(fget = lambda self: self._get_mask_bit(26), ("projectile", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(26, val)) ("active_invader", c_uint, 1),
chained = property(fget = lambda self: self._get_mask_bit(27), ("hidden_in_ambush", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(27, val)) ("invader_origin", c_uint, 1),
("coward", c_uint, 1),
royal_guard = property(fget = lambda self: self._get_mask_bit(28), ("hidden_ambusher", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(28, val)) ("invades", c_uint, 1),
fortress_guard = property(fget = lambda self: self._get_mask_bit(29), ("check_flows", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(29, val)) ("ridden", c_uint, 1),
suppress_wield = property(fget = lambda self: self._get_mask_bit(30), ("caged", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(30, val)) ("tame", c_uint, 1),
important_historial_figure = property(fget = lambda self: self._get_mask_bit(31), ("chained", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(31, val)) ("royal_guard", c_uint, 1),
("fortress_guard", c_uint, 1),
class CreatureFlags2(_UnionBase): ("suppress_wield", c_uint, 1),
swimming = property(fget = lambda self: self._get_mask_bit(0), ("important_historical_figure", c_uint, 1)]
fset = lambda self, val: self._set_mask_bit(0, val))
sparring = property(fget = lambda self: self._get_mask_bit(1), class CreatureFlags1(Union):
fset = lambda self, val: self._set_mask_bit(1, val)) _fields_ = [("whole", c_uint, 32),
no_notify = property(fget = lambda self: self._get_mask_bit(2), ("bits", CreatureStruct1)]
fset = lambda self, val: self._set_mask_bit(2, val))
unused = property(fget = lambda self: self._get_mask_bit(3), def __init__(self, initial = 0):
fset = lambda self, val: self._set_mask_bit(3, val)) self.whole = initial
calculated_nerves = property(fget = lambda self: self._get_mask_bit(4), class CreatureStruct2(Structure):
fset = lambda self, val: self._set_mask_bit(4, val)) _fields_ = [("swimming", c_uint, 1),
calculated_bodyparts = property(fget = lambda self: self._get_mask_bit(5), ("sparring", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(5, val)) ("no_notify", c_uint, 1),
important_historical_figure = property(fget = lambda self: self._get_mask_bit(6), ("unused", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(6, val)) ("calculated_nerves", c_uint, 1),
killed = property(fget = lambda self: self._get_mask_bit(7), ("calculated_bodyparts", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(7, val)) ("important_historical_figure", c_uint, 1),
("killed", c_uint, 1),
cleanup_1 = property(fget = lambda self: self._get_mask_bit(8), ("cleanup_1", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(8, val)) ("cleanup_2", c_uint, 1),
cleanup_2 = property(fget = lambda self: self._get_mask_bit(9), ("cleanup_3", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(9, val)) ("for_trade", c_uint, 1),
cleanup_3 = property(fget = lambda self: self._get_mask_bit(10), ("trade_resolved", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(10, val)) ("has_breaks", c_uint, 1),
for_trade = property(fget = lambda self: self._get_mask_bit(11), ("gutted", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(11, val)) ("circulatory_spray", c_uint, 1),
("locked_in_for_trading", c_uint, 1),
trade_resolved = property(fget = lambda self: self._get_mask_bit(12), ("slaughter", c_uint, 1),
fset = lambda self: self._set_mask_bit(12, val)) ("underworld", c_uint, 1),
has_breaks = property(fget = lambda self: self._get_mask_bit(13), ("resident", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(13, val)) ("cleanup_4", c_uint, 1),
gutted = property(fget = lambda self: self._get_mask_bit(14), ("calculated_insulation", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(14, val)) ("visitor_uninvited", c_uint, 1),
circulatory_spray = property(fget = lambda self: self._get_mask_bit(15), ("visitor", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(15, val)) ("calculated_inventory", c_uint, 1),
("vision_good", c_uint, 1),
locked_in_for_trading = property(fget = lambda self: self._get_mask_bit(16), ("vision_damaged", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(16, val)) ("vision_missing", c_uint, 1),
slaughter = property(fget = lambda self: self._get_mask_bit(17), ("breathing_good", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(17, val)) ("breathing_problem", c_uint, 1),
underworld = property(fget = lambda self: self._get_mask_bit(18), ("roaming_wilderness_population_source", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(18, val)) ("roaming_wilderness_population_source_not_a_map_feature", c_uint, 1)]
resident = property(fget = lambda self: self._get_mask_bit(19),
fset = lambda self, val: self._set_mask_bit(19, val)) class CreatureFlags2(Union):
_fields_ = [("whole", c_uint, 32),
cleanup_4 = property(fget = lambda self: self._get_mask_bit(20), ("bits", CreatureStruct2)]
fset = lambda self, val: self._set_mask_bit(20, val))
calculated_insulation = property(fget = lambda self: self._get_mask_bit(21), def __init__(self, initial = 0):
fset = lambda self, val: self._set_mask_bit(21, val)) self.whole = initial
visitor_uninvited = property(fget = lambda self: self._get_mask_bit(22),
fset = lambda self, val: self._set_mask_bit(22, val)) class ItemStruct(Structure):
visitor = property(fget = lambda self: self._get_mask_bit(23), _fields_ = [("on_ground", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(23, val)) ("in_job", c_uint, 1),
("in_inventory", c_uint, 1),
calculated_inventory = property(fget = lambda self: self._get_mask_bit(24), ("u_ngrd1", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(24, val)) ("in_workshop", c_uint, 1),
vision_good = property(fget = lambda self: self._get_mask_bit(25), ("u_ngrd2", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(25, val)) ("u_ngrd3", c_uint, 1),
vision_damaged = property(fget = lambda self: self._get_mask_bit(26), ("rotten", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(26, val)) ("unk1", c_uint, 1),
vision_missing = property(fget = lambda self: self._get_mask_bit(27), ("u_ngrd4", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(27, val)) ("unk2", c_uint, 1),
("u_ngrd5", c_uint, 1),
breathing_good = property(fget = lambda self: self._get_mask_bit(28), ("unk3", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(28, val)) ("u_ngrd6", c_uint, 1),
breathing_problem = property(fget = lambda self: self._get_mask_bit(29), ("narrow", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(29, val)) ("u_ngrd7", c_uint, 1),
roaming_wilderness_population_source = property(fget = lambda self: self._get_mask_bit(30), ("worn", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(30, val)) ("unk4", c_uint, 1),
roaming_wilderness_population_source_not_a_map_feature = property(fget = lambda self: self._get_mask_bit(31), ("u_ngrd8", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(31, val)) ("forbid", c_uint, 1),
("unk5", c_uint, 1),
class ItemFlags(_UnionBase): ("dump", c_uint, 1),
on_ground = property(fget = lambda self: self._get_mask_bit(0), ("on_fire", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(0, val)) ("melt", c_uint, 1),
in_job = property(fget = lambda self: self._get_mask_bit(1), ("hidden", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(1, val)) ("u_ngrd9", c_uint, 1),
in_inventory = property(fget = lambda self: self._get_mask_bit(2), ("unk6", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(2, val)) ("unk7", c_uint, 1),
u_ngrd1 = property(fget = lambda self: self._get_mask_bit(3), ("unk8", c_uint, 1),
fset = lambda self, val: self._set_mask_bit(3, val)) ("unk9", c_uint, 1),
("unk10", c_uint, 1),
in_workshop = property(fget = lambda self: self._get_mask_bit(4), ("unk11", c_uint, 1)]
fset = lambda self, val: self._set_mask_bit(4, val))
u_ngrd2 = property(fget = lambda self: self._get_mask_bit(5), class ItemFlags(Union):
fset = lambda self, val: self._set_mask_bit(5, val)) _fields_ = [("whole", c_uint, 32),
u_ngrd3 = property(fget = lambda self: self._get_mask_bit(6), ("bits", ItemStruct)]
fset = lambda self, val: self._set_mask_bit(6, val))
rotten = property(fget = lambda self: self._get_mask_bit(7), def __init__(self, initial = 0):
fset = lambda self, val: self._set_mask_bit(7, val)) self.whole = initial
unk1 = property(fget = lambda self: self._get_mask_bit(8),
fset = lambda self, val: self._set_mask_bit(8, val))
u_ngrd4 = property(fget = lambda self: self._get_mask_bit(9),
fset = lambda self, val: self._set_mask_bit(9, val))
unk2 = property(fget = lambda self: self._get_mask_bit(10),
fset = lambda self, val: self._set_mask_bit(10, val))
u_ngrd5 = property(fget = lambda self: self._get_mask_bit(11),
fset = lambda self, val: self._set_mask_bit(11, val))
unk3 = property(fget = lambda self: self._get_mask_bit(12),
fset = lambda self: self._set_mask_bit(12, val))
u_ngrd6 = property(fget = lambda self: self._get_mask_bit(13),
fset = lambda self, val: self._set_mask_bit(13, val))
narrow = property(fget = lambda self: self._get_mask_bit(14),
fset = lambda self, val: self._set_mask_bit(14, val))
u_ngrd7 = property(fget = lambda self: self._get_mask_bit(15),
fset = lambda self, val: self._set_mask_bit(15, val))
worn = property(fget = lambda self: self._get_mask_bit(16),
fset = lambda self, val: self._set_mask_bit(16, val))
unk4 = property(fget = lambda self: self._get_mask_bit(17),
fset = lambda self, val: self._set_mask_bit(17, val))
u_ngrd8 = property(fget = lambda self: self._get_mask_bit(18),
fset = lambda self, val: self._set_mask_bit(18, val))
forbid = property(fget = lambda self: self._get_mask_bit(19),
fset = lambda self, val: self._set_mask_bit(19, val))
unk5 = property(fget = lambda self: self._get_mask_bit(20),
fset = lambda self, val: self._set_mask_bit(20, val))
dump = property(fget = lambda self: self._get_mask_bit(21),
fset = lambda self, val: self._set_mask_bit(21, val))
on_fire = property(fget = lambda self: self._get_mask_bit(22),
fset = lambda self, val: self._set_mask_bit(22, val))
melt = property(fget = lambda self: self._get_mask_bit(23),
fset = lambda self, val: self._set_mask_bit(23, val))
hidden = property(fget = lambda self: self._get_mask_bit(24),
fset = lambda self, val: self._set_mask_bit(24, val))
u_ngrd9 = property(fget = lambda self: self._get_mask_bit(25),
fset = lambda self, val: self._set_mask_bit(25, val))
unk6 = property(fget = lambda self: self._get_mask_bit(26),
fset = lambda self, val: self._set_mask_bit(26, val))
unk7 = property(fget = lambda self: self._get_mask_bit(27),
fset = lambda self, val: self._set_mask_bit(27, val))
unk8 = property(fget = lambda self: self._get_mask_bit(28),
fset = lambda self, val: self._set_mask_bit(28, val))
unk9 = property(fget = lambda self: self._get_mask_bit(29),
fset = lambda self, val: self._set_mask_bit(29, val))
unk10 = property(fget = lambda self: self._get_mask_bit(30),
fset = lambda self, val: self._set_mask_bit(30, val))
unk11 = property(fget = lambda self: self._get_mask_bit(31),
fset = lambda self, val: self._set_mask_bit(31, val))
dig_types = { "no" : 0, dig_types = { "no" : 0,
"default" : 1, "default" : 1,
@ -242,182 +221,3 @@ traffic_types = { "normal" : 0,
"low" : 1, "low" : 1,
"high" : 2, "high" : 2,
"restricted" : 3 } "restricted" : 3 }
class DesignationFlags(_UnionBase):
def dig(self, dig_type):
if dig_type == "no":
self.dig_1 = False; self.dig_2 = False; self.dig_3 = False
elif dig_type == "default":
self.dig_1 = True; self.dig_2 = False; self.dig_3 = False
elif dig_type == "ud_stair":
self.dig_1 = False; self.dig_2 = True; self.dig_3 = False
elif dig_type == "channel":
self.dig_1 = True; self.dig_2 = True; self.dig_3 = False
elif dig_type == "ramp":
self.dig_1 = False; self.dig_2 = False; self.dig_3 = True
elif dig_type == "d_stair":
self.dig_1 = True; self.dig_2 = False; self.dig_3 = True
elif dig_type == "u_stair":
self.dig_1 = False; self.dig_2 = True; self.dig_3 = True
elif dig_type == "whatever":
self.dig_1 = True; self.dig_2 = True; self.dig_3 = True
def set_traffic(self, traffic_type):
if traffic_type == "normal":
self.traffic_1 = False; self.traffic_2 = False
elif traffic_type == "low":
self.traffic_1 = True; self.traffic_2 = False
elif traffic_type == "high":
self.traffic_1 = False; self.traffic_2 = True
elif traffic_type == "restricted":
self.traffic_1 = True; self.traffic_2 = True
flow_size_1 = property(fget = lambda self: self._get_mask_bit(0),
fset = lambda self, val: self._set_mask_bit(0, val))
flow_size_2 = property(fget = lambda self: self._get_mask_bit(1),
fset = lambda self, val: self._set_mask_bit(1, val))
flow_size_3 = property(fget = lambda self: self._get_mask_bit(2),
fset = lambda self, val: self._set_mask_bit(2, val))
pile = property(fget = lambda self: self._get_mask_bit(3),
fset = lambda self, val: self._set_mask_bit(3, val))
dig_1 = property(fget = lambda self: self._get_mask_bit(4),
fset = lambda self, val: self._set_mask_bit(4, val))
dig_2 = property(fget = lambda self: self._get_mask_bit(5),
fset = lambda self, val: self._set_mask_bit(5, val))
dig_3 = property(fget = lambda self: self._get_mask_bit(6),
fset = lambda self, val: self._set_mask_bit(6, val))
smooth_1 = property(fget = lambda self: self._get_mask_bit(7),
fset = lambda self, val: self._set_mask_bit(7, val))
smooth_2 = property(fget = lambda self: self._get_mask_bit(8),
fset = lambda self, val: self._set_mask_bit(8, val))
hidden = property(fget = lambda self: self._get_mask_bit(9),
fset = lambda self, val: self._set_mask_bit(9, val))
geolayer_index_1 = property(fget = lambda self: self._get_mask_bit(10),
fset = lambda self, val: self._set_mask_bit(10, val))
geolayer_index_2 = property(fget = lambda self: self._get_mask_bit(11),
fset = lambda self, val: self._set_mask_bit(11, val))
geolayer_index_3 = property(fget = lambda self: self._get_mask_bit(12),
fset = lambda self, val: self._set_mask_bit(12, val))
geolayer_index_4 = property(fget = lambda self: self._get_mask_bit(13),
fset = lambda self: self._set_mask_bit(13, val))
light = property(fget = lambda self: self._get_mask_bit(14),
fset = lambda self, val: self._set_mask_bit(14, val))
subterranean = property(fget = lambda self: self._get_mask_bit(15),
fset = lambda self, val: self._set_mask_bit(15, val))
skyview = property(fget = lambda self: self._get_mask_bit(16),
fset = lambda self, val: self._set_mask_bit(16, val))
biome_1 = property(fget = lambda self: self._get_mask_bit(17),
fset = lambda self, val: self._set_mask_bit(17, val))
biome_2 = property(fget = lambda self: self._get_mask_bit(18),
fset = lambda self, val: self._set_mask_bit(18, val))
biome_3 = property(fget = lambda self: self._get_mask_bit(19),
fset = lambda self, val: self._set_mask_bit(19, val))
biome_4 = property(fget = lambda self: self._get_mask_bit(20),
fset = lambda self, val: self._set_mask_bit(20, val))
liquid_type = property(fget = lambda self: self._get_mask_bit(21),
fset = lambda self, val: self._set_mask_bit(21, val))
water_table = property(fget = lambda self: self._get_mask_bit(22),
fset = lambda self, val: self._set_mask_bit(22, val))
rained = property(fget = lambda self: self._get_mask_bit(23),
fset = lambda self, val: self._set_mask_bit(23, val))
traffic_1 = property(fget = lambda self: self._get_mask_bit(24),
fset = lambda self, val: self._set_mask_bit(24, val))
traffic_2 = property(fget = lambda self: self._get_mask_bit(25),
fset = lambda self, val: self._set_mask_bit(25, val))
flow_forbid = property(fget = lambda self: self._get_mask_bit(26),
fset = lambda self, val: self._set_mask_bit(26, val))
liquid_static = property(fget = lambda self: self._get_mask_bit(27),
fset = lambda self, val: self._set_mask_bit(27, val))
moss = property(fget = lambda self: self._get_mask_bit(28),
fset = lambda self, val: self._set_mask_bit(28, val))
feature_present = property(fget = lambda self: self._get_mask_bit(29),
fset = lambda self, val: self._set_mask_bit(29, val))
liquid_character_1 = property(fget = lambda self: self._get_mask_bit(30),
fset = lambda self, val: self._set_mask_bit(30, val))
liquid_character_2 = property(fget = lambda self: self._get_mask_bit(31),
fset = lambda self, val: self._set_mask_bit(31, val))
class OccupancyFlags(_UnionBase):
def set_splatter(self, state):
if state:
self.whole &= 0xFFFFFFC0
else:
self.whole &= ~0xFFFFFFC0
building_1 = property(fget = lambda self: self._get_mask_bit(0),
fset = lambda self, val: self._set_mask_bit(0, val))
building_2 = property(fget = lambda self: self._get_mask_bit(1),
fset = lambda self, val: self._set_mask_bit(1, val))
building_3 = property(fget = lambda self: self._get_mask_bit(2),
fset = lambda self, val: self._set_mask_bit(2, val))
unit = property(fget = lambda self: self._get_mask_bit(3),
fset = lambda self, val: self._set_mask_bit(3, val))
unit_grounded = property(fget = lambda self: self._get_mask_bit(4),
fset = lambda self, val: self._set_mask_bit(4, val))
item = property(fget = lambda self: self._get_mask_bit(5),
fset = lambda self, val: self._set_mask_bit(5, val))
mud = property(fget = lambda self: self._get_mask_bit(6),
fset = lambda self, val: self._set_mask_bit(6, val))
vomit = property(fget = lambda self: self._get_mask_bit(7),
fset = lambda self, val: self._set_mask_bit(7, val))
broken_arrows_color_1 = property(fget = lambda self: self._get_mask_bit(8),
fset = lambda self, val: self._set_mask_bit(8, val))
broken_arrows_color_2 = property(fget = lambda self: self._get_mask_bit(9),
fset = lambda self, val: self._set_mask_bit(9, val))
broken_arrows_color_3 = property(fget = lambda self: self._get_mask_bit(10),
fset = lambda self, val: self._set_mask_bit(10, val))
broken_arrows_color_4 = property(fget = lambda self: self._get_mask_bit(11),
fset = lambda self, val: self._set_mask_bit(11, val))
blood_g = property(fget = lambda self: self._get_mask_bit(12),
fset = lambda self: self._set_mask_bit(12, val))
blood_g2 = property(fget = lambda self: self._get_mask_bit(13),
fset = lambda self, val: self._set_mask_bit(13, val))
blood_b = property(fget = lambda self: self._get_mask_bit(14),
fset = lambda self, val: self._set_mask_bit(14, val))
blood_b2 = property(fget = lambda self: self._get_mask_bit(15),
fset = lambda self, val: self._set_mask_bit(15, val))
blood_y = property(fget = lambda self: self._get_mask_bit(16),
fset = lambda self, val: self._set_mask_bit(16, val))
blood_y2 = property(fget = lambda self: self._get_mask_bit(17),
fset = lambda self, val: self._set_mask_bit(17, val))
blood_m = property(fget = lambda self: self._get_mask_bit(18),
fset = lambda self, val: self._set_mask_bit(18, val))
blood_m2 = property(fget = lambda self: self._get_mask_bit(19),
fset = lambda self, val: self._set_mask_bit(19, val))
blood_c = property(fget = lambda self: self._get_mask_bit(20),
fset = lambda self, val: self._set_mask_bit(20, val))
blood_c2 = property(fget = lambda self: self._get_mask_bit(21),
fset = lambda self, val: self._set_mask_bit(21, val))
blood_w = property(fget = lambda self: self._get_mask_bit(22),
fset = lambda self, val: self._set_mask_bit(22, val))
blood_w2 = property(fget = lambda self: self._get_mask_bit(23),
fset = lambda self, val: self._set_mask_bit(23, val))
blood_o = property(fget = lambda self: self._get_mask_bit(24),
fset = lambda self, val: self._set_mask_bit(24, val))
blood_o2 = property(fget = lambda self: self._get_mask_bit(25),
fset = lambda self, val: self._set_mask_bit(25, val))
slime = property(fget = lambda self: self._get_mask_bit(26),
fset = lambda self, val: self._set_mask_bit(26, val))
slime2 = property(fget = lambda self: self._get_mask_bit(27),
fset = lambda self, val: self._set_mask_bit(27, val))
blood = property(fget = lambda self: self._get_mask_bit(28),
fset = lambda self, val: self._set_mask_bit(28, val))
blood2 = property(fget = lambda self: self._get_mask_bit(29),
fset = lambda self, val: self._set_mask_bit(29, val))
broken_arrows_variant = property(fget = lambda self: self._get_mask_bit(30),
fset = lambda self, val: self._set_mask_bit(30, val))
snow = property(fget = lambda self: self._get_mask_bit(31),
fset = lambda self, val: self._set_mask_bit(31, val))