Пример #1
0
    public void barrackAssignement()
    {
        if (jobsOrCityBtnPressed.tag == ConstantsAndEnums.tagBtnJob.barrackBtn.ToString())
        {
            // attribution des vikings

            if (upOrDownBtnPressed.tag.Equals(ConstantsAndEnums.tagUpOrDown.upViking.ToString()))
            {
                myBarrack.NbrOfVikingToTrainChosen += 1;
            }

            if (upOrDownBtnPressed.tag.Equals(ConstantsAndEnums.tagUpOrDown.downViking.ToString()))
            {
                if (myBarrack.NbrOfVikingToTrainChosen > 0)
                {
                    myBarrack.NbrOfVikingToTrainChosen -= 1;
                }
            }
            // attribution des shieldmaidens
            if (upOrDownBtnPressed.tag.Equals(ConstantsAndEnums.tagUpOrDown.upShieldMaiden.ToString()))
            {
                myBarrack.NbrOFSMToTrainChosen += 1;
            }

            if (upOrDownBtnPressed.tag.Equals(ConstantsAndEnums.tagUpOrDown.downShieldMaiden.ToString()))
            {
                if (myBarrack.NbrOFSMToTrainChosen > 0)
                {
                    myBarrack.NbrOFSMToTrainChosen -= 1;
                }
            }

            // mettre en route les entrainements
            if (upOrDownBtnPressed.tag.Equals(ConstantsAndEnums.tagShipType.applyBtn.ToString()))
            {
                myBarrack.assignWork(gameManager, textManager);
            }


            myBarrack.goldNeedCalculation();
            myBarrack.nbrOfTeachersSMNeededCalculation();
        }
    }