本文整理汇总了Python中settings.Settings.shape方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.shape方法的具体用法?Python Settings.shape怎么用?Python Settings.shape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings.Settings
的用法示例。
在下文中一共展示了Settings.shape方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: air_strike
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import shape [as 别名]
def air_strike(self, coords, rotation=0):
result = {}
for coords in Settings.shape("air_strike"):
result[coords] = self.battlefield[coords].air_strike()
if result[coords] == "aircraft destroyed":
break
# aircraft isn't lost if it wasnt destroyed unlike other resources
if "aircraft destroyed" not in result.values():
self.resourses['aircrafts'] += 1
return result
示例2: battery
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import shape [as 别名]
def battery(self, coords, rotation=0):
return [self.battlefield[i].hit()
for i in Settings.shape("battery", coords, rotation)]
示例3: torpedo_net
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import shape [as 别名]
def torpedo_net(self, coords, rotation=0):
for i in Settings.shape("torpedo_net", coords, rotation):
self.battlefield[i].set_torpedo_net()
示例4: anti_air
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import shape [as 别名]
def anti_air(self, coords, rotation=0):
for i in Settings.shape("anti_air", coords, rotation):
self.battlefield[i].deploy_anti("air")
示例5: radar_jam
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import shape [as 别名]
def radar_jam(self, coords, rotation=0):
for i in Settings.shape("radar_jam", coords, rotation):
self.battlefield[i].deploy_anti("radar")
示例6: radar_scan
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import shape [as 别名]
def radar_scan(self, coords, rotation=0):
return [self.battlefield[i].radar_scan()
for i in Settings.shape("radar_scan", coords, rotation)]