当前位置: 首页>>代码示例>>Python>>正文


Python Settings.shape方法代码示例

本文整理汇总了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
开发者ID:IliaSky,项目名称:python-battleships,代码行数:14,代码来源:ship.py

示例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)]
开发者ID:IliaSky,项目名称:python-battleships,代码行数:5,代码来源:ship.py

示例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()
开发者ID:IliaSky,项目名称:python-battleships,代码行数:5,代码来源:ship.py

示例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")
开发者ID:IliaSky,项目名称:python-battleships,代码行数:5,代码来源:ship.py

示例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")
开发者ID:IliaSky,项目名称:python-battleships,代码行数:5,代码来源:ship.py

示例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)]
开发者ID:IliaSky,项目名称:python-battleships,代码行数:5,代码来源:ship.py


注:本文中的settings.Settings.shape方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。