Ejemplo n.º 1
0
 //create a strike class for the player
 public Strike(Player player)
 {
     spell  = null;
     melee  = null;
     ranged = null;
     thing  = player;
     getAttack();
 }
Ejemplo n.º 2
0
        private void getAttack()
        {
            Object attack = thing.doTurn();

            if (attack != null)
            {
                if (attack.GetType().IsSubclassOf(typeof(AbstractMelee)))
                {
                    melee = (AbstractMelee)attack;
                }
                else if (attack.GetType().IsSubclassOf(typeof(AbstractRanged)))
                {
                    ranged = (AbstractRanged)attack;
                }
                else if (attack.GetType() == (typeof(Spell)))
                {
                    spell = (Spell)attack;
                }
            }
        }