react-simple-game-engine 0.0.28 → 0.0.29

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.
@@ -4,6 +4,6 @@ export declare class LogicComponent<C extends {
4
4
  }> {
5
5
  private instance;
6
6
  constructor(configale: Configable<C>);
7
- output(): C;
7
+ output(extraParams?: Record<string, any>): C;
8
8
  }
9
9
  //# sourceMappingURL=logic-component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logic-component.d.ts","sourceRoot":"","sources":["../../src/classes/logic-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,qBAAa,cAAc,CAAC,CAAC,SAAS;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE;IACpD,OAAO,CAAC,QAAQ,CAAI;gBACR,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IAOpC,MAAM;CAGP"}
1
+ {"version":3,"file":"logic-component.d.ts","sourceRoot":"","sources":["../../src/classes/logic-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C,qBAAa,cAAc,CAAC,CAAC,SAAS;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE;IACpD,OAAO,CAAC,QAAQ,CAAI;gBACR,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IAOpC,MAAM,CAAC,WAAW,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM;CAI7C"}
@@ -1,3 +1,4 @@
1
+ import { copyProperties } from "../utils";
1
2
  var LogicComponent = /** @class */ (function () {
2
3
  function LogicComponent(configale) {
3
4
  var _a = Array.isArray(configale) ? configale : [configale], Class = _a[0], params = _a[1];
@@ -5,7 +6,9 @@ var LogicComponent = /** @class */ (function () {
5
6
  c.initial(params);
6
7
  this.instance = c;
7
8
  }
8
- LogicComponent.prototype.output = function () {
9
+ LogicComponent.prototype.output = function (extraParams) {
10
+ if (extraParams === void 0) { extraParams = {}; }
11
+ copyProperties(this.instance, extraParams);
9
12
  return this.instance;
10
13
  };
11
14
  return LogicComponent;
@@ -14,7 +14,7 @@ export declare abstract class Scene<UIP = any> {
14
14
  tag: string;
15
15
  manager: SceneManagement;
16
16
  readonly sessionId: string;
17
- abstract getComponents(): LogicComponent<Entity | ParticleSystem>[];
17
+ abstract getComponents(camera: Camera): LogicComponent<Entity | ParticleSystem>[];
18
18
  constructor();
19
19
  get UI(): ComponentType<UIP>;
20
20
  get UIProps(): UIP;
@@ -1 +1 @@
1
- {"version":3,"file":"scene.d.ts","sourceRoot":"","sources":["../../src/classes/scene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,aAAK,kBAAkB,GAAG,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;AAE1D,8BAAsB,KAAK,CAAC,GAAG,GAAG,GAAG;IACnC,OAAO,CAAC,EAAE,CAAqB;IAC/B,OAAO,CAAC,eAAe,CAAmB;IAC1C,OAAO,CAAC,aAAa,CAAW;IAChC,OAAO,CAAC,kBAAkB,CAAsB;IAEzC,WAAW,EAAE,MAAM,CAAK;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAG,eAAe,CAAC;IACjC,SAAgB,SAAS,EAAE,MAAM,CAA8C;aAC/D,aAAa,IAAI,cAAc,CAAC,MAAM,GAAG,cAAc,CAAC,EAAE;;IAS1E,IAAI,EAAE,uBAGL;IAED,IAAI,OAAO,QAEV;IAED,SAAS,CAAC,MAAM;IAEh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AAC,MAAM;IAEhB,SAAS,CAAC,UAAU;IAIpB,IAAI,YAAY,YAEf;IAED,iBAAiB,CAAC,IAAI,EAAE,kBAAkB;IAI1C,UAAU;IAIV,kBAAkB,CAAC,YAAY,EAAE,OAAO;IAKxC,aAAa,CAAC,GAAG,EAAE,MAAM;IAInB,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM;IAczB,YAAY;IAElB,SAAS,CAAC,MAAM,EAAE,MAAM;IAaxB,SAAS,CAAC,MAAM;IAChB,SAAS,CAAC,QAAQ;IAElB,MAAM;CAQP"}
@@ -118,12 +118,11 @@ var Scene = /** @class */ (function () {
118
118
  };
119
119
  Scene.prototype.bootstrap = function (camera) {
120
120
  this.worldManagement = new WorldManagement();
121
- var components = this.getComponents();
121
+ var components = this.getComponents(camera);
122
122
  for (var _i = 0, components_1 = components; _i < components_1.length; _i++) {
123
123
  var component = components_1[_i];
124
- var entity = component.output();
124
+ var entity = component.output({ camera: camera });
125
125
  if (entity instanceof Entity) {
126
- entity.camera = camera;
127
126
  this.worldManagement.addEntity(entity);
128
127
  }
129
128
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-simple-game-engine",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib",