예제 #1
0
        internal List <McUnit> GetUnits(int[] ids)
        {
            List <McUnit> unitList = McDbCommunication.ReadUnits(ids).ToList();

            foreach (var item in unitList)
            {
                item.Size = McDbCommunication.ReadSizes(new int[1] {
                    item.SizeId
                })[0];
                item.Type = McDbCommunication.ReadTypes(new int[1] {
                    item.TypeId
                })[0];
                item.Level = McDbCommunication.ReadLevels(new int[1] {
                    item.LevelId
                })[0];
                item.Specialization = McDbCommunication.ReadSpecializations(new int[1] {
                    item.SpecializationId
                })[0];
                item.Race = McDbCommunication.ReadRaces(new int[1] {
                    item.RaceId
                })[0];
                item.Faction = item.FactionId < 1 ? null : McDbCommunication.ReadFactions(new int[1] {
                    item.FactionId
                })[0];
                item.Commander = item.CommanderId < 1 ? null : McDbCommunication.ReadCommanders(new int[1] {
                    item.CommanderId
                })[0];
            }



            return(unitList);
        }
예제 #2
0
        internal List <McLevel> GetLevels(int[] ids)
        {
            {
                List <McLevel> levelList = McDbCommunication.ReadLevels(ids).ToList();
                levelList.OrderBy(x => x.Name);

                return(levelList);
            }
        }
예제 #3
0
        public McUnit(int id, string name, int sizeId, int typeId, int levelId, int xp, int specializationId, int raceId, int factionId, int commanderId, string icon, int mountId)
        {
            Id               = id;
            Name             = name;
            SizeId           = sizeId;
            TypeId           = typeId;
            LevelId          = levelId;
            Xp               = xp;
            SpecializationId = specializationId;
            RaceId           = raceId;
            FactionId        = factionId;
            CommanderId      = commanderId;
            IconString       = icon;
            MountId          = mountId;

            Size = McDbCommunication.ReadSizes(new int[1] {
                SizeId
            })[0];
            Type = McDbCommunication.ReadTypes(new int[1] {
                TypeId
            })[0];
            Level = McDbCommunication.ReadLevels(new int[1] {
                LevelId
            })[0];
            Specialization = McDbCommunication.ReadSpecializations(new int[1] {
                SpecializationId
            })[0];
            Race = McDbCommunication.ReadRaces(new int[1] {
                RaceId
            })[0];
            Faction = McDbCommunication.ReadFactions(new int[1] {
                FactionId
            })[0];
            //if(DBMasscombatCommunication.ReadCommanders(new int[1] { CommanderId })[0] != null) { Commander = DBMasscombatCommunication.ReadCommanders(new int[1] { CommanderId })[0]; }
            if (MountId > 0)
            {
                Mount = McDbCommunication.ReadRaces(new int[1] {
                    MountId
                })[0];
            }
            else
            {
                Mount = null;
            }

            AbilityList   = SetAbilityList();
            CommandList   = SetCommandList();
            EquipmentList = SetEquipmentList();
            PromotionList = SetPromotionList();
            TacticList    = SetTacticList();
        }