protected override void Initialize() { MatchTime = TimeSpan.Zero; TurnTime = TimeSpan.Zero; Board = new Board(); TurnCount = new Dictionary <ControllingUnit, int>(); TurnCount.Add(ControllingUnit.Human, 0); TurnCount.Add(ControllingUnit.AI, 0); MoveManager = new MoveManager(Board); ChangeTurn(ControllingUnit.Human); }
public void ChangeTurn(ControllingUnit controllingUnit) { if (CurrentController == controllingUnit) { Log.Warning(string.Format("'{0}' is already the current controller", controllingUnit)); return; } TurnCount[controllingUnit]++; MoveManager.OnTurnEnd(CurrentController); CurrentController = controllingUnit; TurnTime = TimeSpan.Zero; MoveManager.OnTurnBegin(controllingUnit); }