Exemplo n.º 1
0
    public void MoveTileToSquare(Tile t, Coordinate coord)
    {
        if (this.tileMap.ContainsKey(t))
        {
            int tileRow = this.tileMap[t].row;
            int tileCol = this.tileMap[t].column;
            foreach (Coordinate co in t.squareInfo.Keys)
            {
                Coordinate      c      = new Coordinate(co.row + tileRow, co.column + tileCol);
                GameBoardSquare square = this.boardMap[c];
                square.RemoveGameCell(t.squareInfo[co]);
            }
        }

        foreach (Coordinate co in t.squareInfo.Keys)
        {
            Coordinate      c      = new Coordinate(coord.row + co.row, coord.column + co.column);
            GameBoardSquare square = this.boardMap[c];
            square.AddGameCell(t.squareInfo[co]);
        }

        this.tileMap[t] = coord;
    }