wonder.js
Version:
186 lines (161 loc) • 12.7 kB
JavaScript
'use strict';
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 ArrayService$WonderCommonlib = require("wonder-commonlib/lib/js/src/ArrayService.js");
var AliveComponentService$Wonderjs = require("../../service/primitive/component/AliveComponentService.js");
var GetAllComponentService$Wonderjs = require("../../service/primitive/component/GetAllComponentService.js");
var InitLightMaterialMainService$Wonderjs = require("../../service/state/main/material/light/InitLightMaterialMainService.js");
var NameLightMaterialMainService$Wonderjs = require("../../service/state/main/material/light/NameLightMaterialMainService.js");
var CreateLightMaterialMainService$Wonderjs = require("../../service/state/main/material/light/CreateLightMaterialMainService.js");
var GameObjectLightMaterialService$Wonderjs = require("../../service/record/main/material/light/GameObjectLightMaterialService.js");
var RecordLightMaterialMainService$Wonderjs = require("../../service/state/main/material/light/RecordLightMaterialMainService.js");
var DisposeLightMaterialMainService$Wonderjs = require("../../service/state/main/material/light/DisposeLightMaterialMainService.js");
var OperateLightMaterialMainService$Wonderjs = require("../../service/state/main/material/light/OperateLightMaterialMainService.js");
var DisposeComponentGameObjectMainService$Wonderjs = require("../../service/state/main/gameObject/DisposeComponentGameObjectMainService.js");
function createLightMaterial(state) {
return CreateLightMaterialMainService$Wonderjs.create(state);
}
function unsafeGetLightMaterialGameObjects(material, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return GameObjectLightMaterialService$Wonderjs.unsafeGetGameObjects(material, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}
function getLightMaterialDiffuseColor(material, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateLightMaterialMainService$Wonderjs.getDiffuseColor(material, state);
}
function setLightMaterialDiffuseColor(material, color, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateLightMaterialMainService$Wonderjs.setDiffuseColor(material, color, state);
}
function getLightMaterialSpecularColor(material, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateLightMaterialMainService$Wonderjs.getSpecularColor(material, state);
}
function setLightMaterialSpecularColor(material, color, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateLightMaterialMainService$Wonderjs.setSpecularColor(material, color, state);
}
function getLightMaterialShininess(material, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateLightMaterialMainService$Wonderjs.getShininess(material, state);
}
function setLightMaterialShininess(material, shininess, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateLightMaterialMainService$Wonderjs.setShininess(material, shininess, state);
}
function unsafeGetLightMaterialDiffuseMap(material, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateLightMaterialMainService$Wonderjs.unsafeGetDiffuseMap(material, state);
}
function setLightMaterialDiffuseMap(material, texture, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateLightMaterialMainService$Wonderjs.setDiffuseMap(material, texture, state);
}
function hasLightMaterialDiffuseMap(material, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateLightMaterialMainService$Wonderjs.hasDiffuseMap(material, state);
}
function removeLightMaterialDiffuseMap(material, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateLightMaterialMainService$Wonderjs.removeDiffuseMap(material, state);
}
function unsafeGetLightMaterialSpecularMap(material, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateLightMaterialMainService$Wonderjs.unsafeGetSpecularMap(material, state);
}
function setLightMaterialSpecularMap(material, texture, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateLightMaterialMainService$Wonderjs.setSpecularMap(material, texture, state);
}
function hasLightMaterialSpecularMap(material, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateLightMaterialMainService$Wonderjs.hasSpecularMap(material, state);
}
function removeLightMaterialSpecularMap(material, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return OperateLightMaterialMainService$Wonderjs.removeSpecularMap(material, state);
}
function unsafeGetLightMaterialName(material, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return NameLightMaterialMainService$Wonderjs.unsafeGetName(material, state);
}
function setLightMaterialName(material, name, state) {
Contract$WonderLog.requireCheck((function (param) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return NameLightMaterialMainService$Wonderjs.setName(material, name, state);
}
function reInitMaterials(materials, state) {
Contract$WonderLog.requireCheck((function (param) {
return ArrayService$WonderCommonlib.forEach((function (material) {
return AliveComponentService$Wonderjs.checkComponentShouldAlive(material, DisposeLightMaterialMainService$Wonderjs.isAlive, RecordLightMaterialMainService$Wonderjs.getRecord(state));
}), materials);
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return InitLightMaterialMainService$Wonderjs.reInitComponents(materials, state);
}
function getAllLightMaterials(state) {
var match = RecordLightMaterialMainService$Wonderjs.getRecord(state);
return GetAllComponentService$Wonderjs.getAllComponents(match[/* index */0], match[/* disposedIndexArray */12]);
}
function batchDisposeLightMaterial(materialArr, state) {
return DisposeComponentGameObjectMainService$Wonderjs.batchDisposeLightMaterialComponent(materialArr, false, state);
}
function batchDisposeLightMaterialRemoveTexture(materialArr, state) {
return DisposeComponentGameObjectMainService$Wonderjs.batchDisposeLightMaterialComponent(materialArr, true, state);
}
exports.createLightMaterial = createLightMaterial;
exports.unsafeGetLightMaterialGameObjects = unsafeGetLightMaterialGameObjects;
exports.getLightMaterialDiffuseColor = getLightMaterialDiffuseColor;
exports.setLightMaterialDiffuseColor = setLightMaterialDiffuseColor;
exports.getLightMaterialSpecularColor = getLightMaterialSpecularColor;
exports.setLightMaterialSpecularColor = setLightMaterialSpecularColor;
exports.getLightMaterialShininess = getLightMaterialShininess;
exports.setLightMaterialShininess = setLightMaterialShininess;
exports.unsafeGetLightMaterialDiffuseMap = unsafeGetLightMaterialDiffuseMap;
exports.setLightMaterialDiffuseMap = setLightMaterialDiffuseMap;
exports.hasLightMaterialDiffuseMap = hasLightMaterialDiffuseMap;
exports.removeLightMaterialDiffuseMap = removeLightMaterialDiffuseMap;
exports.unsafeGetLightMaterialSpecularMap = unsafeGetLightMaterialSpecularMap;
exports.setLightMaterialSpecularMap = setLightMaterialSpecularMap;
exports.hasLightMaterialSpecularMap = hasLightMaterialSpecularMap;
exports.removeLightMaterialSpecularMap = removeLightMaterialSpecularMap;
exports.unsafeGetLightMaterialName = unsafeGetLightMaterialName;
exports.setLightMaterialName = setLightMaterialName;
exports.reInitMaterials = reInitMaterials;
exports.getAllLightMaterials = getAllLightMaterials;
exports.batchDisposeLightMaterial = batchDisposeLightMaterial;
exports.batchDisposeLightMaterialRemoveTexture = batchDisposeLightMaterialRemoveTexture;
/* Contract-WonderLog Not a pure module */