Esempio n. 1
0
        public void SetStone(int x, int y, classes.Player player)
        {
            if (Board.IsAlreadlySet(x, y))
            {
                throw new OverrideStoneException("すでに石が置かれています");
            }
            if (!Board.IsReversiAllDirection(x, y, player))
            {
                throw new DisableStone("その場所に駒を置くことはできません");
            }
            var nowColor = player;

            Board.SetColor(x, y, nowColor);
            Board.ReversiAllDirection(x, y, player);
        }
Esempio n. 2
0
        public static classes.Player EnemyColor(classes.Player player)
        {
            switch (player)
            {
            case classes.Player.Black:
                return(classes.Player.White);

            case classes.Player.White:
                return(classes.Player.Black);

            case classes.Player.None:
                return(classes.Player.None);

            default:
                throw new ArgumentOutOfRangeException(nameof(player), player, null);
            }
        }
Esempio n. 3
0
 public bool IsContinue(classes.Player player)
 {
     if (Board.CountWhiteColor() == 0)
     {
         return(false);
     }
     if (Board.CountBlackColor() == 0)
     {
         return(false);
     }
     if (Board.CountNoneColor() == 0)
     {
         return(false);
     }
     if (Board.GetEnableColorPointList(player).Count == 0)
     {
         return(false);
     }
     return(true);
 }
Esempio n. 4
0
 public Tuple <int, int> GetShouldSetPoint(classes.Player player)
 => BoardData.GetEnableColorPointList(player)
 .Select(colorpoint => new ColorData(colorpoint, GetEvaluationValue(colorpoint)))
 .FindMax(c => c.Score).Point;
Esempio n. 5
0
 public void ChangePlayer()
 {
     NowPlayer   = Util.EnemyColor(NowPlayer);
     SkipCounter = 0;
 }