@rpgjs/client 5.0.0-alpha.10 → 5.0.0-alpha.2

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.
Files changed (114) hide show
  1. package/dist/Game/EffectManager.d.ts +5 -0
  2. package/dist/RpgClient.d.ts +68 -99
  3. package/dist/RpgClientEngine.d.ts +4 -86
  4. package/dist/components/effects/index.d.ts +4 -0
  5. package/dist/components/index.d.ts +1 -2
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.js +1 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/index10.js +1 -1
  10. package/dist/index11.js +4 -4
  11. package/dist/index11.js.map +1 -1
  12. package/dist/index12.js +2 -6
  13. package/dist/index12.js.map +1 -1
  14. package/dist/index13.js +2 -2
  15. package/dist/index13.js.map +1 -1
  16. package/dist/index14.js +35 -95
  17. package/dist/index14.js.map +1 -1
  18. package/dist/index15.js +186 -45
  19. package/dist/index15.js.map +1 -1
  20. package/dist/index16.js +5 -187
  21. package/dist/index16.js.map +1 -1
  22. package/dist/index17.js +383 -5
  23. package/dist/index17.js.map +1 -1
  24. package/dist/index18.js +28 -384
  25. package/dist/index18.js.map +1 -1
  26. package/dist/index19.js +17 -24
  27. package/dist/index19.js.map +1 -1
  28. package/dist/index2.js +25 -147
  29. package/dist/index2.js.map +1 -1
  30. package/dist/index20.js +2413 -16
  31. package/dist/index20.js.map +1 -1
  32. package/dist/index21.js +88 -2395
  33. package/dist/index21.js.map +1 -1
  34. package/dist/index22.js +103 -108
  35. package/dist/index22.js.map +1 -1
  36. package/dist/index23.js +57 -95
  37. package/dist/index23.js.map +1 -1
  38. package/dist/index24.js +12 -62
  39. package/dist/index24.js.map +1 -1
  40. package/dist/index25.js +37 -18
  41. package/dist/index25.js.map +1 -1
  42. package/dist/index26.js +3 -25
  43. package/dist/index26.js.map +1 -1
  44. package/dist/index27.js +314 -87
  45. package/dist/index27.js.map +1 -1
  46. package/dist/index28.js +21 -37
  47. package/dist/index28.js.map +1 -1
  48. package/dist/index29.js +9 -3
  49. package/dist/index29.js.map +1 -1
  50. package/dist/index3.js +2 -2
  51. package/dist/index30.js +6 -317
  52. package/dist/index30.js.map +1 -1
  53. package/dist/index31.js +171 -24
  54. package/dist/index31.js.map +1 -1
  55. package/dist/index32.js +497 -7
  56. package/dist/index32.js.map +1 -1
  57. package/dist/index33.js +9 -8
  58. package/dist/index33.js.map +1 -1
  59. package/dist/index34.js +4400 -9
  60. package/dist/index34.js.map +1 -1
  61. package/dist/index35.js +307 -4394
  62. package/dist/index35.js.map +1 -1
  63. package/dist/index36.js +85 -310
  64. package/dist/index36.js.map +1 -1
  65. package/dist/index37.js +56 -169
  66. package/dist/index37.js.map +1 -1
  67. package/dist/index38.js +16 -497
  68. package/dist/index38.js.map +1 -1
  69. package/dist/index39.js +10 -51
  70. package/dist/index39.js.map +1 -1
  71. package/dist/index4.js +5 -18
  72. package/dist/index4.js.map +1 -1
  73. package/dist/index5.js +1 -2
  74. package/dist/index5.js.map +1 -1
  75. package/dist/index6.js +1 -1
  76. package/dist/index7.js +2 -10
  77. package/dist/index7.js.map +1 -1
  78. package/dist/index8.js +6 -24
  79. package/dist/index8.js.map +1 -1
  80. package/dist/index9.js +2 -2
  81. package/dist/presets/index.d.ts +0 -102
  82. package/dist/services/loadMap.d.ts +2 -123
  83. package/dist/services/mmorpg.d.ts +3 -7
  84. package/package.json +12 -14
  85. package/src/Game/{AnimationManager.ts → EffectManager.ts} +2 -2
  86. package/src/Game/Object.ts +0 -69
  87. package/src/RpgClient.ts +67 -101
  88. package/src/RpgClientEngine.ts +24 -159
  89. package/src/components/character.ce +33 -74
  90. package/src/components/{animations → effects}/animation.ce +5 -3
  91. package/src/components/{animations → effects}/index.ts +1 -1
  92. package/src/components/index.ts +1 -2
  93. package/src/components/scenes/draw-map.ce +23 -6
  94. package/src/components/scenes/element-map.ce +23 -0
  95. package/src/components/scenes/event-layer.ce +3 -3
  96. package/src/core/setup.ts +0 -2
  97. package/src/index.ts +1 -1
  98. package/src/module.ts +5 -23
  99. package/src/presets/index.ts +1 -5
  100. package/src/services/loadMap.ts +2 -131
  101. package/src/services/mmorpg.ts +4 -20
  102. package/tsconfig.json +1 -1
  103. package/vite.config.ts +1 -1
  104. package/dist/Game/AnimationManager.d.ts +0 -8
  105. package/dist/components/animations/index.d.ts +0 -4
  106. package/dist/index40.js +0 -20
  107. package/dist/index40.js.map +0 -1
  108. package/dist/index41.js +0 -82
  109. package/dist/index41.js.map +0 -1
  110. package/dist/presets/animation.d.ts +0 -31
  111. package/dist/presets/lpc.d.ts +0 -89
  112. package/src/presets/animation.ts +0 -46
  113. package/src/presets/lpc.ts +0 -108
  114. /package/src/components/{animations → effects}/hit.ce +0 -0
