Esempio n. 1
0
        void CreatePassage(RoomConnection connection, int tunnelingRadius)
        {
            tunnelingRadius = Mathf.Max(tunnelingRadius, 1);
            List <Coord> line = connection.tileA.CreateLineTo(connection.tileB);

            foreach (Coord coord in line)
            {
                ClearNeighbors(map, coord, tunnelingRadius);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Generate a RoomConnection object between every two rooms in the map, where the connection stores information
        /// about the shortest distance between the two rooms and the tiles corresponding to this distance.
        /// </summary>
        /// <param name="rooms">All rooms in the Map.</param>
        /// <returns>A list of every connection between rooms in the map.</returns>
        List <RoomConnection> ComputeRoomConnections(List <Room> rooms)
        {
            List <RoomConnection> connections = new List <RoomConnection>();

            for (int i = 0; i < rooms.Count; i++)
            {
                for (int j = i + 1; j < rooms.Count; j++)
                {
                    RoomConnection connection = new RoomConnection(rooms[i], rooms[j], i, j);
                    connections.Add(connection);
                    connection.FindShortConnection();
                }
            }
            return(connections);
        }