# engine.LingYi.entitys.aircraft

View Source

      1# -*- coding:utf-8 -*-
      2
      3from .unit import Unit
      4from .global_util import *
      5
      6
      7class Aircraft(Unit):
      8    """
      9    飞机类
     10    1、获取飞机挂架和挂载上的武器信息
     11    2、获取精简信息, 提炼信息进行决策
     12    3、获取飞机当前油量
     13    4、获取飞机当前飞行状态
     14    5、获取飞机状态
     15    6、设置飞机的武器挂载
     16    7、飞机快速出动与否
     17    8、飞机中止出动
     18    9、飞机燃油计算
     19    10、设置当前单元（飞机）的飞行高度跟随地形
     20    11、卸货，飞机等卸掉物资
     21    12、卸载选定物资
     22    13、设置飞机的飞行高度层
     23
     24    示例：
     25    air1_id = "sflsf0-gjlsf-sf"  # 飞机guid
     26    air1 = self.get_unit(air1_id)  # 获取飞机对象
     27    if air1 is not None:
     28        reply = air1.set_loadout(22682)  # 设置此飞机武器挂载方案，挂载方案id：22682
     29        rate = air1.FuelRate  # 此飞机当前耗油率
     30    """
     31    def __init__(self, guid, name, side_name):
     32        Unit.__init__(self, guid, name, side_name, ElementType.Aircraft)
     33        # THAirOps等结构定义请查看entitys/struct.proto文件
     34        # 结构THUnitAircraft中属性： 飞机
     35        self.FlightRole = 0  # EFlightElement 航班角色
     36        self.AirborneTime = 0.0  # 飞行时间
     37        self.AltitudePreset = 0  # 预设高度  高度预设枚举值定义参见：飞机EAircraftAltitudePreset
     38        self.AirOps = {}  # 飞机停靠机场--结构：THAirOps
     39        self.FuelRate = 0.0  # 耗油率 千克/秒
     40
     41    def get_weapon_info(self):
     42        """
     43        1、获取飞机挂架和挂载上的武器信息
     44        :return: 武器ID和数量的字典
     45        """
     46        weapon_info = {}
     47        for k, v in self.Mounts.items():
     48            if "WeaponRecs" in v:
     49                for rid, w in v["WeaponRecs"].items():
     50                    count = w["CurrentLoad"]
     51                    if count > 0:
     52                        weaponid = w["WeaponDBID"]
     53                        if weaponid in weapon_info:
     54                            weapon_info[weaponid] += count
     55                        else:
     56                            weapon_info[weaponid] = count
     57
     58        for k, v in self.Loadouts.items():
     59            if "WeaponRecs" in v:
     60                for rid, w in v["WeaponRecs"].items():
     61                    if 'CurrentLoad' not in w:
     62                        continue
     63                    count = w["CurrentLoad"]
     64                    if count > 0:
     65                        weaponid = w["WeaponDBID"]
     66                        if weaponid in weapon_info:
     67                            weapon_info[weaponid] += count
     68                        else:
     69                            weapon_info[weaponid] = count
     70        return weapon_info
     71
     72    def get_summary_info(self):
     73        """
     74        2、获取精简信息, 提炼信息进行决策
     75        :return: dict, 飞机提炼信息
     76        """
     77        info_dict = {
     78            "category": "Aircraft",
     79            "guid": self.ID,
     80            "dbid": self.DBID,
     81            "type": self.Type,
     82            "name": self.Name,
     83            "mission": self.AssignedMission,
     84            "lat": self.Lat,
     85            "lon": self.Lon,
     86            "alt": self.CurrentAltitude,
     87            "course": self.get_way_points_info(),
     88            "head": self.CurrentHeading,
     89            "pitch": self.Pitch,
     90            "roll": self.Roll,
     91            "speed": self.CurrentSpeed,
     92            "fuel": self.FuelRecs,
     93            "damage": self.DamagePercent,
     94            "status": self.Status,
     95            "airops": self.AirOps,
     96            "sensors": self.Sensors,
     97            "sensory": self.Sensory,
     98            "mounts": self.Mounts,
     99            "loadout": self.Loadouts,
    100            "targetedBy": self.get_targets(),
    101            "fuelstate": self.FuelState,
    102            "fuelrate": self.FuelRate
    103        }
    104        return info_dict
    105
    106    def get_fuel_capacity(self):
    107        """
    108        3、获取飞机当前油量
    109        :return: float, 千克
    110        """
    111        fuel_capacity = 0
    112        for v in self.FuelRecs.values():
    113            if "CQ" in v:
    114                fuel_capacity += v['CQ']
    115        return fuel_capacity
    116
    117    def get_status(self):
    118        """
    119        4、获取飞机当前飞行状态
    120        :return: 枚举AirOpsCondition的值, global_util.py中定义
    121        """
    122        ops_code = 999
    123        if 'Con' in self.AirOps:
    124            ops_code = self.AirOps['Con']
    125        elif 'Condition' in self.AirOps:
    126            ops_code = self.AirOps['Condition']
    127        return ops_code
    128
    129    def get_status_type(self):
    130        """
    131        5、获取飞机状态
    132        :return: AirValidStatus, global_util.py中定义
    133        """
    134        ops_code = 999
    135        if 'Condition' in self.AirOps:
    136            ops_code = self.AirOps['Condition']
    137        elif 'Con' in self.AirOps:
    138            ops_code = self.AirOps['Con']
    139
    140        if ops_code in (1, 2, 4, 8, 9, 18, 23, 24, 26):
    141            # 在基地可马上部署飞行任务
    142            return AirValidStatus.validToFly
    143        elif ops_code in (0, 13, 14, 15, 16, 19, 20, 21, 22):
    144            # 在空中可部署巡逻，进攻，航路规划
    145            return AirValidStatus.InAir
    146        elif ops_code in (5, 10, 11, 17, 25):
    147            # 在空中返航或降落
    148            return AirValidStatus.InAirRTB
    149        else:
    150            # 在基地等待准备好
    151            return AirValidStatus.WaitReady
    152
    153    def set_loadout(self, loadoutID):
    154        """
    155        6 、设置飞机的武器挂载
    156        推演模式，需考虑机场或航母上弹药库有所需挂载的武器
    157        如机场或航母上弹药库无所需挂载的武器，则飞机挂载失败，挂载方案调整为预备飞行
    158        :param loadoutID: int  武器挂载方案ID
    159        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    160        """
    161        return self._game_server.api_set_loadout_need_magazine_weapon(self, loadoutID)
    162
    163    def quick_turnaround(self, bool_flag):
    164        """
    165        7、飞机快速周转与否
    166        :param bool_flag: bool
    167        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    168        """
    169        return self._game_server.api_quick_turnaround(self, bool_flag)
    170
    171    def abort_launch(self):
    172        """
    173        8、飞机中止出动
    174        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    175        """
    176        return self._game_server.api_abort_launch(self)
    177
    178    def calc_fuel_by_abntime(self, abntime):
    179        """
    180        9、飞机燃油计算，通过飞行时间（秒）计算剩余燃油（千克）
    181        :param abntime: int, 飞行时间，单位：秒
    182        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    183        """
    184        return self._game_server.api_calc_fuel_by_abntime(self, abntime)
    185
    186    def unit_follow_terrain(self, is_fellow):
    187        """
    188        10、设置当前单元（飞机）的飞行高度跟随地形
    189        :param is_fellow:bool, True:跟随地形
    190        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    191        """
    192        self._game_server.api_unit_follow_terrain(self, is_fellow)
    193
    194    def unload_cargo(self):
    195        """
    196        11、卸货，飞机等卸掉物资
    197        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    198        """
    199        return self._game_server.api_unload_cargo(self)
    200
    201    def UnloadSelCargos(self, cargo):
    202        """
    203        12、卸载选定物资
    204        :param cargo: list, 需卸货的物资ID列表
    205        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    206        """
    207        return self._game_server.api_UnloadSelCargos(self, cargo)
    208
    209    def set_alt_level(self, enum_alt):
    210        """
    211        13、设置飞机的期望飞行高度层,枚举AltitudeLevel的字符串值, global_util.py中定义
    212        :param enum_alt: str, 期望高度层：'MIN'：尽可能低;'LOW1000':低空305米，'LOW2000':低空610米;'MEDIUM12000':中高3658米;
    213                            'HIGH25000':高空7620米;'HIGH36000':高空10973米高;'MAX':尽可能高
    214        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    215        """
    216        return self._game_server.api_set_alt_level(self, enum_alt)

