Documentation
¶
Index ¶
- func CreateEphemeralMaze2D(mazeRooms [][]*GridRoom) (allRoomIds []int, startRoomId int, endRoomId int)
- type GridMaze
- type GridRoom
- func (r *GridRoom) GetConnections() []MazeRoom
- func (r *GridRoom) GetDistanceFromStart() int
- func (r *GridRoom) GetPosition() (int, int, int)
- func (r *GridRoom) GetStep() int
- func (r *GridRoom) IsConnectedTo(room MazeRoom) bool
- func (r *GridRoom) IsDeadEnd() bool
- func (r *GridRoom) IsEnd() bool
- func (r *GridRoom) IsStart() bool
- type Maze
- type Maze2D
- type Maze3D
- type MazeRoom
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GridMaze ¶
type GridMaze struct {
// contains filtered or unexported fields
}
GridMaze implements the Maze interface
func (*GridMaze) Generate2D ¶
func (*GridMaze) GetCriticalPath ¶
type GridRoom ¶
type GridRoom struct {
// contains filtered or unexported fields
}
GridRoom implements the MazeRoom interface
func (*GridRoom) GetConnections ¶
func (*GridRoom) GetDistanceFromStart ¶
func (*GridRoom) IsConnectedTo ¶
type Maze ¶
type Maze interface {
// Generate creates a new maze with the specified dimensions
// Optional seed string can be provided for deterministic generation
// Returns a 2D slice where [x][y] contains a MazeRoom or nil
Generate2D(xMax, yMax int, seed ...string) Maze2D
// GetStart returns the starting room position
GetStart() (int, int)
// GetEnd returns the ending room position
GetEnd() (int, int)
// GetCriticalPath returns the rooms on the critical path from start to end
GetCriticalPath() []MazeRoom
}
Maze represents a 2D maze generator
type MazeRoom ¶
type MazeRoom interface {
// GetPosition returns the x, y, z coordinates of this room
GetPosition() (int, int, int)
// GetConnections returns all rooms this room connects to
GetConnections() []MazeRoom
// IsConnectedTo checks if this room is connected to another room
IsConnectedTo(room MazeRoom) bool
// GetStep returns the step number on the critical path (0 if not on critical path)
GetStep() int
// IsStart returns true if this is the start room
IsStart() bool
// IsEnd returns true if this is the end room
IsEnd() bool
// IsDeadEnd returns true if this room is a dead end (only one connection)
IsDeadEnd() bool
// GetDistanceFromStart returns the number of steps from the start room
GetDistanceFromStart() int
}
MazeRoom represents a single room/space in the maze
Click to show internal directories.
Click to hide internal directories.