Reader -> Reader+Parser refactoring: COMPLETE

Added a string reader too so that one can create a maze just with a slice of stings and RawMaze now has chunks of bytes to limit memory usage with big mazes (hopefully)
This commit is contained in:
Karma Riuk
2023-08-05 16:18:03 +02:00
parent e2b0b09636
commit fa4c13812d
7 changed files with 414 additions and 239 deletions

View File

@ -17,11 +17,13 @@ func (r TextReader) Read() (*maze.RawMaze, error) {
return nil, err
}
return &maze.RawMaze{
strings_reader := StringsReader{
PathChar: r.PathChar,
WallChar: r.WallChar,
Data: *lines,
}, nil
Lines: lines,
}
return strings_reader.Read()
}
func getLines(filename string) (*[]string, error) {