class Aircraft(engine.LingYi.entitys.unit.Unit): View Source

      8class Aircraft(Unit):
      9    """
     10    飞机类
     11    1、获取飞机挂架和挂载上的武器信息
     12    2、获取精简信息, 提炼信息进行决策
     13    3、获取飞机当前油量
     14    4、获取飞机当前飞行状态
     15    5、获取飞机状态
     16    6、设置飞机的武器挂载
     17    7、飞机快速出动与否
     18    8、飞机中止出动
     19    9、飞机燃油计算
     20    10、设置当前单元（飞机）的飞行高度跟随地形
     21    11、卸货，飞机等卸掉物资
     22    12、卸载选定物资
     23    13、设置飞机的飞行高度层
     24
     25    示例：
     26    air1_id = "sflsf0-gjlsf-sf"  # 飞机guid
     27    air1 = self.get_unit(air1_id)  # 获取飞机对象
     28    if air1 is not None:
     29        reply = air1.set_loadout(22682)  # 设置此飞机武器挂载方案，挂载方案id：22682
     30        rate = air1.FuelRate  # 此飞机当前耗油率
     31    """
     32    def __init__(self, guid, name, side_name):
     33        Unit.__init__(self, guid, name, side_name, ElementType.Aircraft)
     34        # THAirOps等结构定义请查看entitys/struct.proto文件
     35        # 结构THUnitAircraft中属性： 飞机
     36        self.FlightRole = 0  # EFlightElement 航班角色
     37        self.AirborneTime = 0.0  # 飞行时间
     38        self.AltitudePreset = 0  # 预设高度  高度预设枚举值定义参见：飞机EAircraftAltitudePreset
     39        self.AirOps = {}  # 飞机停靠机场--结构：THAirOps
     40        self.FuelRate = 0.0  # 耗油率 千克/秒
     41
     42    def get_weapon_info(self):
     43        """
     44        1、获取飞机挂架和挂载上的武器信息
     45        :return: 武器ID和数量的字典
     46        """
     47        weapon_info = {}
     48        for k, v in self.Mounts.items():
     49            if "WeaponRecs" in v:
     50                for rid, w in v["WeaponRecs"].items():
     51                    count = w["CurrentLoad"]
     52                    if count > 0:
     53                        weaponid = w["WeaponDBID"]
     54                        if weaponid in weapon_info:
     55                            weapon_info[weaponid] += count
     56                        else:
     57                            weapon_info[weaponid] = count
     58
     59        for k, v in self.Loadouts.items():
     60            if "WeaponRecs" in v:
     61                for rid, w in v["WeaponRecs"].items():
     62                    if 'CurrentLoad' not in w:
     63                        continue
     64                    count = w["CurrentLoad"]
     65                    if count > 0:
     66                        weaponid = w["WeaponDBID"]
     67                        if weaponid in weapon_info:
     68                            weapon_info[weaponid] += count
     69                        else:
     70                            weapon_info[weaponid] = count
     71        return weapon_info
     72
     73    def get_summary_info(self):
     74        """
     75        2、获取精简信息, 提炼信息进行决策
     76        :return: dict, 飞机提炼信息
     77        """
     78        info_dict = {
     79            "category": "Aircraft",
     80            "guid": self.ID,
     81            "dbid": self.DBID,
     82            "type": self.Type,
     83            "name": self.Name,
     84            "mission": self.AssignedMission,
     85            "lat": self.Lat,
     86            "lon": self.Lon,
     87            "alt": self.CurrentAltitude,
     88            "course": self.get_way_points_info(),
     89            "head": self.CurrentHeading,
     90            "pitch": self.Pitch,
     91            "roll": self.Roll,
     92            "speed": self.CurrentSpeed,
     93            "fuel": self.FuelRecs,
     94            "damage": self.DamagePercent,
     95            "status": self.Status,
     96            "airops": self.AirOps,
     97            "sensors": self.Sensors,
     98            "sensory": self.Sensory,
     99            "mounts": self.Mounts,
    100            "loadout": self.Loadouts,
    101            "targetedBy": self.get_targets(),
    102            "fuelstate": self.FuelState,
    103            "fuelrate": self.FuelRate
    104        }
    105        return info_dict
    106
    107    def get_fuel_capacity(self):
    108        """
    109        3、获取飞机当前油量
    110        :return: float, 千克
    111        """
    112        fuel_capacity = 0
    113        for v in self.FuelRecs.values():
    114            if "CQ" in v:
    115                fuel_capacity += v['CQ']
    116        return fuel_capacity
    117
    118    def get_status(self):
    119        """
    120        4、获取飞机当前飞行状态
    121        :return: 枚举AirOpsCondition的值, global_util.py中定义
    122        """
    123        ops_code = 999
    124        if 'Con' in self.AirOps:
    125            ops_code = self.AirOps['Con']
    126        elif 'Condition' in self.AirOps:
    127            ops_code = self.AirOps['Condition']
    128        return ops_code
    129
    130    def get_status_type(self):
    131        """
    132        5、获取飞机状态
    133        :return: AirValidStatus, global_util.py中定义
    134        """
    135        ops_code = 999
    136        if 'Condition' in self.AirOps:
    137            ops_code = self.AirOps['Condition']
    138        elif 'Con' in self.AirOps:
    139            ops_code = self.AirOps['Con']
    140
    141        if ops_code in (1, 2, 4, 8, 9, 18, 23, 24, 26):
    142            # 在基地可马上部署飞行任务
    143            return AirValidStatus.validToFly
    144        elif ops_code in (0, 13, 14, 15, 16, 19, 20, 21, 22):
    145            # 在空中可部署巡逻，进攻，航路规划
    146            return AirValidStatus.InAir
    147        elif ops_code in (5, 10, 11, 17, 25):
    148            # 在空中返航或降落
    149            return AirValidStatus.InAirRTB
    150        else:
    151            # 在基地等待准备好
    152            return AirValidStatus.WaitReady
    153
    154    def set_loadout(self, loadoutID):
    155        """
    156        6 、设置飞机的武器挂载
    157        推演模式，需考虑机场或航母上弹药库有所需挂载的武器
    158        如机场或航母上弹药库无所需挂载的武器，则飞机挂载失败，挂载方案调整为预备飞行
    159        :param loadoutID: int  武器挂载方案ID
    160        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    161        """
    162        return self._game_server.api_set_loadout_need_magazine_weapon(self, loadoutID)
    163
    164    def quick_turnaround(self, bool_flag):
    165        """
    166        7、飞机快速周转与否
    167        :param bool_flag: bool
    168        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    169        """
    170        return self._game_server.api_quick_turnaround(self, bool_flag)
    171
    172    def abort_launch(self):
    173        """
    174        8、飞机中止出动
    175        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    176        """
    177        return self._game_server.api_abort_launch(self)
    178
    179    def calc_fuel_by_abntime(self, abntime):
    180        """
    181        9、飞机燃油计算，通过飞行时间（秒）计算剩余燃油（千克）
    182        :param abntime: int, 飞行时间，单位：秒
    183        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    184        """
    185        return self._game_server.api_calc_fuel_by_abntime(self, abntime)
    186
    187    def unit_follow_terrain(self, is_fellow):
    188        """
    189        10、设置当前单元（飞机）的飞行高度跟随地形
    190        :param is_fellow:bool, True:跟随地形
    191        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    192        """
    193        self._game_server.api_unit_follow_terrain(self, is_fellow)
    194
    195    def unload_cargo(self):
    196        """
    197        11、卸货，飞机等卸掉物资
    198        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    199        """
    200        return self._game_server.api_unload_cargo(self)
    201
    202    def UnloadSelCargos(self, cargo):
    203        """
    204        12、卸载选定物资
    205        :param cargo: list, 需卸货的物资ID列表
    206        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    207        """
    208        return self._game_server.api_UnloadSelCargos(self, cargo)
    209
    210    def set_alt_level(self, enum_alt):
    211        """
    212        13、设置飞机的期望飞行高度层,枚举AltitudeLevel的字符串值, global_util.py中定义
    213        :param enum_alt: str, 期望高度层：'MIN'：尽可能低;'LOW1000':低空305米，'LOW2000':低空610米;'MEDIUM12000':中高3658米;
    214                            'HIGH25000':高空7620米;'HIGH36000':高空10973米高;'MAX':尽可能高
    215        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    216        """
    217        return self._game_server.api_set_alt_level(self, enum_alt)

