mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Refactor pinned shapes and make them smart, closes #72
This commit is contained in:
28
src/js/savegame/schemas/1003.js
Normal file
28
src/js/savegame/schemas/1003.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import { createLogger } from "../../core/logging.js";
|
||||
import { SavegameInterface_V1002 } from "./1002.js";
|
||||
|
||||
const schema = require("./1003.json");
|
||||
const logger = createLogger("savegame_interface/1003");
|
||||
|
||||
export class SavegameInterface_V1003 extends SavegameInterface_V1002 {
|
||||
getVersion() {
|
||||
return 1003;
|
||||
}
|
||||
|
||||
getSchemaUncached() {
|
||||
return schema;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../savegame_typedefs.js").SavegameData} data
|
||||
*/
|
||||
static migrate1002to1003(data) {
|
||||
logger.log("Migrating 1002 to 1003");
|
||||
const dump = data.dump;
|
||||
if (!dump) {
|
||||
return true;
|
||||
}
|
||||
|
||||
dump.pinnedShapes = { shapes: [] };
|
||||
}
|
||||
}
|
||||
5
src/js/savegame/schemas/1003.json
Normal file
5
src/js/savegame/schemas/1003.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"type": "object",
|
||||
"required": [],
|
||||
"additionalProperties": true
|
||||
}
|
||||
Reference in New Issue
Block a user