コード例 #1
0
ファイル: Figure.cs プロジェクト: quoctrong288/BananaChess
 protected Figure(TypeOfFigures type, ColorsOfFigures color)
 {
     figureType  = type;
     figureColor = color;
     onTable     = true;
     imBlocked   = false; //initialize this to avoid errors due the weird case of somebody reading this property unitialized O.o
 }
コード例 #2
0
        /*internal bool checkForEndOfGame()
         * {
         *
         * }*/

        internal static void promoteTo(int x, int y, TypeOfFigures destType)
        {
            switch (destType)
            {
            case TypeOfFigures.Queen:
                ChessBoard.Cells[x, y].MyFigure = new Queen(ChessBoard.Cells[x, y].MyFigure.Color);
                break;

            case TypeOfFigures.Rook:
                ChessBoard.Cells[x, y].MyFigure = new Rook(ChessBoard.Cells[x, y].MyFigure.Color);
                break;

            case TypeOfFigures.Knight:
                ChessBoard.Cells[x, y].MyFigure = new Knight(ChessBoard.Cells[x, y].MyFigure.Color);
                break;

            case TypeOfFigures.Bishop:
                ChessBoard.Cells[x, y].MyFigure = new Bishop(ChessBoard.Cells[x, y].MyFigure.Color);
                break;
            }

            ChessBoard.Cells[x, y].MyFigure.PositionX = x;
            ChessBoard.Cells[x, y].MyFigure.PositionY = y;
            ChessBoard.resetAllPoss();
            ChessBoard.Cells[x, y].MyFigure.getPossibleCells(ChessBoard.PossMoves);
        }
コード例 #3
0
 internal FigureRokade(TypeOfFigures type, ColorsOfFigures color, int[] dirArr, int range) :
     base(type, color, dirArr, range)
 {
 }
コード例 #4
0
 protected AbsMovesFigure(TypeOfFigures type, ColorsOfFigures color) : base(type, color)
 {
 }
コード例 #5
0
 protected MovingFigure(TypeOfFigures type, ColorsOfFigures color, int[] dir, int range) : base(type, color)
 {
     directions = dir;
     this.range = range;
 }