飞机类
1、获取飞机挂架和挂载上的武器信息
2、获取精简信息, 提炼信息进行决策
3、获取飞机当前油量
4、获取飞机当前飞行状态
5、获取飞机状态
6、设置飞机的武器挂载
7、飞机快速出动与否
8、飞机中止出动
9、飞机燃油计算
10、设置当前单元（飞机）的飞行高度跟随地形
11、卸货，飞机等卸掉物资
12、卸载选定物资
13、设置飞机的飞行高度层

示例：
air1_id = "sflsf0-gjlsf-sf" # 飞机guid
air1 = self.get_unit(air1_id) # 获取飞机对象
if air1 is not None:
reply = air1.set_loadout(22682) # 设置此飞机武器挂载方案，挂载方案id：22682
rate = air1.FuelRate # 此飞机当前耗油率

Aircraft(guid, name, side_name) View Source

    32    def __init__(self, guid, name, side_name):
    33        Unit.__init__(self, guid, name, side_name, ElementType.Aircraft)
    34        # THAirOps等结构定义请查看entitys/struct.proto文件
    35        # 结构THUnitAircraft中属性： 飞机
    36        self.FlightRole = 0  # EFlightElement 航班角色
    37        self.AirborneTime = 0.0  # 飞行时间
    38        self.AltitudePreset = 0  # 预设高度  高度预设枚举值定义参见：飞机EAircraftAltitudePreset
    39        self.AirOps = {}  # 飞机停靠机场--结构：THAirOps
    40        self.FuelRate = 0.0  # 耗油率 千克/秒

