Exemple #1
0
        private Vector2Int GetTilesToConnect(List <Tile> board, ConnectionsSetting setting)
        {
            Vector2Int tiles = new Vector2Int(-1, -1);

            tiles.x =
                GetRandomTileInBoard(
                    board,
                    setting.CreationTiles);

            tiles.y =
                GetRandomTileInBoard(
                    board,
                    setting.tilesToMove,
                    tiles.x);
            return(tiles);
        }
Exemple #2
0
        private bool CreateConnection(List <Tile> board, ConnectionsSetting setting)
        {
            Vector2Int tiles = GetTilesToConnect(board, setting);

            if (tiles.x == -1 || tiles.y == -1)
            {
                return(false);
            }
            else
            {
                ConnectTiles(
                    board[tiles.x],
                    board[tiles.y],
                    tiles.y,
                    setting);
            }
            return(true);
        }