wonder.js
Version:
43 lines (37 loc) • 1.93 kB
JavaScript
;
var Caml_array = require("bs-platform/lib/js/caml_array.js");
var ArrayService$WonderCommonlib = require("wonder-commonlib/lib/js/src/ArrayService.js");
var MutableSparseMapService$WonderCommonlib = require("wonder-commonlib/lib/js/src/MutableSparseMapService.js");
var ImmutableSparseMapService$WonderCommonlib = require("wonder-commonlib/lib/js/src/ImmutableSparseMapService.js");
function getRecord(param) {
return param[/* scriptRecord */27];
}
function create(param) {
return /* record */[
/* index */0,
/* isScriptEventFunctionEnable */true,
/* disposedIndexArray */ArrayService$WonderCommonlib.createEmpty(/* () */0),
/* gameObjectMap */MutableSparseMapService$WonderCommonlib.createEmpty(/* () */0),
/* isActiveMap */MutableSparseMapService$WonderCommonlib.createEmpty(/* () */0),
/* scriptEventFunctionDataMap */ImmutableSparseMapService$WonderCommonlib.createEmpty(/* () */0),
/* scriptAttributeMap */ImmutableSparseMapService$WonderCommonlib.createEmpty(/* () */0)
];
}
function deepCopyForRestore(state) {
var record = getRecord(state);
var newrecord = Caml_array.caml_array_dup(state);
newrecord[/* scriptRecord */27] = /* record */[
/* index */record[/* index */0],
/* isScriptEventFunctionEnable */record[/* isScriptEventFunctionEnable */1],
/* disposedIndexArray */record[/* disposedIndexArray */2].slice(),
/* gameObjectMap */MutableSparseMapService$WonderCommonlib.copy(record[/* gameObjectMap */3]),
/* isActiveMap */MutableSparseMapService$WonderCommonlib.copy(record[/* isActiveMap */4]),
/* scriptEventFunctionDataMap */record[/* scriptEventFunctionDataMap */5],
/* scriptAttributeMap */record[/* scriptAttributeMap */6]
];
return newrecord;
}
exports.getRecord = getRecord;
exports.create = create;
exports.deepCopyForRestore = deepCopyForRestore;
/* No side effect */