示例#1
0
 def __init__(self, entity_id):
     Entity.__init__(self, entity_id)
     self.x = p.IntProperty(urn.x_urn)
     self.y = p.IntProperty(urn.y_urn)
     self.position = p.EntityIDProperty(urn.position_urn)
     self.apexes = p.IntArrayProperty(urn.apexes_urn)
     self.repair_cost = p.IntProperty(urn.repair_cost_urn)
     self.register_properties([self.x, self.y, self.position, self.apexes, self.repair_cost])
示例#2
0
 def __init__(self, entity_id):
     Entity.__init__(self, entity_id)
     self.x = p.IntProperty(urn.x_urn)
     self.y = p.IntProperty(urn.y_urn)
     self.travel_distance = p.IntProperty(urn.travel_distance_urn)
     self.position = p.EntityIDProperty(urn.position_urn)
     self.position_history = p.IntArrayProperty(urn.position_history_urn)
     self.direction = p.IntProperty(urn.direction_urn)
     self.stamina = p.IntProperty(urn.stamina_urn)
     self.hp = p.IntProperty(urn.hp_urn)
     self.damage = p.IntProperty(urn.damage_urn)
     self.buriedness = p.IntProperty(urn.buriedness_urn)
     self.register_properties([self.x, self.y, self.travel_distance, self.position, self.position_history])
     self.register_properties([self.direction, self.stamina, self.hp, self.damage, self.buriedness])
示例#3
0
def create_property(urn, byte_array):
    prop = None
    if urn in int_property_types:
        prop = p.IntProperty(urn)
        prop.read(ds.InputStream(byte_array))
    elif urn in int_list_property_types:
        prop = p.IntArrayProperty(urn)
        prop.read(ds.InputStream(byte_array))
    elif urn in entityid_property_types:
        prop = p.EntityIDProperty(urn)
        prop.read(ds.InputStream(byte_array))
    elif urn in entityid_list_property_types:
        prop = p.EntityIDListProperty(urn)
        prop.read(ds.InputStream(byte_array))
    elif urn in edgelist_property_types:
        prop = p.EdgeListProperty(urn)
        prop.read(ds.InputStream(byte_array))

    if prop is None:
        print 'prop:' + urn + ' is None'

    return prop