internal DoublePushInfo(GameSide side) { side.EnsureDefined(); bool isWhite; switch (side) { case GameSide.White: isWhite = true; break; case GameSide.Black: isWhite = false; break; default: throw side.CreateEnumValueNotSupportedException(); } Side = side; StartRank = isWhite ? 1 : ChessConstants.RankCount - 2; EndRank = StartRank + (isWhite ? Difference : -Difference); CaptureTargetRank = (StartRank + EndRank) / 2; }
/// <summary> /// Initializes a new instance of the <see cref="ChessPlayerBase"/> class. /// </summary> protected ChessPlayerBase(GameSide side) { Side = side.EnsureDefined(); }