wonder.js
Version:
171 lines (150 loc) • 11.4 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 BufferPointLightService$Wonderjs = require("../../service/record/main/light/point/BufferPointLightService.js");
var DisposePointLightService$Wonderjs = require("../../service/record/main/light/point/DisposePointLightService.js");
var OperatePointLightService$Wonderjs = require("../../service/record/main/light/point/OperatePointLightService.js");
var CreatePointLightMainService$Wonderjs = require("../../service/state/main/light/point/CreatePointLightMainService.js");
var GameObjectPointLightService$Wonderjs = require("../../service/record/main/light/point/GameObjectPointLightService.js");
var RecordPointLightMainService$Wonderjs = require("../../service/state/main/light/point/RecordPointLightMainService.js");
function createPointLight(state) {
return CreatePointLightMainService$Wonderjs.create(true, state);
}
function unsafeGetPointLightGameObject(light, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return GameObjectPointLightService$Wonderjs.unsafeGetGameObject(light, RecordPointLightMainService$Wonderjs.getRecord(state));
}
function getPointLightColor(light, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperatePointLightService$Wonderjs.getColor(light, RecordPointLightMainService$Wonderjs.getRecord(state));
}
function setPointLightColor(light, color, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
var newrecord = Caml_array.caml_array_dup(state);
newrecord[/* pointLightRecord */22] = OperatePointLightService$Wonderjs.setColor(light, color, RecordPointLightMainService$Wonderjs.getRecord(state));
return newrecord;
}
function getPointLightIntensity(light, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperatePointLightService$Wonderjs.getIntensity(light, RecordPointLightMainService$Wonderjs.getRecord(state));
}
function setPointLightIntensity(light, intensity, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
var newrecord = Caml_array.caml_array_dup(state);
newrecord[/* pointLightRecord */22] = OperatePointLightService$Wonderjs.setIntensity(light, intensity, RecordPointLightMainService$Wonderjs.getRecord(state));
return newrecord;
}
function getPointLightConstant(light, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperatePointLightService$Wonderjs.getConstant(light, RecordPointLightMainService$Wonderjs.getRecord(state));
}
function setPointLightConstant(light, constant, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
var newrecord = Caml_array.caml_array_dup(state);
newrecord[/* pointLightRecord */22] = OperatePointLightService$Wonderjs.setConstant(light, constant, RecordPointLightMainService$Wonderjs.getRecord(state));
return newrecord;
}
function getPointLightLinear(light, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperatePointLightService$Wonderjs.getLinear(light, RecordPointLightMainService$Wonderjs.getRecord(state));
}
function setPointLightLinear(light, linear, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
var newrecord = Caml_array.caml_array_dup(state);
newrecord[/* pointLightRecord */22] = OperatePointLightService$Wonderjs.setLinear(light, linear, RecordPointLightMainService$Wonderjs.getRecord(state));
return newrecord;
}
function getPointLightQuadratic(light, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperatePointLightService$Wonderjs.getQuadratic(light, RecordPointLightMainService$Wonderjs.getRecord(state));
}
function setPointLightQuadratic(light, quadratic, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
var newrecord = Caml_array.caml_array_dup(state);
newrecord[/* pointLightRecord */22] = OperatePointLightService$Wonderjs.setQuadratic(light, quadratic, RecordPointLightMainService$Wonderjs.getRecord(state));
return newrecord;
}
function getPointLightRange(light, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperatePointLightService$Wonderjs.getRange(light, RecordPointLightMainService$Wonderjs.getRecord(state));
}
function setPointLightRange(light, range, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
var newrecord = Caml_array.caml_array_dup(state);
newrecord[/* pointLightRecord */22] = OperatePointLightService$Wonderjs.setRange(light, range, RecordPointLightMainService$Wonderjs.getRecord(state));
return newrecord;
}
function setPointLightRangeLevel(light, level, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
var newrecord = Caml_array.caml_array_dup(state);
newrecord[/* pointLightRecord */22] = OperatePointLightService$Wonderjs.setRangeLevel(light, level, RecordPointLightMainService$Wonderjs.getRecord(state));
return newrecord;
}
function getPointLightIsRender(light, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperatePointLightService$Wonderjs.getIsRender(light, RecordPointLightMainService$Wonderjs.getRecord(state));
}
function setPointLightIsRender(light, isRender, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(light, DisposePointLightService$Wonderjs.isAlive, RecordPointLightMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
var newrecord = Caml_array.caml_array_dup(state);
newrecord[/* pointLightRecord */22] = OperatePointLightService$Wonderjs.setIsRender(light, isRender, RecordPointLightMainService$Wonderjs.getRecord(state));
return newrecord;
}
function isMaxCount(state) {
return MaxCountLightService$Wonderjs.isMaxCount(RecordPointLightMainService$Wonderjs.getRecord(state)[/* renderLightArr */8], BufferPointLightService$Wonderjs.getBufferMaxCount(/* () */0));
}
exports.createPointLight = createPointLight;
exports.unsafeGetPointLightGameObject = unsafeGetPointLightGameObject;
exports.getPointLightColor = getPointLightColor;
exports.setPointLightColor = setPointLightColor;
exports.getPointLightIntensity = getPointLightIntensity;
exports.setPointLightIntensity = setPointLightIntensity;
exports.getPointLightConstant = getPointLightConstant;
exports.setPointLightConstant = setPointLightConstant;
exports.getPointLightLinear = getPointLightLinear;
exports.setPointLightLinear = setPointLightLinear;
exports.getPointLightQuadratic = getPointLightQuadratic;
exports.setPointLightQuadratic = setPointLightQuadratic;
exports.getPointLightRange = getPointLightRange;
exports.setPointLightRange = setPointLightRange;
exports.setPointLightRangeLevel = setPointLightRangeLevel;
exports.getPointLightIsRender = getPointLightIsRender;
exports.setPointLightIsRender = setPointLightIsRender;
exports.isMaxCount = isMaxCount;
/* Contract-WonderLog Not a pure module */