Ejemplo n.º 1
0
 public King(byte xPosition, byte yPosition)
 {
     UnicodeSymbol   = "♔";
     Name            = "King";
     MoveRules       = MovePattern.OneMoveEveryDirection;
     StartPosition   = new FigurePosition(xPosition, yPosition);
     CurrentPosition = StartPosition;
 }
Ejemplo n.º 2
0
 public Rook(byte xPosition, byte yPosition)
 {
     UnicodeSymbol   = "♖";
     Name            = "Rook";
     StartPosition   = new FigurePosition(xPosition, yPosition);
     CurrentPosition = StartPosition;
     MoveRules       = MovePattern.Horizontal | MovePattern.Vertical;
 }
Ejemplo n.º 3
0
 public Bishop(byte xPosition, byte yPosition)
 {
     UnicodeSymbol   = "♗";
     Name            = "Bishop";
     MoveRules       = MovePattern.FullCross;
     StartPosition   = new FigurePosition(xPosition, yPosition);
     CurrentPosition = StartPosition;
 }
Ejemplo n.º 4
0
 public Queen(byte xPosition, byte yPosition)
 {
     UnicodeSymbol   = "♕";
     Name            = "Queen";
     MoveRules       = MovePattern.OneMoveEveryDirection | MovePattern.FullCross | MovePattern.Horizontal | MovePattern.Vertical;
     StartPosition   = new FigurePosition(xPosition, yPosition);
     CurrentPosition = StartPosition;
 }
Ejemplo n.º 5
0
 public Knight(byte xPosition, byte yPosition)
 {
     UnicodeSymbol   = "♘";
     Name            = "Knight";
     MoveRules       = MovePattern.LPattern;
     StartPosition   = new FigurePosition(xPosition, yPosition);
     CurrentPosition = StartPosition;
 }
Ejemplo n.º 6
0
 public King()
 {
     UnicodeSymbol   = "♔";
     Name            = "King";
     MoveRules       = MovePattern.OneMoveEveryDirection;
     StartPosition   = new FigurePosition(4, 1);
     CurrentPosition = StartPosition;
     IsOnStart       = true;
 }
Ejemplo n.º 7
0
 public Rook()
 {
     UnicodeSymbol   = "♖";
     Name            = "Rook";
     StartPosition   = new FigurePosition(1, 1);
     CurrentPosition = StartPosition;
     MoveRules       = MovePattern.Horizontal | MovePattern.Vertical;
     IsOnStart       = true;
 }
Ejemplo n.º 8
0
 public Bishop()
 {
     UnicodeSymbol   = "♗";
     Name            = "Bishop";
     MoveRules       = MovePattern.FullCross;
     StartPosition   = new FigurePosition(3, 1);
     CurrentPosition = StartPosition;
     IsOnStart       = true;
 }
Ejemplo n.º 9
0
 public Pawn()
 {
     UnicodeSymbol   = "♙";
     Name            = "Pawn";
     MoveRules       = MovePattern.OneForward | MovePattern.TwoForwardOnStart;
     StartPosition   = new FigurePosition(1, 2);
     CurrentPosition = StartPosition;
     IsOnStart       = true;
 }
Ejemplo n.º 10
0
 public Pawn(byte xPosition, byte yPosition)
 {
     UnicodeSymbol   = "♙";
     Name            = "Pawn";
     MoveRules       = MovePattern.OneForward | MovePattern.TwoForwardOnStart;
     StartPosition   = new FigurePosition(xPosition, yPosition);
     CurrentPosition = StartPosition;
     IsOnStart       = CurrentPosition.YPosition == (byte)2;
 }
Ejemplo n.º 11
0
 public Queen()
 {
     UnicodeSymbol   = "♕";
     Name            = "Queen";
     MoveRules       = MovePattern.OneMoveEveryDirection | MovePattern.FullCross | MovePattern.Horizontal | MovePattern.Vertical;
     StartPosition   = new FigurePosition(4, 1);
     CurrentPosition = StartPosition;
     IsOnStart       = true;
 }
Ejemplo n.º 12
0
 public Knight()
 {
     UnicodeSymbol   = "♘";
     Name            = "Knight";
     MoveRules       = MovePattern.LPattern;
     StartPosition   = new FigurePosition(2, 1);
     CurrentPosition = StartPosition;
     IsOnStart       = true;
 }
Ejemplo n.º 13
0
 public virtual void SetPosition(byte xPosition, byte yPosition)
 {
     if (CanMoveTo(xPosition, yPosition))
     {
         CurrentPosition = new FigurePosition(xPosition, yPosition);
         IsOnStart       = false;
     }
     else
     {
         throw new InvalidOperationException($"{GetType().Name} cannot perform move to coordinates X: {xPosition}, Y: {yPosition} from " +
                                             $"X: {CurrentPosition.XPosition}, Y: {CurrentPosition.YPosition}");
     }
 }