Example #1
0
    public static void AddToQueue(BaseRegiment regiment)
    {
        RecruitAction act = new RecruitAction(Player.curRegion.data, regiment, regiment.time);

        Player.curRegion.data.AddRecruit(act);
        instance.UpdateQueue();
    }
Example #2
0
 public State()
 {
     regions   = new List <Region>();
     army      = new List <Army>();
     persons   = new List <Person>();
     ships     = new List <Ship>();
     regiments = new BaseRegiment[GameConst.MaxRegimentCount];
     GameObject.Instantiate(PrefabHandler.TechnologyTree).InitializeTree(this);
     stateAI = new StateAI(this);
     stateAI.IncomeResources(new Treasury(500, 2000, 100, 100, 20));
     GameTimer.AddListener(StateDecaSecondUpdate, this);
 }
Example #3
0
 public void Init(BaseRegiment regiment, Technology[] regTeches, Technology researchedRegiment)
 {
     BaseRegiment = regiment;
     Icon.sprite  = regiment.Icon;
     Name.text    = regiment.nameRegiment;
     for (int i = 0; i < regTeches.Length; i++)
     {
         Teches[i].Init(regTeches[i]);
     }
     if (researchedRegiment != null)
     {
         researchRegiment.Init(researchedRegiment);
     }
     researchRegiment.gameObject.SetActive(researchedRegiment != null);
 }
Example #4
0
    public override void Init(object reg)
    {
        BaseRegiment = (BaseRegiment)reg;
        gameObject.SetActive(true);
        icon.sprite = BaseRegiment.Icon;

        for (int i = 0; i < 3; i++)
        {
            ArmPips[i].sprite = SpriteHandler.GetPipsSprite(BaseRegiment.ArmorLvl((DamageType)i));
        }
        DamPips.sprite = SpriteHandler.GetPipsSprite(BaseRegiment.damageLvl);

        name.text  = BaseRegiment.type.ToString();
        descr.text = $"Стоимость {BaseRegiment.cost.ToArmyCost()}\nСодержание {BaseRegiment.upkeep.ToArmyCost()}\nВремя {BaseRegiment.time}";
        bye.onClick.RemoveAllListeners();
        if (Player.PlayerCheckRegion())
        {
            bye.onClick.AddListener(() => RecruitMenu.AddToQueue(BaseRegiment));
        }
        CheckCost();
    }
Example #5
0
 public Regiment(BaseRegiment t)
 {
     count        = t.maxcount;
     baseRegiment = t;
 }
Example #6
0
 public RecruitAction(ProvinceData prov, BaseRegiment reg, float dt) : base(dt)
 {
     //type = TypeGameAction.RecruitGameAction;
     regiment  = reg;
     onAction += () => prov.RecruitRegiment(this);
 }