//create a strike class for the player public Strike(Player player) { spell = null; melee = null; ranged = null; thing = player; getAttack(); }
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; } } }