예제 #1
0
        public void BuildTeam()
        {
            FightUnitHud playerHud          = new FightUnitHud();
            FightElement playerFightElement = new FightElement();

            playerFightElement.AttackPower = 15;
            playerFightElement.Speed       = 15;
            ReachedGoal playerreachedGoal = new ReachedGoal(TotalAmountToReached);



            FightUnit playerFightUnit = new FightUnit()
            {
                fightElement    = playerFightElement,
                fightUnitHud    = playerHud,
                reachedGoal     = playerreachedGoal,
                SpriteAssetName = new UnitName()
                {
                    Name = "playericon"
                },

                SpriteUnitIcon = new UnitIcon()
                {
                    IconName = "playericon"
                },
            };

            FightUnitHud emenyHud          = new FightUnitHud();
            FightElement emenyFightElement = new FightElement();

            emenyFightElement.Speed = 10;
            ReachedGoal emenyReachedGoal = new ReachedGoal(TotalAmountToReached);
            FightUnit   emenyFightUnit   = new FightUnit()
            {
                fightElement    = emenyFightElement,
                fightUnitHud    = emenyHud,
                reachedGoal     = emenyReachedGoal,
                SpriteAssetName = new UnitName()
                {
                    Name = "enemyicon"
                },
                SpriteUnitIcon = new UnitIcon()
                {
                    IconName = "enemyicon"
                },
            };

            playerFightUnit.TargetFightUnits.Add(emenyFightUnit);
            emenyFightUnit.TargetFightUnits.Add(playerFightUnit);

            PlayerFightUnits.fightUnit = playerFightUnit;
            EnemyFightUnits.fightUnit  = emenyFightUnit;
        }
예제 #2
0
 public bool DamageToDead(FightElement fightElement)
 {
     Health -= fightElement.AttackPower;
     return(IsDead);
 }