001package squidpony.squidgrid.mapping.styled;
002
003import squidpony.tileset.*;
004
005/**
006 * An enumeration of all the kinds of dungeon that DungeonGen
007 * knows how to draw already. Each value has a Javadoc description.
008 * Created by Tommy Ettinger on 3/10/2015.
009 */
010public enum TilesetType {
011    /**
012     * A generally useful kind of dungeon for ruins or underground manufactured areas.
013     */
014    DEFAULT_DUNGEON,
015    /**
016     * A good general kind of cave, with long distances between merging paths.
017     */
018    CAVES_LIMIT_CONNECTIVITY,
019    /**
020     * Only usable if using Chebyshev distances; many connections are diagonal-only.
021     */
022    CAVES_TINY_CORRIDORS,
023    /**
024     * Most parts of the cave are large and open, but tiny corridors link them, providing hiding places.
025     */
026    CORNER_CAVES,
027    /**
028     * Very basic demo dungeon.
029     */
030    HORIZONTAL_CORRIDORS_A,
031    /**
032     * Slightly less basic demo dungeon.
033     */
034    HORIZONTAL_CORRIDORS_B,
035    /**
036     * A bit more complexity in this demo dungeon.
037     */
038    HORIZONTAL_CORRIDORS_C,
039    /**
040     * A reference implementation of where you can place walls; mostly floor.
041     */
042    LIMIT_CONNECTIVITY_FAT,
043    /**
044     * A reference implementation of where you can place walls; mostly wall.
045     */
046    LIMITED_CONNECTIVITY,
047    /**
048     * A generally good maze; MAZE_A and MAZE_B should both be interchangeable, but not on the same map.
049     */
050    MAZE_A,
051    /**
052     * A generally good maze; MAZE_A and MAZE_B should both be interchangeable, but not on the same map.
053     */
054    MAZE_B,
055    /**
056     * A map that's less dungeon-like than the others, with lots of open space.
057     */
058    OPEN_AREAS,
059    /**
060     * An excellent natural cave style that looks worn down haphazardly, as by burrowing creatures or deep rivers.
061     */
062    REFERENCE_CAVES,
063    /**
064     * Mostly open, kinda weird.
065     */
066    ROOMS_AND_CORRIDORS_A,
067    /**
068     * Mostly open, but with long corridors that should be a good fit for ranged combat.
069     */
070    ROOMS_AND_CORRIDORS_B,
071    /**
072     * A nice old-school roguelike map, with thin corridors and rectangular rooms.
073     */
074    ROOMS_LIMIT_CONNECTIVITY,
075    /**
076     * A thing of beauty. Good for maps that need to seem otherworldly or unusual, like heavenly planes.
077     */
078    ROUND_ROOMS_DIAGONAL_CORRIDORS,
079    /**
080     * A more open cave, but portions of this may seem artificial. Consider alternating with REFERENCE_CAVES .
081     */
082    SIMPLE_CAVES,
083    /**
084     * Kinda... not the best map. Very predictable.
085     */
086    SQUARE_ROOMS_WITH_RANDOM_RECTS;
087
088        /**
089         * @return The {@link Tileset} corresponding to this type.
090         */
091        public Tileset getTileset() {
092                switch (this) {
093                case CAVES_LIMIT_CONNECTIVITY:
094                        return CavesLimitConnectivity.INSTANCE;
095                case CAVES_TINY_CORRIDORS:
096                        return CavesTinyCorridors.INSTANCE;
097                case CORNER_CAVES:
098                        return CornerCaves.INSTANCE;
099                case DEFAULT_DUNGEON:
100                        return DefaultDungeon.INSTANCE;
101                case HORIZONTAL_CORRIDORS_A:
102                        return HorizontalCorridorsV1.INSTANCE;
103                case HORIZONTAL_CORRIDORS_B:
104                        return HorizontalCorridorsV2.INSTANCE;
105                case HORIZONTAL_CORRIDORS_C:
106                        return HorizontalCorridorsV3.INSTANCE;
107                case LIMITED_CONNECTIVITY:
108                        return LimitedConnectivity.INSTANCE;
109                case LIMIT_CONNECTIVITY_FAT:
110                        return LimitConnectivityFat.INSTANCE;
111                case MAZE_A:
112                        return Maze2Wide.INSTANCE;
113                case MAZE_B:
114                        return MazePlus2Wide.INSTANCE;
115                case OPEN_AREAS:
116                        return OpenAreas.INSTANCE;
117                case REFERENCE_CAVES:
118                        return OpenAreas.INSTANCE;
119                case ROOMS_AND_CORRIDORS_A:
120                        return RoomsAndCorridors.INSTANCE;
121                case ROOMS_AND_CORRIDORS_B:
122                        return RoomsAndCorridors2WideDiagonalBias.INSTANCE;
123                case ROOMS_LIMIT_CONNECTIVITY:
124                        return RoomsLimitConnectivity.INSTANCE;
125                case ROUND_ROOMS_DIAGONAL_CORRIDORS:
126                        return RoundRoomsDiagonalCorridors.INSTANCE;
127                case SIMPLE_CAVES:
128                        return SimpleCaves2Wide.INSTANCE;
129                case SQUARE_ROOMS_WITH_RANDOM_RECTS:
130                        return SquareRoomsWithRandomRects.INSTANCE;
131                }
132                throw new IllegalStateException("Unmatched: " + this);
133        }
134
135    /**
136     * Returns MixedGenerator.CAVE_FLOOR (which is 3) or MixedGenerator.ROOM_FLOOR (which is 1) based on whether this
137     * TilesetType predominantly generates caves or rooms. This is relevant for certain feature placement.
138     * @return 3 if this produces mostly caves, or 1 if it produces mostly rooms
139     */
140        public int environment() {
141        int caves = 3, rooms = 1;
142        switch (this) {
143            case CAVES_LIMIT_CONNECTIVITY:
144                return caves;
145            case CAVES_TINY_CORRIDORS:
146                return caves;
147            case CORNER_CAVES:
148                return caves;
149            case DEFAULT_DUNGEON:
150                return rooms;
151            case HORIZONTAL_CORRIDORS_A:
152                return rooms;
153            case HORIZONTAL_CORRIDORS_B:
154                return rooms;
155            case HORIZONTAL_CORRIDORS_C:
156                return rooms;
157            case LIMITED_CONNECTIVITY:
158                return rooms;
159            case LIMIT_CONNECTIVITY_FAT:
160                return rooms;
161            case MAZE_A:
162                return rooms;
163            case MAZE_B:
164                return rooms;
165            case OPEN_AREAS:
166                return caves;
167            case REFERENCE_CAVES:
168                return caves;
169            case ROOMS_AND_CORRIDORS_A:
170                return rooms;
171            case ROOMS_AND_CORRIDORS_B:
172                return rooms;
173            case ROOMS_LIMIT_CONNECTIVITY:
174                return rooms;
175            case ROUND_ROOMS_DIAGONAL_CORRIDORS:
176                return rooms;
177            case SIMPLE_CAVES:
178                return caves;
179            case SQUARE_ROOMS_WITH_RANDOM_RECTS:
180                return rooms;
181        }
182        throw new IllegalStateException("Unmatched: " + this);
183
184
185    }
186}
187