public void ApplyMove(IPlayerMove move)
{
var updateMove = move as IPlayerMoveForUpdate;
Debug.Assert(updateMove != null);
_previousTurnInfo.Push(TurnInfo.Create(this, updateMove));
updateMove.ApplyTo(this);
_allAvailableMoves = null;
if (CurrentPhase == GamePhase.Play)
{
CurrentUniversity.ConsumeStudents(move);
}
if (CurrentPhase == GamePhase.Setup2 && move is BuildCampusMove)
{
CurrentUniversity.AcquireInitialStudents(((BuildCampusMove) move).WhereAt);
}
if (CurrentPhase != GamePhase.Play && !(move is EndTurn)) // setup phase
{
if (!_setupMoveGenerator.ShouldBuildCampus)
{
ApplyMove(new EndTurn());
}
_setupMoveGenerator.Toggle();
}
}