Use RefIds for weathers at runtime
Part of #9109 (closed).
- Adds the WeatherStore class that behaves enough like the existing stores to reuse some Lua binding code
- Adds
indexToRefIdandrefIdToIndexfunctions for weathers - Removes use of numeric weather ids at runtime
This'll need some sort of follow up before adding it to the load context because weathers are not like regular records at all. Nonetheless I think this MR is a worthwhile step as is.
Weather records mutate constantly at runtime. Which is why !4866 (merged) could make them writable so easily. This leads to weird behaviour, though, as changes made through Lua will persist until the player restarts the engine or starts a new game (loading a save notably doesn't reset them.) I think I'll want to add a default set of records that can be initialized through the content package which can then be used to reset the weathers used by the engine. I also think it'd be good to perform a reset when loading a save and not just when starting a new game. Technically that'd be a breaking change... but no one can really be relying on this behaviour given that exiting the game after making a save is pretty normal...
Also, it's weird that we destroy and rebuild the weather manager from scratch. Might be worth changing that, but there's so much mutable state that such a change would deserve its own MR.