Example #1
0
    public bool MakeWindowAgainstOtherRoom(Room other)
    {
        if (adjacent_walls[other].Count == 0)
        {
            return(false);
        }
        DirectionalPair to_remove = adjacent_walls[other][Random.Range(0, adjacent_walls[other].Count)];

        this.walls.Remove(to_remove.first);
        other.walls.Remove(to_remove.second);
        this.windows.Add(to_remove.first);
        other.windows.Add(to_remove.second);
        return(true);
    }
Example #2
0
    public bool MakeEntranceAgainstOtherRoom(Room other)
    {
        if (adjacent_walls[other].Count == 0)
        {
            return(false);
        }
        Direction       remove_dir = adjacent_walls[other][Random.Range(0, adjacent_walls[other].Count)].first.direction;
        DirectionalPair to_remove  = CenterWall(adjacent_walls[other], remove_dir);

        this.walls.Remove(to_remove.first);
        other.walls.Remove(to_remove.second);
        this.entrances.Add(to_remove.first);
        other.entrances.Add(to_remove.second);
        return(true);
    }