예제 #1
0
 def __init__(self, config):
     Location.__init__(self, config)
     self.victory_chance = config['victory_chance']
     self.reward = config['reward']
     self.exp_reward = config['exp_reward']
     self.penalty = config['penalty']
     self.drop_object = config['drop_object']
예제 #2
0
    def __init__(self, map_name, name):
            xml = doc.xpath('//map[@name="%s"]/door[@name="%s"]' % (map_name, name))[0]
            #~ print etree.tostring(xml)
            Location.__init__(self, map_name, xml.get('loc'))
            #~ Location.__init__(self, map_name, doc.xpath('//map[@name="%s"]/door[@name="%s"]' % (map_name, name))[0].get('loc'))
            self.door_name = name

            if not xml.get('target'):
                raise Exception("door without target: %s" % etree.tostring(xml))
            self.target = xml.get('target')
예제 #3
0
    def __init__(self, *args, basis_location=None, **kwargs):
        Location.__init__(self, *args, **kwargs)
        self.decor_dict = {}
        self.map_node = None
        self.newer_location = None
        self.basis_location = basis_location
        if basis_location:
            basis_location.add_newer_location(self)
            self.map_node = basis_location.map_node
            movers = list(basis_location.things)
            for thing in movers:
                thing.change_location(self, keep_arranged=True)
            self.decor_dict = dict(basis_location.decor_dict)

        self.generate_items()
예제 #4
0
 def __init__(self, x, y, node_type):
     Location.__init__(self, x, y)
     self.important = False
     if node_type == 'N' or node_type == 'M':
         self.owner = PlayerColor.NEUTRAL
         self.building = Building(BuildingType.EMPTY, UnitType.EMPTY)
         self.important = node_type == 'M'
     elif node_type == 'B':
         self.owner = PlayerColor.BLUE
         self.building = Building(BuildingType.HOME, UnitType.PIKEMAN)
         self.important = True
     elif node_type == 'R':
         self.owner = PlayerColor.RED
         self.building = Building(BuildingType.HOME, UnitType.PIKEMAN)
         self.important = True
     self.spawn_timer = 0
     self.exit_direction = {PlayerColor.RED: None, PlayerColor.BLUE: None}
     self.unit_in_loc = self.unit_in_loc
예제 #5
0
    def __init__(self, name, lng, lat, class_num, apt, kml, delay_cost=1, speed=13000.0, 
                                    max_delay=1000, swap_time=10, arr_time=None, pred=None):
        Location.__init__(self, name, lng, lat)

        # Create the folder to store all the KML data
        self.fol = kml.newfolder(name=name)
        self.coord_path = [(lng, lat)]

        self.class_num = class_num
        self.delay_cost = delay_cost
        self.landed = False
        self.speed = speed
        self.max_delay = max_delay
        self.swap_time = swap_time
        self.apt = apt
        self.pred = pred
        self.delay = 0
        self.arr_time = arr_time
        self.arrived = False if ( arr_time != None and arr_time > 1 ) else True
        if apt:
            self.eta = self.get_eta()
            if self.pred:
                self.eta += self.pred.eta + 10
예제 #6
0
 def __init__(self, config):
     Location.__init__(self, config)
     self.inventory_price = config['inventory_price']
     self.extra_price = config['extra_price']
예제 #7
0
파일: topic.py 프로젝트: AA33/dsa_exp
 def __init__(self, tid, x, y, source=None):
     Location.__init__(self, x, y, tid)
     if source:
         self.distance = self.dist(source)
     else:
         self.distance = float('inf')  # the max possible
예제 #8
0
 def __init__(self, map_name, xml):
     loc = xml.get('loc').split(',')
     loc = (int(loc[0]), int(loc[1]))
     Location.__init__(self, map_name, loc)
     self.target = xml.get('target')
     self.name = xml.get('name')