FlightRole
AirborneTime
AltitudePreset
AirOps
FuelRate
def get_weapon_info(self): View Source

    42    def get_weapon_info(self):
    43        """
    44        1、获取飞机挂架和挂载上的武器信息
    45        :return: 武器ID和数量的字典
    46        """
    47        weapon_info = {}
    48        for k, v in self.Mounts.items():
    49            if "WeaponRecs" in v:
    50                for rid, w in v["WeaponRecs"].items():
    51                    count = w["CurrentLoad"]
    52                    if count > 0:
    53                        weaponid = w["WeaponDBID"]
    54                        if weaponid in weapon_info:
    55                            weapon_info[weaponid] += count
    56                        else:
    57                            weapon_info[weaponid] = count
    58
    59        for k, v in self.Loadouts.items():
    60            if "WeaponRecs" in v:
    61                for rid, w in v["WeaponRecs"].items():
    62                    if 'CurrentLoad' not in w:
    63                        continue
    64                    count = w["CurrentLoad"]
    65                    if count > 0:
    66                        weaponid = w["WeaponDBID"]
    67                        if weaponid in weapon_info:
    68                            weapon_info[weaponid] += count
    69                        else:
    70                            weapon_info[weaponid] = count
    71        return weapon_info

1、获取飞机挂架和挂载上的武器信息 :return: 武器ID和数量的字典

