UNPKG

wonder.js

Version:
33 lines (27 loc) 1.08 kB
'use strict'; var Caml_array = require("bs-platform/lib/js/caml_array.js"); var MutableSparseMapService$WonderCommonlib = require("wonder-commonlib/lib/js/src/MutableSparseMapService.js"); function getIsRoot(uid, state) { var gameObjectRecord = state[/* gameObjectRecord */10]; return MutableSparseMapService$WonderCommonlib.get(uid, gameObjectRecord[/* isRootMap */2]); } function unsafeGetIsRoot(uid, state) { var match = getIsRoot(uid, state); if (match !== undefined) { return match; } else { return false; } } function setIsRoot(uid, isRoot, state) { var gameObjectRecord = state[/* gameObjectRecord */10]; var newrecord = Caml_array.caml_array_dup(state); var newrecord$1 = Caml_array.caml_array_dup(gameObjectRecord); newrecord$1[/* isRootMap */2] = MutableSparseMapService$WonderCommonlib.set(uid, isRoot, gameObjectRecord[/* isRootMap */2]); newrecord[/* gameObjectRecord */10] = newrecord$1; return newrecord; } exports.getIsRoot = getIsRoot; exports.unsafeGetIsRoot = unsafeGetIsRoot; exports.setIsRoot = setIsRoot; /* No side effect */