def get_units_from_side(side_guid, class_name, all_info_dict): a_side_dic = get_a_side_dic(side_guid, all_info_dict) # pylog.info(len(a_side_dic)) a_side_class_dic = get_class_dic(a_side_dic) # show_class_info(a_side_class_dic) dic = a_side_class_dic.get(class_name) return dic
def _init_red_unit_list(self): side_name = self.red_side_name ret_lt = [] side_guid = get_side_guid_from_side_name(side_name, self.mozi_service.all_info_dict) side_dic = get_a_side_dic(side_guid, self.mozi_service.all_info_dict) aircraft_list_dic = get_units_from_side(side_guid, "CAircraft", self.mozi_service.all_info_dict) for key in aircraft_list_dic: ret_lt.append(key) return ret_lt
def _init_red_unit_list(self): side_name = self.red_side_name ret_lt = [] side_guid = get_side_guid_from_side_name( side_name, self.mozi_service.all_info_dict) side_dic = get_a_side_dic(side_guid, self.mozi_service.all_info_dict) aircraft_list_dic = get_units_from_side( side_guid, "CAircraft", self.mozi_service.all_info_dict) for key in aircraft_list_dic: item = aircraft_list_dic[key] if item["strUnitClass"] == '苏-35S型“超级侧卫”战斗机': ret_lt.append(key) return ret_lt
def _get_missile_num(self, side_name): missile_count = 0 side_guid = get_side_guid_from_side_name( side_name, self.mozi_service.all_info_dict) side_dic = get_a_side_dic(side_guid, self.mozi_service.all_info_dict) for key in side_dic: if side_dic[key]["ClassName"] == "CWeapon": missile_count += 1 #pylog.info(side_dic[key]) pylog.info("m_PrimaryTargetGuid:%s" % side_dic[key]["m_PrimaryTargetGuid"]) pylog.info("m_FiringUnitGuid:%s" % side_dic[key]["m_FiringUnitGuid"]) #for k in side_dic[key]: # pylog.info("%s:%s" % (k, side_dic[key][k])) return missile_count
def get_all_units_from_side(side_guid, all_info_dict): a_side_dic = get_a_side_dic(side_guid, all_info_dict) return a_side_dic