/// <summary> /// Constructor taking a Referee, attacker, and the turn choice of the attacker /// </summary> /// <param name="referee"></param> /// <param name="attacker"></param> /// <param name="choice"></param> public TurnEngine(RefereeModel referee, DungeonFighterModel attacker, DungeonFighterModel target, TurnChoiceEnum choice) { rnd = new Random(); Referee = referee; Attacker = attacker; Target = target; ActionChoice = choice; }
/// <summary> /// Perform the next turn using the specified choice /// </summary> public bool TakeTurn(TurnChoiceEnum choice) { // Select target automatically if monster is currently attacking or autobattle is enabled if (Referee.AutoBattleEnabled || CurrentPlayer.PlayerType.Equals(CreatureEnum.Monster)) { Target = ChooseTarget(CurrentPlayer); } // otherwise the target is being set externally through the Battle Page var turn = new TurnEngine(Referee, CurrentPlayer, Target, choice); turn.TakeTurn(); return(true); }