def get_summary_info(self): View Source

     73    def get_summary_info(self):
     74        """
     75        2、获取精简信息, 提炼信息进行决策
     76        :return: dict, 飞机提炼信息
     77        """
     78        info_dict = {
     79            "category": "Aircraft",
     80            "guid": self.ID,
     81            "dbid": self.DBID,
     82            "type": self.Type,
     83            "name": self.Name,
     84            "mission": self.AssignedMission,
     85            "lat": self.Lat,
     86            "lon": self.Lon,
     87            "alt": self.CurrentAltitude,
     88            "course": self.get_way_points_info(),
     89            "head": self.CurrentHeading,
     90            "pitch": self.Pitch,
     91            "roll": self.Roll,
     92            "speed": self.CurrentSpeed,
     93            "fuel": self.FuelRecs,
     94            "damage": self.DamagePercent,
     95            "status": self.Status,
     96            "airops": self.AirOps,
     97            "sensors": self.Sensors,
     98            "sensory": self.Sensory,
     99            "mounts": self.Mounts,
    100            "loadout": self.Loadouts,
    101            "targetedBy": self.get_targets(),
    102            "fuelstate": self.FuelState,
    103            "fuelrate": self.FuelRate
    104        }
    105        return info_dict

2、获取精简信息, 提炼信息进行决策 :return: dict, 飞机提炼信息

