Пример #1
0
        public PlayResponse Play(PlayRequest request, IVictoryValidator victoryValidator)
        {
            PlayResponse response = new PlayResponse()
            {
                IsValidMove = false
            };

            if (CanPlay(request))
            {
                request.Board[request.Row, request.Col] = Mark;
                response.Board       = request.Board;
                response.Result      = victoryValidator.Check(request.Board, Mark);
                response.IsValidMove = true;
            }

            return(response);
        }
Пример #2
0
 public bool CanPlay(PlayRequest request) => request.Board[request.Row, request.Col] == MarkType.None;