@flashist/appframework 0.0.52 → 0.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,5 +3,6 @@ export declare const RenderComponentType = "render";
3
3
  export declare const RenderComponentDefaultValue: {
4
4
  type: "render";
5
5
  view: DisplayObject;
6
+ containerId: string;
6
7
  };
7
8
  export declare type RenderComponent = typeof RenderComponentDefaultValue;
@@ -1,6 +1,7 @@
1
1
  export var RenderComponentType = "render";
2
2
  export var RenderComponentDefaultValue = {
3
3
  type: RenderComponentType,
4
- view: null
4
+ view: null,
5
+ containerId: null
5
6
  };
6
7
  //# sourceMappingURL=RenderComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RenderComponent.js","sourceRoot":"","sources":["../../../../src/ecs-rendermodule/ecs/components/RenderComponent.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,IAAM,mBAAmB,GAAG,QAAQ,CAAC;AAE5C,MAAM,CAAC,IAAM,2BAA2B,GAAG;IACvC,IAAI,EAAE,mBAAiD;IACvD,IAAI,EAAE,IAAqB;CAC9B,CAAA"}
1
+ {"version":3,"file":"RenderComponent.js","sourceRoot":"","sources":["../../../../src/ecs-rendermodule/ecs/components/RenderComponent.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,IAAM,mBAAmB,GAAG,QAAQ,CAAC;AAE5C,MAAM,CAAC,IAAM,2BAA2B,GAAG;IACvC,IAAI,EAAE,mBAAiD;IACvD,IAAI,EAAE,IAAqB;IAC3B,WAAW,EAAE,IAAc;CAC9B,CAAA"}
@@ -1,11 +1,14 @@
1
- import { DisplayObjectContainer } from "@flashist/flibs";
1
+ import { FContainer } from "@flashist/flibs";
2
+ import { ContainersManager } from "../../../containers/managers/ContainersManager";
2
3
  import { IEntity } from "../../../ecs/ecs/entities/IEntity";
3
4
  import { System } from "../../../ecs/ecs/systems/System";
4
5
  import { RenderComponent } from "../components/RenderComponent";
5
6
  export declare class RenderSystem<EntityType extends IEntity<RenderComponent>> extends System<EntityType> {
6
- protected rootContainer: DisplayObjectContainer;
7
+ protected containersManager: ContainersManager;
8
+ protected rootContainer: FContainer;
7
9
  constructor();
8
10
  protected construction(includeTypes: string[], excludeTypes?: string[]): void;
9
11
  protected onEntityAdded(entity: EntityType): void;
10
12
  protected onEntityRemoved(entity: EntityType): void;
13
+ protected getContainer(containerId: string): FContainer;
11
14
  }
@@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () {
13
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
14
  };
15
15
  })();
16
- import { FContainer, getInstance } from "@flashist/flibs";
16
+ import { DisplayTools, FContainer, getInstance } from "@flashist/flibs";
17
17
  import { ContainersManager } from "../../../containers/managers/ContainersManager";
18
18
  import { System } from "../../../ecs/ecs/systems/System";
19
19
  import { RenderModuleRootContainerId } from "../../data/RenderModuleRootContainerId";
@@ -26,17 +26,29 @@ var RenderSystem = /** @class */ (function (_super) {
26
26
  RenderSystem.prototype.construction = function (includeTypes, excludeTypes) {
27
27
  _super.prototype.construction.call(this, includeTypes, excludeTypes);
28
28
  this.rootContainer = new FContainer();
29
- var containersManager = getInstance(ContainersManager);
29
+ this.containersManager = getInstance(ContainersManager);
30
30
  // as any - to solve some type-related problems between modules
31
- containersManager.addContainer(this.rootContainer, RenderModuleRootContainerId);
31
+ this.containersManager.addContainer(this.rootContainer, RenderModuleRootContainerId);
32
32
  };
33
33
  RenderSystem.prototype.onEntityAdded = function (entity) {
34
34
  _super.prototype.onEntityAdded.call(this, entity);
35
- this.rootContainer.addChild(entity.components.render.view);
35
+ var tempCont = this.getContainer(entity.components.render.containerId);
36
+ tempCont.addChild(entity.components.render.view);
36
37
  };
37
38
  RenderSystem.prototype.onEntityRemoved = function (entity) {
38
39
  _super.prototype.onEntityAdded.call(this, entity);
39
- this.rootContainer.removeChild(entity.components.render.view);
40
+ DisplayTools.childRemoveItselfFromParent(entity.components.render.view);
41
+ // this.rootContainer.removeChild(entity.components.render.view);
42
+ };
43
+ RenderSystem.prototype.getContainer = function (containerId) {
44
+ var result;
45
+ if (containerId) {
46
+ result = this.containersManager.getContainer(containerId);
47
+ }
48
+ if (!result) {
49
+ result = this.rootContainer;
50
+ }
51
+ return result;
40
52
  };
41
53
  return RenderSystem;
42
54
  }(System));
@@ -1 +1 @@
1
- {"version":3,"file":"RenderSystem.js","sourceRoot":"","sources":["../../../../src/ecs-rendermodule/ecs/systems/RenderSystem.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAA0B,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAmB,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGrF;IAA+E,gCAAkB;IAI7F;eACI,kBAAM,CAAC,mBAAmB,CAAC,CAAC;IAChC,CAAC;IAES,mCAAY,GAAtB,UAAuB,YAAsB,EAAE,YAAuB;QAClE,iBAAM,YAAY,YAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAE/C,IAAI,CAAC,aAAa,GAAG,IAAI,UAAU,EAAE,CAAC;QAEtC,IAAM,iBAAiB,GAAsB,WAAW,CAAC,iBAAiB,CAAC,CAAC;QAC5E,+DAA+D;QAC/D,iBAAiB,CAAC,YAAY,CAAC,IAAI,CAAC,aAAoB,EAAE,2BAA2B,CAAC,CAAC;IAC3F,CAAC;IAES,oCAAa,GAAvB,UAAwB,MAAkB;QACtC,iBAAM,aAAa,YAAC,MAAM,CAAC,CAAC;QAE5B,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC;IAES,sCAAe,GAAzB,UAA0B,MAAkB;QACx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AQ,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IAES,sCAAe,GAAzB,UAA0B,MAAkB;QACxC,iBAAM,aAAa,YAAC,MAAM,CAAC,CAAC;QAE5B,YAAY,CAAC,2BAA2B,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACxE,iEAAiE;IACrE,CAAC;IAES,mCAAY,GAAtB,UAAuB,WAAmB;QACtC,IAAI,MAAkB,CAAC;QACvB,IAAI,WAAW,EAAE;YACb,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,WAAW,CAAC,CAAA;SAC5D;QAED,IAAI,CAAC,MAAM,EAAE;YACT,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC;SAC/B;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IACL,mBAAC;AAAD,CAAC,AA9CD,CAA+E,MAAM,GA8CpF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashist/appframework",
3
- "version": "0.0.52",
3
+ "version": "0.0.54",
4
4
  "scripts": {
5
5
  "build": "gulp",
6
6
  "publish:patch": "npm version patch && npm run build && cd ./dist && npm publish",