本文整理汇总了Python中Units.try_go_to_rocket方法的典型用法代码示例。如果您正苦于以下问题:Python Units.try_go_to_rocket方法的具体用法?Python Units.try_go_to_rocket怎么用?Python Units.try_go_to_rocket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Units
的用法示例。
在下文中一共展示了Units.try_go_to_rocket方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: import Units [as 别名]
# 或者: from Units import try_go_to_rocket [as 别名]
# 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)