def get_fuel_capacity(self): View Source

    107    def get_fuel_capacity(self):
    108        """
    109        3、获取飞机当前油量
    110        :return: float, 千克
    111        """
    112        fuel_capacity = 0
    113        for v in self.FuelRecs.values():
    114            if "CQ" in v:
    115                fuel_capacity += v['CQ']
    116        return fuel_capacity

3、获取飞机当前油量 :return: float, 千克

def get_status(self): View Source

    118    def get_status(self):
    119        """
    120        4、获取飞机当前飞行状态
    121        :return: 枚举AirOpsCondition的值, global_util.py中定义
    122        """
    123        ops_code = 999
    124        if 'Con' in self.AirOps:
    125            ops_code = self.AirOps['Con']
    126        elif 'Condition' in self.AirOps:
    127            ops_code = self.AirOps['Condition']
    128        return ops_code

4、获取飞机当前飞行状态 :return: 枚举AirOpsCondition的值, global_util.py中定义

def get_status_type(self): View Source

    130    def get_status_type(self):
    131        """
    132        5、获取飞机状态
    133        :return: AirValidStatus, global_util.py中定义
    134        """
    135        ops_code = 999
    136        if 'Condition' in self.AirOps:
    137            ops_code = self.AirOps['Condition']
    138        elif 'Con' in self.AirOps:
    139            ops_code = self.AirOps['Con']
    140
    141        if ops_code in (1, 2, 4, 8, 9, 18, 23, 24, 26):
    142            # 在基地可马上部署飞行任务
    143            return AirValidStatus.validToFly
    144        elif ops_code in (0, 13, 14, 15, 16, 19, 20, 21, 22):
    145            # 在空中可部署巡逻，进攻，航路规划
    146            return AirValidStatus.InAir
    147        elif ops_code in (5, 10, 11, 17, 25):
    148            # 在空中返航或降落
    149            return AirValidStatus.InAirRTB
    150        else:
    151            # 在基地等待准备好
    152            return AirValidStatus.WaitReady

5、获取飞机状态 :return: AirValidStatus, global_util.py中定义

