Exemplo n.º 1
0
            # print(Globals.pathToEnemy)
        asteroid = None
        if (round > 250 and Globals.radar.our_num_earth_rockets < 1) or round > 600:
            Globals.factory_hold = True
        else:
            Globals.factory_hold = False

        if Globals.asteroid_pattern.has_asteroid(round):
            asteroid = Globals.asteroid_pattern.asteroid(round)
        if asteroid is not None:
            Globals.radar.update_karb_amount(gc, asteroid.location, asteroid.karbonite)
            if Globals.radar.our_num_mars_workers > 0:
                Worker.get_closest_workers(gc, asteroid.location, Globals.pathsToKarbMars)
        for unit in gc.my_units():
            Globals.radar.update_location(unit)
            if Units.try_go_to_rocket(gc, unit):
                continue
            if unit.location.is_on_map():
                if Globals.radar.check_if_enemies_gone(gc, unit):
                    Globals.everyone_to_mars = True
                if unit.location.map_location().planet == bc.Planet.Mars and Globals.on_mars is False:
                    Globals.on_mars = True
                    Navigation.BFS(gc.starting_map(bc.Planet.Mars), Globals.radar.get_enemy_center(bc.Planet.Mars), gc)
                if unit.unit_type == bc.UnitType.Worker:
                    s = time.time()
                    Worker.manage_worker(gc, unit)
                    Globals.wtime += (time.time() - s)
                elif unit.unit_type == bc.UnitType.Rocket:
                    Rocket.manage_rockets(gc, unit)
                elif unit.unit_type == bc.UnitType.Healer:
                    Healer.manage_healers(gc, unit)