Exemplo n.º 1
0
        public void Initialise()
        {
            _chessPieceManager = GameManager.instance.chessPieceManager;

            _selectionIcon = GameManager.instance.selectionIcon;

            InitialiseSegments();
            InitialiseChessPieceMoves();
            SetPiecesInitialPositions();


            //Setting variables so theyre not null on first move
            _previousSegmentSelection = GameManager.instance.board.segments[12]; //DELETE???
            _currentSegmentSelection  = GameManager.instance.board.segments[12];
            chessPieceSelection       = _chessPieceManager.pawnsWhite[0];
        }
Exemplo n.º 2
0
    private IEnumerator MakeMove(ChessPieceManager _Pmanager, ChessBoard _Bmanager, GameHistory _gameHistory)
    {
        foreach (PieceMoveData move in _gameHistory.MoveHistory)
        {
            yield return(new WaitForSeconds(2));

            ChessCell targetCell   = _Bmanager.GetChessCellByPosition(move.X, move.Y);
            ChessCell originalCell = _Bmanager.GetChessCellByChessPieceId(move.Id);
            _Pmanager.MovePiece(move.Id, targetCell, originalCell);
        }

        yield return(new WaitForSeconds(2));

        GameEnd.SetMessageComponent("Replay over");
        GameEnd.SetActionMessageType(MessageType.OpenGameMenu);
        GameEnd.Activate();
    }
Exemplo n.º 3
0
 // Use this for initialization
 public virtual void Start()
 {
     ChessPieceManager.RegisterPiece(this.transform.name, this.gameObject);
 }
Exemplo n.º 4
0
 public void Initialize(ChessPieceData _chessPieceData, ChessPieceManager _chessPieceManager)
 {
     ChessPieceData       = _chessPieceData;
     ChessPieceManagerRef = _chessPieceManager;
     SetSprite();
 }