Ejemplo n.º 1
0
    // Use this for initialization
    protected virtual void Start()
    {
        legalMovesForAPiece = new List <Vector2>();
        gameState           = new GameState(ChessGlobals.GameState.WHITE_TURN);

        //Initialize Model
        board = new Board();

        //Initialize Movement Model
        moveModel      = gameObject.AddComponent <MoveModel> ();
        capturedPieces = new List <Piece> ();

        //Initialize View
        //drawBoard.InitBoard();
        var startingPositions = drawPiece.InitPieces();

        for (int i = 0; i < startingPositions.t1.Count; ++i)
        {
            Piece blackPiece = CreatePieceAt(startingPositions.t1[i].t1, startingPositions.t1[i].t2, ChessGlobals.Teams.BLACK_TEAM);
            Piece whitePiece = CreatePieceAt(startingPositions.t2[i].t1, startingPositions.t2[i].t2, ChessGlobals.Teams.WHITE_TEAM);

            board.Mark(blackPiece.GetPiecePosition(), blackPiece);
            board.Mark(whitePiece.GetPiecePosition(), whitePiece);

            board.AddActivePiece(whitePiece);
            board.AddActivePiece(blackPiece);
        }
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        drawPiece = GameObject.Find("Draw Pieces").GetComponent <NetworkDrawPiece>();

        var startingPositions = drawPiece.NetworkInitPieces();

        for (int i = 0; i < startingPositions.t1.Count; ++i)
        {
            Piece blackPiece = CreatePieceAt(startingPositions.t1[i].t1, startingPositions.t1[i].t2, ChessGlobals.Teams.BLACK_TEAM);
            Piece whitePiece = CreatePieceAt(startingPositions.t2[i].t1, startingPositions.t2[i].t2, ChessGlobals.Teams.WHITE_TEAM);

            board.Mark(blackPiece.GetPiecePosition(), blackPiece);
            board.Mark(whitePiece.GetPiecePosition(), whitePiece);

            board.AddActivePiece(whitePiece);
            board.AddActivePiece(blackPiece);
        }
    }