Ejemplo n.º 1
0
        public bool CanMove(int x, int y)
        {
            IPlayer currentPlayer = GetCurrentPlayer();
            Coord   nextStep      = currentPlayer.CalculateNextStep(x, y);
            bool    isInGameField = DrawingEngine.IsInGameField(nextStep);

            if (isInGameField)
            {
                bool isFieldFree = IsFieldFree(nextStep);
                if (isFieldFree)
                {
                    return(true);
                }
                else
                {
                    DrawingEngine.ShowMessage("You can't move there! Try again!");
                }
            }
            else
            {
                DrawingEngine.ShowMessage("You can't move outside the field! Try again!");
            }

            return(false);
        }