package/dist/index2.js CHANGED
@@ -1,17 +1,15 @@
1
- import component from './index15.js';
2
- import { inject } from './index16.js';
1
+ import component from './index14.js';
2
+ import { inject } from './index15.js';
3
3
  import { signal, bootstrapCanvas } from 'canvasengine';
4
- import { WebSocketToken } from './index17.js';
4
+ import { WebSocketToken } from './index16.js';
5
5
  import { LoadMapToken } from './index7.js';
6
6
  import { ModulesToken } from '@rpgjs/common';
7
- import { load } from './index18.js';
8
- import { RpgClientMap } from './index19.js';
7
+ import { load } from './index17.js';
8
+ import { RpgClientMap } from './index18.js';
9
9
  import { RpgGui } from './index9.js';
10
- import { AnimationManager } from './index20.js';
10
+ import { EffectManager } from './index19.js';
11
11
  import { lastValueFrom } from 'rxjs';
12
12
  import { GlobalConfigToken } from './index8.js';
13
- import * as PIXI from 'pixi.js';
14
- import { PrebuiltComponentAnimations } from './index11.js';
15
13
 
16
14
  class RpgClientEngine {
17
15
  constructor(context) {
@@ -22,41 +20,25 @@ class RpgClientEngine {
22
20
  this.height = signal("100%");
23
21
  this.spritesheets = /* @__PURE__ */ new Map();
24
22
  this.sounds = /* @__PURE__ */ new Map();
25
- this.componentAnimations = [];
23
+ this.effects = [];
26
24
  this.particleSettings = {
27
25
  emitters: []
28
26
  };
29
- this.playerIdSignal = signal(null);
30
- this.spriteComponentsBehind = signal([]);
31
- this.spriteComponentsInFront = signal([]);
32
27
  this.webSocket = inject(context, WebSocketToken);
33
28
  this.guiService = inject(context, RpgGui);
34
29
  this.loadMapService = inject(context, LoadMapToken);
35
30
  this.hooks = inject(context, ModulesToken);
36
31
  this.globalConfig = inject(context, GlobalConfigToken);
37
- this.addComponentAnimation({
38
- id: "animation",
39
- component: PrebuiltComponentAnimations.Animation
40
- });
41
32
  }
42
33
  async start() {
43
34
  this.selector = document.body.querySelector("#rpg");
44
- const { app, canvasElement } = await bootstrapCanvas(this.selector, component);
45
- this.renderer = app.renderer;
46
- this.tick = canvasElement?.propObservables?.context["tick"].observable;
35
+ await bootstrapCanvas(this.selector, component);
47
36
  await lastValueFrom(this.hooks.callHooks("client-engine-onStart", this));
48
- window.addEventListener("resize", () => {
49
- this.hooks.callHooks("client-engine-onWindowResize", this).subscribe();
50
- });
51
- this.tick.subscribe((tick) => {
52
- this.hooks.callHooks("client-engine-onStep", this, tick).subscribe();
53
- });
54
37
  this.hooks.callHooks("client-spritesheets-load", this).subscribe();
55
38
  this.hooks.callHooks("client-sounds-load", this).subscribe();
56
39
  this.hooks.callHooks("client-gui-load", this).subscribe();
57
40
  this.hooks.callHooks("client-particles-load", this).subscribe();
58
- this.hooks.callHooks("client-componentAnimations-load", this).subscribe();
59
- this.hooks.callHooks("client-sprite-load", this).subscribe();
41
+ this.hooks.callHooks("client-effects-load", this).subscribe();
60
42
  await this.webSocket.connection(() => {
61
43
  this.initListeners();
62
44
  this.guiService._initialize();
@@ -64,34 +46,18 @@ class RpgClientEngine {
64
46
  }
65
47
  initListeners() {
66
48
  this.webSocket.on("sync", (data) => {
67
- if (data.pId) this.playerIdSignal.set(data.pId);
68
- this.hooks.callHooks("client-sceneMap-onChanges", this.sceneMap, { partial: data }).subscribe();
69
49
  load(this.sceneMap, data, true);
70
50
  });
71
51
  this.webSocket.on("changeMap", (data) => {
72
52
  this.loadScene(data.mapId);
73
53
  });
74
- this.webSocket.on("showComponentAnimation", (data) => {
75
- const { params, object, position, id } = data;
76
- if (!object && position === void 0) {
77
- throw new Error("Please provide an object or x and y coordinates");
54
+ this.webSocket.on("showEffect", (data) => {
55
+ const { params, object, id } = data;
56
+ if (!object) {
57
+ throw new Error("Object not found");
78
58
  }
79
- const player = object ? this.sceneMap.getObjectById(object) : void 0;
80
- this.getComponentAnimation(id).displayEffect(params, player || position);
81
- });
82
- this.webSocket.on("setAnimation", (data) => {
83
- const { animationName, nbTimes, object } = data;
84
59
  const player = this.sceneMap.getObjectById(object);
85
- player.setAnimation(animationName, nbTimes);
86
- });
87
- this.webSocket.on("open", () => {
88
- this.hooks.callHooks("client-engine-onConnected", this, this.socket).subscribe();
89
- });
90
- this.webSocket.on("close", () => {
91
- this.hooks.callHooks("client-engine-onDisconnected", this, this.socket).subscribe();
92
- });
93
- this.webSocket.on("error", (error) => {
94
- this.hooks.callHooks("client-engine-onConnectError", this, error, this.socket).subscribe();
60
+ this.getEffect(id).displayEffect(params, player);
95
61
  });
96
62
  }
97
63
  async loadScene(mapId) {
@@ -116,118 +82,30 @@ class RpgClientEngine {
116
82
  this.particleSettings.emitters.push(particle);
117
83
  return particle;
118
84
  }
119
- /**
120
- * Add a component to render behind sprites
121
- * Components added with this method will be displayed with a lower z-index than the sprite
122
- *
123
- * @param component - The component to add behind sprites
124
- * @returns The added component
125
- *
126
- * @example
127
- * ```ts
128
- * // Add a shadow component behind all sprites
129
- * engine.addSpriteComponentBehind(ShadowComponent);
130
- * ```
131
- */
132
- addSpriteComponentBehind(component) {
133
- this.spriteComponentsBehind.update((components) => [...components, component]);
134
- return component;
135
- }
136
- /**
137
- * Add a component to render in front of sprites
138
- * Components added with this method will be displayed with a higher z-index than the sprite
139
- *
140
- * @param component - The component to add in front of sprites
141
- * @returns The added component
142
- *
143
- * @example
144
- * ```ts
145
- * // Add a health bar component in front of all sprites
146
- * engine.addSpriteComponentInFront(HealthBarComponent);
147
- * ```
148
- */
149
- addSpriteComponentInFront(component) {
150
- this.spriteComponentsInFront.update((components) => [...components, component]);
151
- return component;
152
- }
153
- /**
154
- * Add a component animation to the engine
155
- *
156
- * Component animations are temporary visual effects that can be displayed
157
- * on sprites or objects, such as hit indicators, spell effects, or status animations.
158
- *
159
- * @param componentAnimation - The component animation configuration
160
- * @param componentAnimation.id - Unique identifier for the animation
161
- * @param componentAnimation.component - The component function to render
162
- * @returns The added component animation configuration
163
- *
164
- * @example
165
- * ```ts
166
- * // Add a hit animation component
167
- * engine.addComponentAnimation({
168
- * id: 'hit',
169
- * component: HitComponent
170
- * });
171
- *
172
- * // Add an explosion effect component
173
- * engine.addComponentAnimation({
174
- * id: 'explosion',
175
- * component: ExplosionComponent
176
- * });
177
- * ```
178
- */
179
- addComponentAnimation(componentAnimation) {
180
- const instance = new AnimationManager();
181
- this.componentAnimations.push({
182
- id: componentAnimation.id,
183
- component: componentAnimation.component,
85
+ addEffect(effect) {
86
+ const instance = new EffectManager();
87
+ this.effects.push({
88
+ id: effect.id,
89
+ component: effect.component,
184
90
  instance,
185
91
  current: instance.current
186
92
  });
187
- return componentAnimation;
93
+ return effect;
188
94
  }
189
- /**
190
- * Get a component animation by its ID
191
- *
192
- * Retrieves the EffectManager instance for a specific component animation,
193
- * which can be used to display the animation on sprites or objects.
194
- *
195
- * @param id - The unique identifier of the component animation
196
- * @returns The EffectManager instance for the animation
197
- * @throws Error if the component animation is not found
198
- *
199
- * @example
200
- * ```ts
201
- * // Get the hit animation and display it
202
- * const hitAnimation = engine.getComponentAnimation('hit');
203
- * hitAnimation.displayEffect({ text: "Critical!" }, player);
204
- * ```
205
- */
206
- getComponentAnimation(id) {
207
- const componentAnimation = this.componentAnimations.find((componentAnimation2) => componentAnimation2.id === id);
208
- if (!componentAnimation) {
209
- throw new Error(`Component animation with id ${id} not found`);
95
+ getEffect(id) {
96
+ const effect = this.effects.find((effect2) => effect2.id === id);
97
+ if (!effect) {
98
+ throw new Error(`Effect with id ${id} not found`);
210
99
  }
211
- return componentAnimation.instance;
100
+ return effect.instance;
212
101
  }
213
102
  processInput({ input }) {
214
- this.hooks.callHooks("client-engine-onInput", this, { input, playerId: this.playerId }).subscribe();
215
103
  this.webSocket.emit("move", { input });
216
104
  }
217
105
  processAction({ action }) {
218
106
  if (this.stopProcessingInput) return;
219
- this.hooks.callHooks("client-engine-onInput", this, { input: "action", playerId: this.playerId }).subscribe();
220
107
  this.webSocket.emit("action", { action });
221
108
  }
222
- get PIXI() {
223
- return PIXI;
224
- }
225
- get socket() {
226
- return this.webSocket;
227
- }
228
- get playerId() {
229
- return this.playerIdSignal();
230
- }
231
109
  }
232
110
 
233
111
  export { RpgClientEngine };
@@ -1 +1 @@
1
- {"version":3,"file":"index2.js","sources":["../src/RpgClientEngine.ts"],"sourcesContent":["import Canvas from \"./components/scenes/canvas.ce\";\nimport { Context, inject } from \"@signe/di\";\nimport { signal, bootstrapCanvas } from \"canvasengine\";\nimport { AbstractWebsocket, WebSocketToken } from \"./services/AbstractSocket\";\nimport { LoadMapService, LoadMapToken } from \"./services/loadMap\";\nimport { Hooks, ModulesToken } from \"@rpgjs/common\";\nimport { load } from \"@signe/sync\";\nimport { RpgClientMap } from \"./Game/Map\"\nimport { RpgGui } from \"./Gui/Gui\";\nimport { AnimationManager } from \"./Game/AnimationManager\";\nimport { lastValueFrom, Observable } from \"rxjs\";\nimport { GlobalConfigToken } from \"./module\";\nimport * as PIXI from \"pixi.js\";\nimport { PrebuiltComponentAnimations } from \"./components/animations\";\n\nexport class RpgClientEngine<T = any> {\n private guiService: RpgGui;\n private webSocket: AbstractWebsocket;\n private loadMapService: LoadMapService;\n private hooks: Hooks;\n private sceneMap: RpgClientMap = new RpgClientMap();\n private selector: HTMLElement;\n public globalConfig: T;\n public sceneComponent: any;\n stopProcessingInput = false;\n width = signal(\"100%\");\n height = signal(\"100%\");\n spritesheets: Map<string, any> = new Map();\n sounds: Map<string, any> = new Map();\n componentAnimations: any[] = [];\n particleSettings: {\n emitters: any[]\n } = {\n emitters: []\n }\n renderer: PIXI.Renderer;\n tick: Observable<number>;\n playerIdSignal = signal<string | null>(null);\n spriteComponentsBehind = signal<any[]>([]);\n spriteComponentsInFront = signal<any[]>([]);\n\n constructor(public context: Context) {\n this.webSocket = inject(context, WebSocketToken);\n this.guiService = inject(context, RpgGui);\n this.loadMapService = inject(context, LoadMapToken);\n this.hooks = inject<Hooks>(context, ModulesToken);\n this.globalConfig = inject(context, GlobalConfigToken)\n\n this.addComponentAnimation({\n id: \"animation\",\n component: PrebuiltComponentAnimations.Animation\n })\n }\n\n async start() {\n this.selector = document.body.querySelector(\"#rpg\") as HTMLElement;\n\n const { app, canvasElement } = await bootstrapCanvas(this.selector, Canvas);\n this.renderer = app.renderer as PIXI.Renderer;\n this.tick = canvasElement?.propObservables?.context['tick'].observable\n\n await lastValueFrom(this.hooks.callHooks(\"client-engine-onStart\", this));\n\n // wondow is resize\n window.addEventListener('resize', () => {\n this.hooks.callHooks(\"client-engine-onWindowResize\", this).subscribe();\n })\n\n this.tick.subscribe((tick) => {\n this.hooks.callHooks(\"client-engine-onStep\", this, tick).subscribe();\n })\n\n this.hooks.callHooks(\"client-spritesheets-load\", this).subscribe();\n this.hooks.callHooks(\"client-sounds-load\", this).subscribe();\n this.hooks.callHooks(\"client-gui-load\", this).subscribe();\n this.hooks.callHooks(\"client-particles-load\", this).subscribe();\n this.hooks.callHooks(\"client-componentAnimations-load\", this).subscribe();\n this.hooks.callHooks(\"client-sprite-load\", this).subscribe();\n\n \n await this.webSocket.connection(() => {\n this.initListeners()\n this.guiService._initialize()\n });\n }\n\n private initListeners() {\n this.webSocket.on(\"sync\", (data) => {\n if (data.pId) this.playerIdSignal.set(data.pId)\n this.hooks.callHooks(\"client-sceneMap-onChanges\", this.sceneMap, { partial: data }).subscribe();\n load(this.sceneMap, data, true);\n });\n\n this.webSocket.on(\"changeMap\", (data) => {\n this.loadScene(data.mapId);\n });\n\n this.webSocket.on(\"showComponentAnimation\", (data) => {\n const { params, object, position, id } = data;\n if (!object && position === undefined) {\n throw new Error(\"Please provide an object or x and y coordinates\");\n }\n const player = object ? this.sceneMap.getObjectById(object) : undefined;\n this.getComponentAnimation(id).displayEffect(params, player || position)\n });\n\n this.webSocket.on(\"setAnimation\", (data) => {\n const { animationName, nbTimes, object } = data;\n const player = this.sceneMap.getObjectById(object);\n player.setAnimation(animationName, nbTimes)\n })\n\n this.webSocket.on('open', () => {\n this.hooks.callHooks(\"client-engine-onConnected\", this, this.socket).subscribe();\n })\n\n this.webSocket.on('close', () => {\n this.hooks.callHooks(\"client-engine-onDisconnected\", this, this.socket).subscribe();\n })\n\n this.webSocket.on('error', (error) => {\n this.hooks.callHooks(\"client-engine-onConnectError\", this, error, this.socket).subscribe();\n })\n }\n \n private async loadScene(mapId: string) {\n this.webSocket.updateProperties({ room: mapId })\n await this.webSocket.reconnect(() => {\n this.initListeners()\n this.guiService._initialize()\n })\n const res = await this.loadMapService.load(mapId)\n this.sceneMap.data.set(res)\n this.hooks.callHooks(\"client-sceneMap-onAfterLoading\", this.sceneMap).subscribe();\n //this.sceneMap.loadPhysic()\n }\n\n addSpriteSheet<T = any>(spritesheetClass: any, id?: string): any {\n this.spritesheets.set(id || spritesheetClass.id, spritesheetClass);\n return spritesheetClass as any;\n }\n\n addSound(sound: any, id?: string) {\n this.sounds.set(id || sound.id, sound);\n return sound;\n }\n\n addParticle(particle: any) {\n this.particleSettings.emitters.push(particle)\n return particle;\n }\n\n /**\n * Add a component to render behind sprites\n * Components added with this method will be displayed with a lower z-index than the sprite\n * \n * @param component - The component to add behind sprites\n * @returns The added component\n * \n * @example\n * ```ts\n * // Add a shadow component behind all sprites\n * engine.addSpriteComponentBehind(ShadowComponent);\n * ```\n */\n addSpriteComponentBehind(component: any) {\n this.spriteComponentsBehind.update((components: any[]) => [...components, component])\n return component\n }\n\n /**\n * Add a component to render in front of sprites\n * Components added with this method will be displayed with a higher z-index than the sprite\n * \n * @param component - The component to add in front of sprites\n * @returns The added component\n * \n * @example\n * ```ts\n * // Add a health bar component in front of all sprites\n * engine.addSpriteComponentInFront(HealthBarComponent);\n * ```\n */\n addSpriteComponentInFront(component: any) {\n this.spriteComponentsInFront.update((components: any[]) => [...components, component])\n return component\n }\n\n /**\n * Add a component animation to the engine\n * \n * Component animations are temporary visual effects that can be displayed\n * on sprites or objects, such as hit indicators, spell effects, or status animations.\n * \n * @param componentAnimation - The component animation configuration\n * @param componentAnimation.id - Unique identifier for the animation\n * @param componentAnimation.component - The component function to render\n * @returns The added component animation configuration\n * \n * @example\n * ```ts\n * // Add a hit animation component\n * engine.addComponentAnimation({\n * id: 'hit',\n * component: HitComponent\n * });\n * \n * // Add an explosion effect component\n * engine.addComponentAnimation({\n * id: 'explosion',\n * component: ExplosionComponent\n * });\n * ```\n */\n addComponentAnimation(componentAnimation: {\n component: any,\n id: string\n }) {\n const instance = new AnimationManager()\n this.componentAnimations.push({\n id: componentAnimation.id,\n component: componentAnimation.component,\n instance: instance,\n current: instance.current\n })\n return componentAnimation;\n }\n\n /**\n * Get a component animation by its ID\n * \n * Retrieves the EffectManager instance for a specific component animation,\n * which can be used to display the animation on sprites or objects.\n * \n * @param id - The unique identifier of the component animation\n * @returns The EffectManager instance for the animation\n * @throws Error if the component animation is not found\n * \n * @example\n * ```ts\n * // Get the hit animation and display it\n * const hitAnimation = engine.getComponentAnimation('hit');\n * hitAnimation.displayEffect({ text: \"Critical!\" }, player);\n * ```\n */\n getComponentAnimation(id: string): AnimationManager {\n const componentAnimation = this.componentAnimations.find((componentAnimation) => componentAnimation.id === id)\n if (!componentAnimation) {\n throw new Error(`Component animation with id ${id} not found`)\n }\n return componentAnimation.instance\n }\n\n processInput({ input }: { input: number }) {\n this.hooks.callHooks(\"client-engine-onInput\", this, { input, playerId: this.playerId }).subscribe();\n this.webSocket.emit('move', { input })\n }\n\n processAction({ action }: { action: number }) {\n if (this.stopProcessingInput) return;\n this.hooks.callHooks(\"client-engine-onInput\", this, { input: 'action', playerId: this.playerId }).subscribe();\n this.webSocket.emit('action', { action })\n }\n\n get PIXI() {\n return PIXI\n }\n\n get socket() {\n return this.webSocket\n }\n \n get playerId() {\n return this.playerIdSignal()\n }\n}\n"],"names":["Canvas","componentAnimation"],"mappings":";;;;;;;;;;;;;;;AAeO,MAAM,eAAyB,CAAA;AAAA,EA0BpC,YAAmB,OAAkB,EAAA;AAAlB,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AArBnB,IAAQ,IAAA,CAAA,QAAA,GAAyB,IAAI,YAAa,EAAA;AAIlD,IAAsB,IAAA,CAAA,mBAAA,GAAA,KAAA;AACtB,IAAA,IAAA,CAAA,KAAA,GAAQ,OAAO,MAAM,CAAA;AACrB,IAAA,IAAA,CAAA,MAAA,GAAS,OAAO,MAAM,CAAA;AACtB,IAAA,IAAA,CAAA,YAAA,uBAAqC,GAAI,EAAA;AACzC,IAAA,IAAA,CAAA,MAAA,uBAA+B,GAAI,EAAA;AACnC,IAAA,IAAA,CAAA,mBAAA,GAA6B,EAAC;AAC9B,IAEI,IAAA,CAAA,gBAAA,GAAA;AAAA,MACF,UAAU;AAAC,KACb;AAGA,IAAA,IAAA,CAAA,cAAA,GAAiB,OAAsB,IAAI,CAAA;AAC3C,IAAyB,IAAA,CAAA,sBAAA,GAAA,MAAA,CAAc,EAAE,CAAA;AACzC,IAA0B,IAAA,CAAA,uBAAA,GAAA,MAAA,CAAc,EAAE,CAAA;AAGxC,IAAK,IAAA,CAAA,SAAA,GAAY,MAAO,CAAA,OAAA,EAAS,cAAc,CAAA;AAC/C,IAAK,IAAA,CAAA,UAAA,GAAa,MAAO,CAAA,OAAA,EAAS,MAAM,CAAA;AACxC,IAAK,IAAA,CAAA,cAAA,GAAiB,MAAO,CAAA,OAAA,EAAS,YAAY,CAAA;AAClD,IAAK,IAAA,CAAA,KAAA,GAAQ,MAAc,CAAA,OAAA,EAAS,YAAY,CAAA;AAChD,IAAK,IAAA,CAAA,YAAA,GAAe,MAAO,CAAA,OAAA,EAAS,iBAAiB,C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K,SAAU,CAAA,IAAA,CAAK,MAAQ,EAAA,EAAE,OAAO,CAAA;AAAA;AACvC,EAEA,aAAA,CAAc,EAAE,MAAA,EAA8B,EAAA;AAC5C,IAAA,IAAI,KAAK,mBAAqB,EAAA;AAC9B,IAAA,IAAA,CAAK,KAAM,CAAA,SAAA,CAAU,uBAAyB,EAAA,IAAA,EAAM,EAAE,KAAA,EAAO,QAAU,EAAA,QAAA,EAAU,IAAK,CAAA,QAAA,EAAU,CAAA,CAAE,SAAU,EAAA;AAC5G,IAAA,IAAA,CAAK,SAAU,CAAA,IAAA,CAAK,QAAU,EAAA,EAAE,QAAQ,CAAA;AAAA;AAC1C,EAEA,IAAI,IAAO,GAAA;AACT,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,IAAI,MAAS,GAAA;AACX,IAAA,OAAO,IAAK,CAAA,SAAA;AAAA;AACd,EAEA,IAAI,QAAW,GAAA;AACb,IAAA,OAAO,KAAK,cAAe,EAAA;AAAA;AAE/B;;;;"}
1
+ {"version":3,"file":"index2.js","sources":["../src/RpgClientEngine.ts"],"sourcesContent":["import Canvas from \"./components/scenes/canvas.ce\";\nimport { Context, inject } from \"@signe/di\";\nimport { signal, bootstrapCanvas } from \"canvasengine\";\nimport { AbstractWebsocket, WebSocketToken } from \"./services/AbstractSocket\";\nimport { LoadMapService, LoadMapToken } from \"./services/loadMap\";\nimport { Hooks, ModulesToken } from \"@rpgjs/common\";\nimport { load } from \"@signe/sync\";\nimport { RpgClientMap } from \"./Game/Map\"\nimport { RpgGui } from \"./Gui/Gui\";\nimport { EffectManager } from \"./Game/EffectManager\";\nimport { lastValueFrom } from \"rxjs\";\nimport { GlobalConfigToken } from \"./module\";\nimport { ClientIo } from \"@signe/room\";\n\nexport class RpgClientEngine<T = any> {\n private guiService: RpgGui;\n private webSocket: AbstractWebsocket;\n private loadMapService: LoadMapService;\n private hooks: Hooks;\n private sceneMap: RpgClientMap = new RpgClientMap();\n private selector: HTMLElement;\n public globalConfig: T;\n public sceneComponent: any;\n stopProcessingInput = false;\n\n width = signal(\"100%\");\n height = signal(\"100%\");\n spritesheets: Map<string, any> = new Map();\n sounds: Map<string, any> = new Map();\n effects: any[] = [];\n particleSettings: {\n emitters: any[]\n } = {\n emitters: []\n }\n\n constructor(public context: Context) {\n this.webSocket = inject(context, WebSocketToken);\n this.guiService = inject(context, RpgGui);\n this.loadMapService = inject(context, LoadMapToken);\n this.hooks = inject<Hooks>(context, ModulesToken);\n this.globalConfig = inject(context, GlobalConfigToken)\n }\n\n async start() {\n this.selector = document.body.querySelector(\"#rpg\") as HTMLElement;\n\n await bootstrapCanvas(this.selector, Canvas);\n\n await lastValueFrom(this.hooks.callHooks(\"client-engine-onStart\", this));\n\n this.hooks.callHooks(\"client-spritesheets-load\", this).subscribe();\n this.hooks.callHooks(\"client-sounds-load\", this).subscribe();\n this.hooks.callHooks(\"client-gui-load\", this).subscribe();\n this.hooks.callHooks(\"client-particles-load\", this).subscribe();\n this.hooks.callHooks(\"client-effects-load\", this).subscribe();\n\n \n await this.webSocket.connection(() => {\n this.initListeners()\n this.guiService._initialize()\n });\n }\n\n private initListeners() {\n this.webSocket.on(\"sync\", (data) => {\n load(this.sceneMap, data, true);\n });\n\n this.webSocket.on(\"changeMap\", (data) => {\n this.loadScene(data.mapId);\n });\n\n this.webSocket.on(\"showEffect\", (data) => {\n const { params, object, id } = data;\n if (!object) {\n throw new Error(\"Object not found\");\n }\n const player = this.sceneMap.getObjectById(object);\n this.getEffect(id).displayEffect(params, player)\n });\n }\n \n private async loadScene(mapId: string) {\n this.webSocket.updateProperties({ room: mapId })\n await this.webSocket.reconnect(() => {\n this.initListeners()\n this.guiService._initialize()\n })\n const res = await this.loadMapService.load(mapId)\n this.sceneMap.data.set(res)\n this.hooks.callHooks(\"client-sceneMap-onAfterLoading\", this.sceneMap).subscribe();\n //this.sceneMap.loadPhysic()\n }\n\n addSpriteSheet<T = any>(spritesheetClass: any, id?: string): any {\n this.spritesheets.set(id || spritesheetClass.id, spritesheetClass);\n return spritesheetClass as any;\n }\n\n addSound(sound: any, id?: string) {\n this.sounds.set(id || sound.id, sound);\n return sound;\n }\n\n addParticle(particle: any) {\n this.particleSettings.emitters.push(particle)\n return particle;\n }\n\n addEffect(effect: {\n component: any,\n id: string\n }) {\n const instance = new EffectManager()\n this.effects.push({\n id: effect.id,\n component: effect.component,\n instance: instance,\n current: instance.current\n })\n return effect;\n }\n\n getEffect(id: string): EffectManager {\n const effect = this.effects.find((effect) => effect.id === id)\n if (!effect) {\n throw new Error(`Effect with id ${id} not found`)\n }\n return effect.instance\n }\n\n processInput({ input }: { input: number }) {\n this.webSocket.emit('move', { input })\n }\n\n processAction({ action }: { action: number }) {\n if (this.stopProcessingInput) return;\n this.webSocket.emit('action', { action })\n }\n}\n"],"names":["Canvas","effect"],"mappings":";;;;;;;;;;;;;AAcO,MAAM,eAAyB,CAAA;AAAA,EAsBpC,YAAmB,OAAkB,EAAA;AAAlB,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAjBnB,IAAQ,IAAA,CAAA,QAAA,GAAyB,IAAI,YAAa,EAAA;AAIlD,IAAsB,IAAA,CAAA,mBAAA,GAAA,KAAA;AAEtB,IAAA,IAAA,CAAA,KAAA,GAAQ,OAAO,MAAM,CAAA;AACrB,IAAA,IAAA,CAAA,MAAA,GAAS,OAAO,MAAM,CAAA;AACtB,IAAA,IAAA,CAAA,YAAA,uBAAqC,GAAI,EAAA;AACzC,IAAA,IAAA,CAAA,MAAA,uBAA+B,GAAI,EAAA;AACnC,IAAA,IAAA,CAAA,OAAA,GAAiB,EAAC;AAClB,IAEI,IAAA,CAAA,gBAAA,GAAA;AAAA,MACF,UAAU;AAAC,KACb;AAGE,IAAK,IAAA,CAAA,SAAA,GAAY,MAAO,CAAA,OAAA,EAAS,cAAc,CAAA;AAC/C,IAAK,IAAA,CAAA,UAAA,GAAa,MAAO,CAAA,OAAA,EAAS,MAAM,CAAA;AACxC,IAAK,IAAA,CAAA,cAAA,GAAiB,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