//Constructor with color, location, and a reference to the board public Piece(int all, Point p, Board b, PieceTypeE t) { allegiance = all; loc = p; gameBoard = b; type = t; //Debug.Log ("piece Created " + p.getX() + ", " + p.getY()); }
public virtual void initialize(int all, Point p, Board b, PieceTypeE t) { allegiance = all; loc = p; gameBoard = b; type = t; //Debug.Log("piece Created at (x,y): (" + p.getX() + ", " + p.getY() + ")"); }
/// <summary> /// Initializes pawn as the piece.initialize code is called and then direction is set /// </summary> /// <param name="all">Bit representing the color of the Piece. /// White = 0, Black = 1;</param> /// <param name="p">The location of the piece on the board</param> /// <param name="b">A reference to the game board</param> /// <param name="t">The type of piece being created.</param> override public void initialize(int all, Point p, Board b, PieceTypeE t) { base.initialize(all, p, b, t); if (all == 0) { direction = 1; } else { direction = -1; } }
public Bishop(int all, Point p, Board b, PieceTypeE t) : base(all, p, b, t) { }
/// <summary> /// Constructor that should be used. /// </summary> /// <param name="all">Bit representing the color of the Piece. /// White = 0, Black = 1;</param> /// <param name="p">The location of the piece on the board</param> /// <param name="b">A reference to the game board</param> /// <param name="t">The type of piece being created.</param> public Rook(int all, Point p, Board b, PieceTypeE t) : base(all, p, b, t) { }
/// <summary> /// Constructor that should be used. /// </summary> /// <param name="all">Bit representing the color of the Piece. /// White = 0, Black = 1;</param> /// <param name="p">The location of the piece on the board</param> /// <param name="b">A reference to the game board</param> /// <param name="t">The type of piece being created.</param> public Queen(int all, Point p, Board b, PieceTypeE t) : base(all, p, b, t) { }
/// <summary> /// Constructor that should be used. /// </summary> /// <param name="all">Bit representing the color of the Piece. /// White = 0, Black = 1;</param> /// <param name="p">The location of the piece on the board</param> /// <param name="b">A reference to the game board</param> /// <param name="t">The type of piece being created.</param> public Knight(int all, Point p, Board b, PieceTypeE t) : base(all, p, b, t) { }