def set_loadout(self, loadoutID): View Source

    154    def set_loadout(self, loadoutID):
    155        """
    156        6 、设置飞机的武器挂载
    157        推演模式，需考虑机场或航母上弹药库有所需挂载的武器
    158        如机场或航母上弹药库无所需挂载的武器，则飞机挂载失败，挂载方案调整为预备飞行
    159        :param loadoutID: int  武器挂载方案ID
    160        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    161        """
    162        return self._game_server.api_set_loadout_need_magazine_weapon(self, loadoutID)

6 、设置飞机的武器挂载 推演模式，需考虑机场或航母上弹药库有所需挂载的武器 如机场或航母上弹药库无所需挂载的武器，则飞机挂载失败，挂载方案调整为预备飞行 :param loadoutID: int 武器挂载方案ID :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def quick_turnaround(self, bool_flag): View Source

    164    def quick_turnaround(self, bool_flag):
    165        """
    166        7、飞机快速周转与否
    167        :param bool_flag: bool
    168        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    169        """
    170        return self._game_server.api_quick_turnaround(self, bool_flag)

7、飞机快速周转与否 :param bool_flag: bool :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def abort_launch(self): View Source

    172    def abort_launch(self):
    173        """
    174        8、飞机中止出动
    175        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    176        """
    177        return self._game_server.api_abort_launch(self)

8、飞机中止出动 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def calc_fuel_by_abntime(self, abntime): View Source

    179    def calc_fuel_by_abntime(self, abntime):
    180        """
    181        9、飞机燃油计算，通过飞行时间（秒）计算剩余燃油（千克）
    182        :param abntime: int, 飞行时间，单位：秒
    183        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    184        """
    185        return self._game_server.api_calc_fuel_by_abntime(self, abntime)

9、飞机燃油计算，通过飞行时间（秒）计算剩余燃油（千克） :param abntime: int, 飞行时间，单位：秒 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def unit_follow_terrain(self, is_fellow): View Source

    187    def unit_follow_terrain(self, is_fellow):
    188        """
    189        10、设置当前单元（飞机）的飞行高度跟随地形
    190        :param is_fellow:bool, True:跟随地形
    191        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    192        """
    193        self._game_server.api_unit_follow_terrain(self, is_fellow)

10、设置当前单元（飞机）的飞行高度跟随地形 :param is_fellow:bool, True:跟随地形 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def unload_cargo(self): View Source

    195    def unload_cargo(self):
    196        """
    197        11、卸货，飞机等卸掉物资
    198        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    199        """
    200        return self._game_server.api_unload_cargo(self)

11、卸货，飞机等卸掉物资 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def UnloadSelCargos(self, cargo): View Source

    202    def UnloadSelCargos(self, cargo):
    203        """
    204        12、卸载选定物资
    205        :param cargo: list, 需卸货的物资ID列表
    206        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    207        """
    208        return self._game_server.api_UnloadSelCargos(self, cargo)

12、卸载选定物资 :param cargo: list, 需卸货的物资ID列表 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_alt_level(self, enum_alt): View Source

    210    def set_alt_level(self, enum_alt):
    211        """
    212        13、设置飞机的期望飞行高度层,枚举AltitudeLevel的字符串值, global_util.py中定义
    213        :param enum_alt: str, 期望高度层：'MIN'：尽可能低;'LOW1000':低空305米，'LOW2000':低空610米;'MEDIUM12000':中高3658米;
    214                            'HIGH25000':高空7620米;'HIGH36000':高空10973米高;'MAX':尽可能高
    215        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    216        """
    217        return self._game_server.api_set_alt_level(self, enum_alt)

13、设置飞机的期望飞行高度层,枚举AltitudeLevel的字符串值, global_util.py中定义 :param enum_alt: str, 期望高度层：'MIN'：尽可能低;'LOW1000':低空305米，'LOW2000':低空610米;'MEDIUM12000':中高3658米; 'HIGH25000':高空7620米;'HIGH36000':高空10973米高;'MAX':尽可能高 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

