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); }
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); } }
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); }
public Tuple <int, int> GetShouldSetPoint(classes.Player player) => BoardData.GetEnableColorPointList(player) .Select(colorpoint => new ColorData(colorpoint, GetEvaluationValue(colorpoint))) .FindMax(c => c.Score).Point;
public void ChangePlayer() { NowPlayer = Util.EnemyColor(NowPlayer); SkipCounter = 0; }