示例#1
0
        public void MakeMove(Position origin, Position destination)
        {
            Piece p = Tab.RemovePiece(origin);

            p.IncrementNumMovements();
            Piece capturedPiece = Tab.RemovePiece(destination);

            Tab.AddPiece(p, destination);
        }
示例#2
0
        private void AddPieces()
        {
            Tab.AddPiece(new Tower(Tab, Color.White), new PositionChess('c', 1).ToPosition());
            Tab.AddPiece(new Tower(Tab, Color.White), new PositionChess('c', 2).ToPosition());
            Tab.AddPiece(new Tower(Tab, Color.White), new PositionChess('d', 2).ToPosition());
            Tab.AddPiece(new Tower(Tab, Color.White), new PositionChess('e', 2).ToPosition());
            Tab.AddPiece(new Tower(Tab, Color.White), new PositionChess('e', 1).ToPosition());
            Tab.AddPiece(new King(Tab, Color.White), new PositionChess('d', 1).ToPosition());

            Tab.AddPiece(new Tower(Tab, Color.Black), new PositionChess('c', 7).ToPosition());
            Tab.AddPiece(new Tower(Tab, Color.Black), new PositionChess('c', 8).ToPosition());
            Tab.AddPiece(new Tower(Tab, Color.Black), new PositionChess('d', 7).ToPosition());
            Tab.AddPiece(new Tower(Tab, Color.Black), new PositionChess('e', 7).ToPosition());
            Tab.AddPiece(new Tower(Tab, Color.Black), new PositionChess('e', 8).ToPosition());
            Tab.AddPiece(new King(Tab, Color.Black), new PositionChess('d', 8).ToPosition());
        }