##### Inherited Members

engine.LingYi.entitys.unit.Unit
  Lon
  Lat
  CurrentAltitude
  CurrentHeading
  Pitch
  Roll
  CurrentSpeed
  Acc
  CargoToMission
  DockingCondition
  Throttle
  Status
  FuelState
  WeaponState
  DesiredSpeed
  DesiredAltitude
  DamagePts
  DamagePercent
  AssignedMission
  GroupID
  IsAD
  AI
  Weaponry
  Kinematics
  Navigator
  Damage
  Sensory
  CommDevices
  Sensors
  Mounts
  Magazines
  Cargos
  AirFacilitys
  DockFacilitys
  Propulsions
  FuelRecs
  Loadouts
  RangeSymbols
  Source
  CommStuff
  Category
  Type
  DBID
  ProficiencyLevel
  XSections
  UnitType
  get_mounts_weapon_info
  get_way_points_info
  weapon2mount
  get_targets
  EMCON_Obey_doctrine
  switch_radar
  switch_sonar
  switch_OECM
  switch_laser
  attack_auto
  attack_target_info
  attack_manual
  attack_weapon_allocate_to_target
  attack_BOL
  cancel_attack_contact
  chaff_burst
  chaff_continous_burst
  attack_drop_target
  attack_drop_target_all
  deploy_sonar
  set_desired_speed
  set_throttle
  set_alt_manual
  set_desired_height
  follow_terrain
  plotted_course
  clear_plotted_course
  set_weapoint
  set_waypoint_sensor
  set_waypoint_bearings
  return_to_base
  select_new_base
  refuel
  hold_positon
  assign_to_mission
  assign_to_mission_escort
  withdraw_from_mission
  weapon_reload_priority
  cargo_load_ops
  get_way_point
  set_attack_course
  set_weapon_course
engine.LingYi.entitys.gameunit.GameUnit
  secure_key2
  secure_key
  check_id_api
  get_key
  set_key
  clear_key
  delete_sub_object
engine.LingYi.entitys.operatorbase.DoctrineOperator
  Doctrine
  category
  category_str
  doctrine_switch_radar
  doctrine_switch_oecm
  doctrine_switch_sonar
  doctrine_SetEMCON_Inherit
  use_nuclear_weapons
  doctrine_weapon_control_status_air
  doctrine_weapon_control_status_surface
  doctrine_weapon_control_status_subsurface
  doctrine_weapon_control_status_land
  doctrine_ignore_plotted_course
  doctrine_engaging_ambiguous_targets
  doctrine_engage_opportunity_targets
  doctrine_ignore_emcon_under_attack
  torpedoes_kinematic_range
  doctrine_automatic_evasion
  doctrine_refuel
  doctrine_refuel_select
  doctrine_refuel_allied
  doctrine_air_operations_tempo
  doctrine_quick_turnaround
  doctrine_fuel_state_planned
  doctrine_fuel_state_rtb
  doctrine_weapon_state_planned
  doctrine_weapon_state_rtb
  doctrine_gun_strafing
  doctrine_jettison_ordnance
  doctrine_bvr_logic
  use_sams_in_anti_surface_mode
  doctrine_maintain_standoff
  doctrine_navigation_surface_mode
  avoid_contact
  dive_on_threat
  recharge_on_patrol
  recharge_on_attack
  use_aip
  dipping_sonar
  navigation_sub
  navigation_land
  set_weapon_release_authority
  wra_qty_salvo
  wra_shooter_salvo
  wra_firing_range
  wra_self_defence_distance
  withdraw_on_damage
  withdraw_on_fuel
  withdraw_on_attack
  withdraw_on_defence
  deploy_on_damage
  deploy_on_fuel
  deploy_on_attack
  deploy_on_defence
  get_doctrineWRA
engine.LingYi.entitys.element.Element
  ID
  Name
  Side
  ElementType