Example #1
0
 public PieceView(BoardView boardView, string imgName)
 {
     this.boardView           = boardView;
     img                      = Resource.Load(imgName);
     moveAnim                 = new Animation(Chess.ChessView, speed, true);
     moveAnim.AnimationEvent += MovedEvent;
 }
Example #2
0
        public Chess()
        {
            InitializeComponent();
            ChessView   = board;
            gameManager = new GameManager();

            boardView = new BoardView();
            boardView.PieceMovedStopEvent = PieceMovedStoped;
            boardView.ResetSize(board.Width, board.Height);
        }
Example #3
0
        void ContinueGame(Chessboard recordChessBoard)
        {
            boardView.Destory();
            isPause   = false;
            boardView = new BoardView();
            boardView.PlaceEndEvent       = PlaceEnd;
            boardView.PieceMovedStopEvent = PieceMovedStoped;
            boardView.CreateBoardPieces(recordChessBoard);
            boardView.ResetSize(board.Width, board.Height);

            recordNode = recordNode.Next;
            recordIdx++;
            ChessView.Refresh();
        }
Example #4
0
        void StartGame()
        {
            boardView.Destory();
            recordIdx  = 0;
            isPause    = false;
            recordNode = null;

            gameManager.CreateGame();
            gameManager.Play();

            chessboard = gameManager.orgChessBoard;
            recordMgr  = gameManager.recordMgr;

            boardView = new BoardView();
            boardView.PlaceEndEvent       = PlaceEnd;
            boardView.PieceMovedStopEvent = PieceMovedStoped;
            boardView.CreateBoardPieces(chessboard, 1000);
            boardView.ResetSize(board.Width, board.Height);
            ChessView.Refresh();

            AddRecordToListBox();
        }