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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user