Exemplo 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);
        }
Exemplo 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);
            }
        }
Exemplo 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);
 }
Exemplo 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;
Exemplo n.º 5
0
 public void ChangePlayer()
 {
     NowPlayer   = Util.EnemyColor(NowPlayer);
     SkipCounter = 0;
 }