wonder.js
Version:
89 lines (77 loc) • 6.22 kB
JavaScript
'use strict';
var Caml_array = require("bs-platform/lib/js/caml_array.js");
var Contract$WonderLog = require("wonder-log/lib/js/src/Contract.js");
var StateDataMain$Wonderjs = require("../../service/state/main/data/StateDataMain.js");
var IsDebugMainService$Wonderjs = require("../../service/state/main/state/IsDebugMainService.js");
var MaxCountLightService$Wonderjs = require("../../service/record/main/light/MaxCountLightService.js");
var AliveComponentService$Wonderjs = require("../../service/primitive/component/AliveComponentService.js");
var BufferDirectionLightService$Wonderjs = require("../../service/record/main/light/direction/BufferDirectionLightService.js");
var DisposeDirectionLightService$Wonderjs = require("../../service/record/main/light/direction/DisposeDirectionLightService.js");
var OperateDirectionLightService$Wonderjs = require("../../service/record/main/light/direction/OperateDirectionLightService.js");
var CreateDirectionLightMainService$Wonderjs = require("../../service/state/main/light/direction/CreateDirectionLightMainService.js");
var GameObjectDirectionLightService$Wonderjs = require("../../service/record/main/light/direction/GameObjectDirectionLightService.js");
var RecordDirectionLightMainService$Wonderjs = require("../../service/state/main/light/direction/RecordDirectionLightMainService.js");
function createDirectionLight(state) {
return CreateDirectionLightMainService$Wonderjs.create(true, state);
}
function unsafeGetDirectionLightGameObject(light, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposeDirectionLightService$Wonderjs.isAlive, RecordDirectionLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return GameObjectDirectionLightService$Wonderjs.unsafeGetGameObject(light, RecordDirectionLightMainService$Wonderjs.getRecord(state));
}
function getDirectionLightColor(light, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposeDirectionLightService$Wonderjs.isAlive, RecordDirectionLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateDirectionLightService$Wonderjs.getColor(light, RecordDirectionLightMainService$Wonderjs.getRecord(state));
}
function setDirectionLightColor(light, color, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposeDirectionLightService$Wonderjs.isAlive, RecordDirectionLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
var newrecord = Caml_array.caml_array_dup(state);
newrecord[/* directionLightRecord */21] = OperateDirectionLightService$Wonderjs.setColor(light, color, RecordDirectionLightMainService$Wonderjs.getRecord(state));
return newrecord;
}
function getDirectionLightIntensity(light, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposeDirectionLightService$Wonderjs.isAlive, RecordDirectionLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateDirectionLightService$Wonderjs.getIntensity(light, RecordDirectionLightMainService$Wonderjs.getRecord(state));
}
function setDirectionLightIntensity(light, intensity, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposeDirectionLightService$Wonderjs.isAlive, RecordDirectionLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
var newrecord = Caml_array.caml_array_dup(state);
newrecord[/* directionLightRecord */21] = OperateDirectionLightService$Wonderjs.setIntensity(light, intensity, RecordDirectionLightMainService$Wonderjs.getRecord(state));
return newrecord;
}
function getDirectionLightIsRender(light, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposeDirectionLightService$Wonderjs.isAlive, RecordDirectionLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateDirectionLightService$Wonderjs.getIsRender(light, RecordDirectionLightMainService$Wonderjs.getRecord(state));
}
function setDirectionLightIsRender(light, isRender, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposeDirectionLightService$Wonderjs.isAlive, RecordDirectionLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
var newrecord = Caml_array.caml_array_dup(state);
newrecord[/* directionLightRecord */21] = OperateDirectionLightService$Wonderjs.setIsRender(light, isRender, RecordDirectionLightMainService$Wonderjs.getRecord(state));
return newrecord;
}
function isMaxCount(state) {
return MaxCountLightService$Wonderjs.isMaxCount(RecordDirectionLightMainService$Wonderjs.getRecord(state)[/* renderLightArr */4], BufferDirectionLightService$Wonderjs.getBufferMaxCount(/* () */0));
}
exports.createDirectionLight = createDirectionLight;
exports.unsafeGetDirectionLightGameObject = unsafeGetDirectionLightGameObject;
exports.getDirectionLightColor = getDirectionLightColor;
exports.setDirectionLightColor = setDirectionLightColor;
exports.getDirectionLightIntensity = getDirectionLightIntensity;
exports.setDirectionLightIntensity = setDirectionLightIntensity;
exports.getDirectionLightIsRender = getDirectionLightIsRender;
exports.setDirectionLightIsRender = setDirectionLightIsRender;
exports.isMaxCount = isMaxCount;
/* Contract-WonderLog Not a pure module */