1 | "use strict";
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4 |
|
5 | Object.defineProperty(exports, "__esModule", {
|
6 | value: true
|
7 | });
|
8 | exports.lazyMultiInject = exports.lazyInject = exports.container = void 0;
|
9 |
|
10 | require("reflect-metadata");
|
11 |
|
12 | var _inversify = require("inversify");
|
13 |
|
14 | var _inversifyInjectDecorators = _interopRequireDefault(require("inversify-inject-decorators"));
|
15 |
|
16 | var _ComponentManager = require("./ComponentManager");
|
17 |
|
18 | var _CameraComponent = require("./components/camera/CameraComponent");
|
19 |
|
20 | var _System = require("./components/camera/System");
|
21 |
|
22 | var _ComputeComponent = require("./components/compute/ComputeComponent");
|
23 |
|
24 | var _LayoutComputeStrategy = require("./components/compute/LayoutComputeStrategy");
|
25 |
|
26 | var _ParticleComputeStrategy = require("./components/compute/ParticleComputeStrategy");
|
27 |
|
28 | var _System2 = require("./components/compute/System");
|
29 |
|
30 | var _PassNodeComponent = require("./components/framegraph/PassNodeComponent");
|
31 |
|
32 | var _ResourceHandleComponent = require("./components/framegraph/ResourceHandleComponent");
|
33 |
|
34 | var _System3 = require("./components/framegraph/System");
|
35 |
|
36 | var _GeometryComponent = require("./components/geometry/GeometryComponent");
|
37 |
|
38 | var _System4 = require("./components/geometry/System");
|
39 |
|
40 | var _System5 = require("./components/interaction/System");
|
41 |
|
42 | var _MaterialComponent = require("./components/material/MaterialComponent");
|
43 |
|
44 | var _System6 = require("./components/material/System");
|
45 |
|
46 | var _CullableComponent = require("./components/mesh/CullableComponent");
|
47 |
|
48 | var _MeshComponent = require("./components/mesh/MeshComponent");
|
49 |
|
50 | var _System7 = require("./components/mesh/System");
|
51 |
|
52 | var _Forward = require("./components/renderpath/Forward");
|
53 |
|
54 | var _SceneComponent = require("./components/scene/SceneComponent");
|
55 |
|
56 | var _System8 = require("./components/scene/System");
|
57 |
|
58 | var _HierarchyComponent = require("./components/scenegraph/HierarchyComponent");
|
59 |
|
60 | var _NameComponent = require("./components/scenegraph/NameComponent");
|
61 |
|
62 | var _System9 = require("./components/scenegraph/System");
|
63 |
|
64 | var _TransformComponent = require("./components/scenegraph/TransformComponent");
|
65 |
|
66 | var _identifier = require("./identifier");
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | var container = new _inversify.Container();
|
74 |
|
75 |
|
76 | exports.container = container;
|
77 | var DECORATORS = (0, _inversifyInjectDecorators.default)(container, false);
|
78 |
|
79 |
|
80 |
|
81 |
|
82 | var lazyInject = function lazyInject(serviceIdentifier) {
|
83 | var original = DECORATORS.lazyInject(serviceIdentifier);
|
84 |
|
85 |
|
86 | return function (proto, key, descriptor) {
|
87 |
|
88 | original.call(this, proto, key);
|
89 |
|
90 | if (descriptor) {
|
91 | descriptor.initializer = function () {
|
92 | return proto[key];
|
93 | };
|
94 | }
|
95 | };
|
96 | };
|
97 |
|
98 | exports.lazyInject = lazyInject;
|
99 |
|
100 | var lazyMultiInject = function lazyMultiInject(serviceIdentifier) {
|
101 | var original = DECORATORS.lazyMultiInject(serviceIdentifier);
|
102 |
|
103 |
|
104 | return function (proto, key, descriptor) {
|
105 |
|
106 | original.call(this, proto, key);
|
107 |
|
108 | if (descriptor) {
|
109 |
|
110 | descriptor.initializer = function () {
|
111 | return proto[key];
|
112 | };
|
113 | }
|
114 | };
|
115 | };
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 | exports.lazyMultiInject = lazyMultiInject;
|
122 | container.bind(_identifier.IDENTIFIER.NameComponentManager).toConstantValue(new _ComponentManager.ComponentManager(_NameComponent.NameComponent));
|
123 | container.bind(_identifier.IDENTIFIER.HierarchyComponentManager).toConstantValue(new _ComponentManager.ComponentManager(_HierarchyComponent.HierarchyComponent));
|
124 | container.bind(_identifier.IDENTIFIER.TransformComponentManager).toConstantValue(new _ComponentManager.ComponentManager(_TransformComponent.TransformComponent));
|
125 | container.bind(_identifier.IDENTIFIER.CameraComponentManager).toConstantValue(new _ComponentManager.ComponentManager(_CameraComponent.CameraComponent));
|
126 | container.bind(_identifier.IDENTIFIER.ResourceHandleComponentManager).toConstantValue(new _ComponentManager.ComponentManager(_ResourceHandleComponent.ResourceHandleComponent));
|
127 | container.bind(_identifier.IDENTIFIER.PassNodeComponentManager).toConstantValue(new _ComponentManager.ComponentManager(_PassNodeComponent.PassNodeComponent));
|
128 | container.bind(_identifier.IDENTIFIER.MeshComponentManager).toConstantValue(new _ComponentManager.ComponentManager(_MeshComponent.MeshComponent));
|
129 | container.bind(_identifier.IDENTIFIER.CullableComponentManager).toConstantValue(new _ComponentManager.ComponentManager(_CullableComponent.CullableComponent));
|
130 | container.bind(_identifier.IDENTIFIER.GeometryComponentManager).toConstantValue(new _ComponentManager.ComponentManager(_GeometryComponent.GeometryComponent));
|
131 | container.bind(_identifier.IDENTIFIER.MaterialComponentManager).toConstantValue(new _ComponentManager.ComponentManager(_MaterialComponent.MaterialComponent));
|
132 | container.bind(_identifier.IDENTIFIER.SceneComponentManager).toConstantValue(new _ComponentManager.ComponentManager(_SceneComponent.SceneComponent));
|
133 | container.bind(_identifier.IDENTIFIER.ComputeComponentManager).toConstantValue(new _ComponentManager.ComponentManager(_ComputeComponent.ComputeComponent));
|
134 |
|
135 |
|
136 |
|
137 |
|
138 | container.bind(_identifier.IDENTIFIER.Systems).to(_System9.SceneGraphSystem).whenTargetNamed(_identifier.IDENTIFIER.SceneGraphSystem);
|
139 | container.bind(_identifier.IDENTIFIER.Systems).to(_System8.SceneSystem).whenTargetNamed(_identifier.IDENTIFIER.SceneSystem);
|
140 | container.bind(_identifier.IDENTIFIER.Systems).to(_System.CameraSystem).whenTargetNamed(_identifier.IDENTIFIER.CameraSystem);
|
141 | container.bind(_identifier.IDENTIFIER.Systems).to(_System3.FrameGraphSystem).whenTargetNamed(_identifier.IDENTIFIER.FrameGraphSystem);
|
142 | container.bind(_identifier.IDENTIFIER.Systems).to(_System7.MeshSystem).whenTargetNamed(_identifier.IDENTIFIER.MeshSystem);
|
143 | container.bind(_identifier.IDENTIFIER.Systems).to(_System4.GeometrySystem).whenTargetNamed(_identifier.IDENTIFIER.GeometrySystem);
|
144 | container.bind(_identifier.IDENTIFIER.Systems).to(_System6.MaterialSystem).whenTargetNamed(_identifier.IDENTIFIER.MaterialSystem);
|
145 | container.bind(_identifier.IDENTIFIER.Systems).to(_System5.InteractionSystem).whenTargetNamed(_identifier.IDENTIFIER.InteractionSystem);
|
146 | container.bind(_identifier.IDENTIFIER.Systems).to(_System2.ComputeSystem).whenTargetNamed(_identifier.IDENTIFIER.ComputeSystem);
|
147 | container.bind(_identifier.IDENTIFIER.ForwardRenderPath).to(_Forward.ForwardRenderPath).inSingletonScope();
|
148 |
|
149 |
|
150 |
|
151 |
|
152 | container.bind(_identifier.IDENTIFIER.ComputeStrategy).to(_ParticleComputeStrategy.ParticleComputeStrategy).whenTargetNamed('particle');
|
153 | container.bind(_identifier.IDENTIFIER.ComputeStrategy).to(_LayoutComputeStrategy.LayoutComputeStrategy).whenTargetNamed('layout');
|
154 |
|
\ | No newline at end of file |