feat: Cards writings and balancing (M8)
This commit is contained in:
@@ -43,7 +43,10 @@ export function encodeSave(state) {
|
||||
|
||||
// Upgrades older saves one version at a time. Add an entry here whenever STATE_VERSION
|
||||
// changes: MIGRATIONS[n] turns a version n state into a version n+1 state.
|
||||
export const MIGRATIONS = {};
|
||||
export const MIGRATIONS = {
|
||||
// v2 added the world cycle: older saves start it at neutral.
|
||||
1: (s) => ({ ...s, version: 2, world: { cycle: 0 } }),
|
||||
};
|
||||
|
||||
export function migrate(state) {
|
||||
if (!Number.isInteger(state?.version)) return { ok: false, error: "format" };
|
||||
|
||||
Reference in New Issue
Block a user