Ejemplo n.º 1
0
        public void recordMove(int posXtoMove, int posYtoMove)
        {
            MoveRecord moveRecord = new MoveRecord(gameManager.cureentSelect.posX, gameManager.cureentSelect.posY,
                                                   posXtoMove, posYtoMove,
                                                   boardScript.chessBoardString[gameManager.cureentSelect.posX, gameManager.cureentSelect.posY],
                                                   boardScript.chessBoardString[posXtoMove, posYtoMove], gameManager.cureentSelect.firstMove);

            moveRecordList.Add(moveRecord);
            //moveRecordList.Add(new MoveRecord(gameManager.cureentSelect.posX, gameManager.cureentSelect.posY,posXtoMove, posYtoMove,
            //    chessBoardString[gameManager.cureentSelect.posX,gameManager.cureentSelect.posY],chessBoardString[posXtoMove,posYtoMove], gameManager.cureentSelect.firstMove));
        }
Ejemplo n.º 2
0
        public static void undoMove(BoardScript boardScript, GameManager gameManager)
        {
            MoveRecord moveRecord = boardScript.moveRecorder.getLastRecord();

            //moveFigueOnBoard
            gameManager.cureentSelect = gameManager.getFigureOnPosition(moveRecord.toX, moveRecord.toY);
            MoveFigure(moveRecord.fromX, moveRecord.fromY, boardScript, gameManager);
            gameManager.cureentSelect.firstMove = moveRecord.firstMove;
            //CreateFigureIfBeaten
            if (moveRecord.moveTo != " ")
            {
                boardScript.chessBoardString[moveRecord.toX, moveRecord.toY] = moveRecord.moveTo;
                boardScript.figurePlacer.figreSet(moveRecord.toX, moveRecord.toY, moveRecord.firstMove, boardScript.chessBoardString);
            }
            boardScript.moveRecorder.deleteLastRecord();
        }
Ejemplo n.º 3
0
 public void UpdateMoveTracker(MoveRecord moveRecord)
 {
     MoveToTile.transform.position   = new Vector3(moveRecord.toX, moveRecord.toY);
     MoveFromTile.transform.position = new Vector3(moveRecord.fromX, moveRecord.fromY);
 }