diff --git a/01_the_screen/map.go b/01_the_screen/map.go index fd7811e..89d5db9 100644 --- a/01_the_screen/map.go +++ b/01_the_screen/map.go @@ -13,18 +13,6 @@ func compass(near Position, offset int) []Position { } } -func (game *Game) CloneMap() Map { - // this is a shallow copy though - new_map := slices.Clone(game.Level) - - for i, row := range new_map { - // this makes sure the row is an actual copy - new_map[i] = slices.Clone(row) - } - - return new_map -} - func (game *Game) Inbounds(pos Position, offset int) bool { return pos.X >= offset && pos.X < game.Width - offset && diff --git a/02_mazes_and_enemies/map.go b/02_mazes_and_enemies/map.go index a98a02f..db244e6 100644 --- a/02_mazes_and_enemies/map.go +++ b/02_mazes_and_enemies/map.go @@ -13,18 +13,6 @@ func compass(near Position, offset int) []Position { } } -func (game *Game) CloneMap() Map { - // this is a shallow copy though - new_map := slices.Clone(game.Level) - - for i, row := range new_map { - // this makes sure the row is an actual copy - new_map[i] = slices.Clone(row) - } - - return new_map -} - func (game *Game) Inbounds(pos Position, offset int) bool { return pos.X >= offset && pos.X < game.Width - offset &&