Пример #1
0
        public NpcModel(string npcName, int npcId)
        {
            NpcUser = new NpcUser();

            NpcUser.Init(npcName, npcId);

            NpcMother = new NpcMother();
            NpcMother.Init(NpcUser);

            NpcAlliance = new NpcAlliance();
            NpcAlliance.Init(NpcUser);

            NpcAllianceUser = new NpcAllianceUser();
            NpcAllianceUser.Init(NpcUser, NpcAlliance);

            var teches = new BattleTeches();

            teches.CreateStartTeches();
            var npcTeches = teches.ConvertToDbTeches();

            NpcAllianceTeth = new NpcAllianceTeth
            {
                Id     = NpcAlliance.Id,
                Teches = npcTeches
            };
        }
Пример #2
0
 public void Init(NpcUser npc, NpcAlliance npcAlliance,
                  byte roleId = (byte)AllianceRoles.Creator)
 {
     AllianceId = npcAlliance.Id;
     UserId     = npc.Id;
     RoleId     = roleId;
 }
Пример #3
0
        public void Init(NpcUser npc, L10NSimple description = null, Label img = null)
        {
            NpcAllianceId npcAllianceId;

            Enum.TryParse(npc.Nickname, true, out npcAllianceId);
            Id          = (int)npcAllianceId;
            Name        = npc.Nickname;
            CreatorId   = npc.Id;
            CreatorName = npc.Nickname;
            DateCreate  = npc.DateCreate;
            Description = (description == null) ? new L10NSimple().ToSerealizeString() : description.ToSerealizeString();
            Images      = img ?? Label.DefaultUrls();
            Disbandet   = false;
            //  UserImagesDirectory.CheckUserDirectory(Label.Type, Id);
        }
Пример #4
0
        public void Init(NpcUser npc, StorageResources sr = null, Dictionary <UnitType, int> hangar = null,
                         MaterialResource extraction      = null)
        {
            Id                        = npc.Id;
            Resources                 = sr ?? StorageResources.InitPlanetResources();
            Hangar                    = hangar ?? UnitList.InitUnitsInOwn(true);
            ExtractionProportin       = extraction ?? MaterialResource.InitBaseOwnProportion();
            StartSystemId             = 1;
            LastUpgradeProductionTime = 0;
            LaboratoryProgress        = new ItemProgress();
            var teches = new BattleTeches();

            teches.CreateStartTeches();
            TechProgress = teches.ConvertToDbTeches();
        }