internal Figure(FigureColor color, FigureType type, Position position) { this.color = color; this.type = type; this.position = position; CalculateValidMoves(position); }
public Player(string name, FigureColor color, State playerState) { this.validator = new Validator(); this.Name = name; this.Color = color; this.figures = this.GetStarGameFifures(); this.takenFigures = new List<IFigure>(); this.PlayerState = playerState; }
public Pawn(FigureColor color) : base(color) { diff = true; NeighborsFigures = new Figure[2]; NeighborsFigures[0] = null; NeighborsFigures[1] = null; LoadBitmap("pawn"); }
public FigureChoiceWindow(Point startPosition, FigureColor clr) { InitializeComponent(); this.Size = new System.Drawing.Size(2 * sqSize, 2 * sqSize); this.Location = startPosition; arr = new Figure[4]; arr[0] = new Queen(clr); arr[1] = new Rock(clr); arr[2] = new Knight(clr); arr[3] = new Bishop(clr); }
internal Bishop(FigureColor color, FigureType type, Position position) : base(color, type, position) { switch (color) { case FigureColor.Black: draw = "\u265D"; break; case FigureColor.White: draw = "\u2657"; break; } }
internal Knight(FigureColor color, FigureType type, Position position) : base(color, type, position) { switch (color) { case FigureColor.Black: draw = "\u265E"; break; case FigureColor.White: draw = "\u2658"; break; } }
public void ValidateMove(IFigure figure, IBoard board, Move move) { this.startRow = figure.Color == FigureColor.White ? board.Size - 2 : 1; this.oppositeColor = figure.Color == FigureColor.White ? FigureColor.Black : FigureColor.White; this.direction = (figure.Color == FigureColor.White) ? -1 : 1; if (!this.ValidPLayerMoves(move, board)) { throw new InvalidOperationException(string.Format(GlobalConstants.ExceptionMessege, figure.Type)); } base.ValidateMove(figure, board, move); }
private bool CheckCaslte(IFigure figure, IBoard board, Move move, FigureColor color, int row, int col, int startCheck, int endCheck) { if (figure.Color == color && move.To.Row == row && move.To.Col == col) { var rook = board.SeeFigureOnPosition(row, 0); if (rook.Color == color && rook.IsFirstMove && figure.IsFirstMove) { for (int i = startCheck; i < endCheck; i++) { if (board.SeeFigureOnPosition(row, i) != null) { return false; } } return true; } } return false; }
public Officer(FigureColor color) : base(color, FigureType.Officer) { }
public Queen(FigureColor color) : base(color, FigureType.Queen) { }
public Bishop(FigureColor color) : base(color, FigureType.Bishop) { }
public Queen(int x, int y, FigureColor color) : base(x, y, color) { }
public Bishop(int x, int y, FigureColor color) : base(x, y, color) { }
public Bishop(FigureColor _color, char symbol) : base(_color, symbol) { }
public Rook(FigureColor color) : base(color, FigureType.Rook) { }
public Knight(FigureColor _color, char symbol) : base(_color, symbol) { }
/// <summary> /// Конструктор слона. /// </summary> /// <param name="boardState">Доска, на которой будет находиться конь.</param> public Bishop(int x, int y, FigureColor color, BoardState boardState) : base(x, y, color, boardState) { }
public static FigureColor IsOppositeColor(FigureColor curColor) { return(curColor == FigureColor.BLACK ? FigureColor.WHITE : FigureColor.BLACK); }
public Pawn(FigureColor color) : base(color, FigureType.Pawn) { }
public Figure(FigureColor color, FigureType type) { this.color = color; this.type = type; }
public King(int x, int y, FigureColor color) : base(x, y, color) { }
//add change figure public void Add_ChangeFigure(Position pos, Figure figure, FigureColor color) { string command = NetworkDef.CHANGE + ' ' + pos.X + ' ' + pos.Y + ' ' + figure.ToString(); lock (outCommands) { outCommands.Enqueue(command); } }
public BoardTobit(BoardTobit boardMover) : this() { CurrentPlayer = (boardMover.CurrentPlayer == FigureColor.WHITE) ? FigureColor.BLACK : FigureColor.WHITE; CopyBoard(boardMover, board); }
public Pawn(FigureColor _color, char symbol) : base(_color , symbol) { }
public bool IsMate(FigureColor color) { var possible = Enumerable.Range(0, 8).SelectMany(x => Enumerable.Range(0, 8).Select(y => this.Board[x, y]).Where(f => f != null && f.Color == color)) .SelectMany(f => f.GetPossibleMoves()).ToArray(); return possible.Count() == 0; }
public Figure(int x, int y, FigureColor color) { this.Coordinate[0] = x; this.Coordinate[1] = y; this.color = color; }
internal Knight(IGameInternal game, Point point, FigureColor color) { base.Init(point, color, game); }
public Knight(int x, int y, FigureColor color) : base(x, y, color) { }
public Horse(FigureColor color) : base(color, FigureType.Horse) { }
public Pawn(int x, int y, FigureColor color) : base(x, y, color) { }
public Castle(FigureColor color) : base(color, FigureType.Castle) { }
public Rook(int x, int y, FigureColor color) : base(x, y, color) { }
public King(FigureColor color) : base(color, FigureType.King) { }
public Queen(FigureColor _color, char symbol) : base(_color, symbol) { }
public Bishop(FigureColor Color) : base(Color) { }