wonder.js
Version:
57 lines (49 loc) • 2.67 kB
JavaScript
;
var Log$WonderLog = require("wonder-log/lib/js/src/Log.js");
var JudgeABTypeUtils$Wonderjs = require("./utils/JudgeABTypeUtils.js");
var FindDependencyDataSystem$Wonderjs = require("../all/dependency/FindDependencyDataSystem.js");
var OperateRABAssetBundleMainService$Wonderjs = require("../../service/state/main/assetBundle/OperateRABAssetBundleMainService.js");
var OperateSABAssetBundleMainService$Wonderjs = require("../../service/state/main/assetBundle/OperateSABAssetBundleMainService.js");
var OperateWABAssetBundleMainService$Wonderjs = require("../../service/state/main/assetBundle/OperateWABAssetBundleMainService.js");
function getAllNeededABCount(abRelativePath, wabRelativePath, state) {
return FindDependencyDataSystem$Wonderjs.findAllDependencyRABRelativePathByDepthSearch(abRelativePath, OperateWABAssetBundleMainService$Wonderjs.unsafeGetWholeDependencyRelationMap(wabRelativePath, state)).length + 1 | 0;
}
function _getLoadedDependencyRABCount(abRelativePath, wabRelativePath, state) {
return FindDependencyDataSystem$Wonderjs.findAllDependencyRABRelativePathByDepthSearch(abRelativePath, OperateWABAssetBundleMainService$Wonderjs.unsafeGetWholeDependencyRelationMap(wabRelativePath, state)).filter((function (rabRelativePath) {
return OperateRABAssetBundleMainService$Wonderjs.isLoaded(rabRelativePath, state);
})).length;
}
function _getLoadedABSelfCount(abRelativePath, state) {
var match = JudgeABTypeUtils$Wonderjs.isSAB(abRelativePath);
if (match) {
var match$1 = OperateSABAssetBundleMainService$Wonderjs.isLoaded(abRelativePath, state);
if (match$1) {
return 1;
} else {
return 0;
}
} else {
var match$2 = JudgeABTypeUtils$Wonderjs.isRAB(abRelativePath);
if (match$2) {
var match$3 = OperateRABAssetBundleMainService$Wonderjs.isLoaded(abRelativePath, state);
if (match$3) {
return 1;
} else {
return 0;
}
} else {
return Log$WonderLog.fatal(Log$WonderLog.buildFatalMessage("getLoadedNeededABCount", "unknown abRelativePath: " + (String(abRelativePath) + ""), "", "", ""));
}
}
}
function getLoadedNeededABCount(abRelativePath, wabRelativePath, state) {
return _getLoadedDependencyRABCount(abRelativePath, wabRelativePath, state) + _getLoadedABSelfCount(abRelativePath, state) | 0;
}
var RAB = /* module */[
/* getAllNeededABCount */getAllNeededABCount,
/* _getLoadedDependencyRABCount */_getLoadedDependencyRABCount,
/* _getLoadedABSelfCount */_getLoadedABSelfCount,
/* getLoadedNeededABCount */getLoadedNeededABCount
];
exports.RAB = RAB;
/* Log-WonderLog Not a pure module */