Example #1
0
        public void UpdateClock(TimeSpan delta)
        {
            ClockManager.SubTractTime(delta);
            ChessClock clock = ClockManager.GetCurrentClock();

            System.Diagnostics.Debug.WriteLine(string.Format("{0}:{1}:{2}", clock.Time.Hours, clock.Time.Minutes, clock.Time.Seconds));
        }
Example #2
0
 public TurnManager(Player whiteplayer, Player blackplayer, ClockManager clockManager, ChessBoard board)
 {
     turns            = new List <Turn>();
     Turns            = turns.AsReadOnly();
     ClockManager     = clockManager;
     WhitePlayer      = whiteplayer;
     BlackPlayer      = blackplayer;
     Board            = board;
     EnPassantManager = new EnPassantManager(board);
 }
Example #3
0
 public ChessMatch(ChessBoard board, Player whiteplayer, Player blackplayer)
 {
     Board        = board;
     WhitePlayer  = whiteplayer;
     BlackPlayer  = blackplayer;
     ClockManager = new ClockManager(CreateClocks(new TimeSpan(0, 5, 0)), new TimeSpan(0, 0, 5));
     TurnManager  = new TurnManager(whiteplayer, blackplayer, ClockManager, board);
     Started      = false;
     Ended        = false;
 }
Example #4
0
 public void Start()
 {
     Started            = true;
     PartialTurnTracker = new PartialTurnTracker(WhitePlayer, ClockManager.GetCurrentClock(), Board.CurrentState);
 }