The map generator must be able to update existing maps to add support for new features so that the world never has to be wiped and regenerated from scratch.
When the map generator runs it should look at every map for its version. If the version is behind the current version of the map generator, it will run an update routine to add any necessary enhancements to that map and update the version number to current so the map won't be updated a second time.
The primary assumption here is that maps will always be either the current version or one version behind, and never older than that.
Add an incrementing integer version field to GameMap.
Add an update method to the map generator that iterates through maps and checks their version.
Add an empty method that applies the update to a map, to be filled in when necessary.
The map generator must be able to update existing maps to add support for new features so that the world never has to be wiped and regenerated from scratch.
When the map generator runs it should look at every map for its version. If the version is behind the current version of the map generator, it will run an update routine to add any necessary enhancements to that map and update the version number to current so the map won't be updated a second time.
The primary assumption here is that maps will always be either the current version or one version behind, and never older than that.
GameMap
.