@drincs/nqtr 0.2.6 → 0.2.8

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 (77) hide show
  1. package/dist/{StageProps-DVGvhQgr.d.ts → StageProps-ssZax5Ip.d.ts} +18 -22
  2. package/dist/{StageProps-BP4soUUZ.d.mts → StageProps-vuObH5D2.d.mts} +18 -22
  3. package/dist/classes/index.d.mts +1 -2
  4. package/dist/classes/index.d.ts +1 -2
  5. package/dist/classes/index.js +11 -14
  6. package/dist/classes/index.js.map +1 -1
  7. package/dist/classes/index.mjs +11 -14
  8. package/dist/classes/index.mjs.map +1 -1
  9. package/dist/classes/navigation/Room.js.map +1 -1
  10. package/dist/classes/navigation/Room.mjs.map +1 -1
  11. package/dist/classes/quest/Quest.d.mts +1 -2
  12. package/dist/classes/quest/Quest.d.ts +1 -2
  13. package/dist/classes/quest/Quest.js +11 -14
  14. package/dist/classes/quest/Quest.js.map +1 -1
  15. package/dist/classes/quest/Quest.mjs +11 -14
  16. package/dist/classes/quest/Quest.mjs.map +1 -1
  17. package/dist/classes/quest/Stage.d.mts +1 -2
  18. package/dist/classes/quest/Stage.d.ts +1 -2
  19. package/dist/classes/quest/Stage.js.map +1 -1
  20. package/dist/classes/quest/Stage.mjs.map +1 -1
  21. package/dist/decorators/QuestDecorator.d.mts +1 -2
  22. package/dist/decorators/QuestDecorator.d.ts +1 -2
  23. package/dist/decorators/QuestDecorator.js +11 -14
  24. package/dist/decorators/QuestDecorator.js.map +1 -1
  25. package/dist/decorators/QuestDecorator.mjs +11 -14
  26. package/dist/decorators/QuestDecorator.mjs.map +1 -1
  27. package/dist/decorators/index.d.mts +1 -2
  28. package/dist/decorators/index.d.ts +1 -2
  29. package/dist/decorators/index.js +11 -14
  30. package/dist/decorators/index.js.map +1 -1
  31. package/dist/decorators/index.mjs +11 -14
  32. package/dist/decorators/index.mjs.map +1 -1
  33. package/dist/functions/ActivityFunctions.js.map +1 -1
  34. package/dist/functions/ActivityFunctions.mjs.map +1 -1
  35. package/dist/functions/NavigationFunctions.js.map +1 -1
  36. package/dist/functions/NavigationFunctions.mjs.map +1 -1
  37. package/dist/functions/QuestFunctions.d.mts +2 -2
  38. package/dist/functions/QuestFunctions.d.ts +2 -2
  39. package/dist/functions/QuestFunctions.js.map +1 -1
  40. package/dist/functions/QuestFunctions.mjs.map +1 -1
  41. package/dist/functions/RoutineFunctions.js.map +1 -1
  42. package/dist/functions/RoutineFunctions.mjs.map +1 -1
  43. package/dist/functions/index.js.map +1 -1
  44. package/dist/functions/index.mjs.map +1 -1
  45. package/dist/index.d.mts +1 -2
  46. package/dist/index.d.ts +1 -2
  47. package/dist/index.js +11 -14
  48. package/dist/index.js.map +1 -1
  49. package/dist/index.mjs +11 -14
  50. package/dist/index.mjs.map +1 -1
  51. package/dist/interface/index.d.mts +1 -2
  52. package/dist/interface/index.d.ts +1 -2
  53. package/dist/interface/quest/QuestProps.d.mts +1 -2
  54. package/dist/interface/quest/QuestProps.d.ts +1 -2
  55. package/dist/interface/quest/StageProps.d.mts +1 -2
  56. package/dist/interface/quest/StageProps.d.ts +1 -2
  57. package/dist/override/{OnStartStageQuest.d.mts → OnStartEndStageQuest.d.mts} +3 -3
  58. package/dist/override/{OnStartStageQuest.d.ts → OnStartEndStageQuest.d.ts} +3 -3
  59. package/dist/override/OnStartEndStageQuest.js +4 -0
  60. package/dist/override/OnStartEndStageQuest.mjs +3 -0
  61. package/dist/override/index.d.mts +1 -2
  62. package/dist/override/index.d.ts +1 -2
  63. package/dist/types/QuestsRequired.d.mts +1 -2
  64. package/dist/types/QuestsRequired.d.ts +1 -2
  65. package/dist/types/index.d.mts +1 -2
  66. package/dist/types/index.d.ts +1 -2
  67. package/package.json +2 -2
  68. package/dist/override/OnEndStageQuest.d.mts +0 -19
  69. package/dist/override/OnEndStageQuest.d.ts +0 -19
  70. package/dist/override/OnEndStageQuest.js +0 -4
  71. package/dist/override/OnEndStageQuest.mjs +0 -3
  72. package/dist/override/OnStartStageQuest.js +0 -4
  73. package/dist/override/OnStartStageQuest.js.map +0 -1
  74. package/dist/override/OnStartStageQuest.mjs +0 -3
  75. package/dist/override/OnStartStageQuest.mjs.map +0 -1
  76. /package/dist/override/{OnEndStageQuest.js.map → OnStartEndStageQuest.js.map} +0 -0
  77. /package/dist/override/{OnEndStageQuest.mjs.map → OnStartEndStageQuest.mjs.map} +0 -0
@@ -1,8 +1,7 @@
1
- import { OnRenderGraphicItemProps, GraphicItemType, OnStartStageQuest, OnEndStageQuest } from '@drincs/nqtr/dist/override';
1
+ import { OnRenderGraphicItemProps, GraphicItemType, OnStartEndStageQuest } from '@drincs/nqtr/dist/override';
2
2
  import { StoredClassModel } from '@drincs/pixi-vn';
3
3
  import Goal, { GoalStage } from './classes/quest/Goal.js';
4
4
  import StageFlags from './interface/quest/StageFlags.js';
5
- import OnEndStageQuest$1 from './override/OnEndStageQuest.js';
6
5
 
7
6
  declare class Stage extends StoredClassModel implements StageProps {
8
7
  constructor(id: string, props: StageProps);
@@ -61,12 +60,12 @@ declare class Stage extends StoredClassModel implements StageProps {
61
60
  /**
62
61
  * The function that will be called when the stage starts.
63
62
  */
64
- get onStart(): undefined | ((props: OnStartStageQuest) => void);
63
+ get onStart(): undefined | ((props: OnStartEndStageQuest) => void);
65
64
  private _onEnd?;
66
65
  /**
67
66
  * The function that will be called when the stage ends.
68
67
  */
69
- get onEnd(): undefined | ((props: OnEndStageQuest) => void);
68
+ get onEnd(): undefined | ((props: OnStartEndStageQuest) => void);
70
69
  }
71
70
  declare class StageQuest extends Stage {
72
71
  constructor(id: string, props: StageProps);
@@ -102,7 +101,7 @@ declare class StageQuest extends Stage {
102
101
  /**
103
102
  * The function that will be called when the stage starts.
104
103
  */
105
- start(props: OnStartStageQuest): void;
104
+ start(props: OnStartEndStageQuest): void;
106
105
  }
107
106
 
108
107
  declare class Quest extends StoredClassModel {
@@ -158,42 +157,39 @@ declare class Quest extends StoredClassModel {
158
157
  /**
159
158
  * The function that will be called when the quest starts.
160
159
  */
161
- get onStart(): undefined | ((props: OnStartStageQuest) => void);
160
+ get onStart(): undefined | ((props: OnStartEndStageQuest) => void);
162
161
  private _onNextStage?;
163
162
  /**
164
163
  * The function that will be called when the quest goes to the next stage.
165
164
  */
166
- get onNextStage(): undefined | ((props: OnEndStageQuest) => void);
165
+ get onNextStage(): undefined | ((props: OnStartEndStageQuest) => void);
167
166
  /**
168
167
  * Start the quest.
169
168
  * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
170
169
  * @returns
171
170
  */
172
- start(props: OnStartStageQuest): void;
171
+ start(props: OnStartEndStageQuest): void;
173
172
  /**
174
173
  * Go to the next stage if the current stage is completed.
175
174
  * If you want to force the change of stage, use goNextStage.
176
- * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
177
- * @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
175
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
178
176
  * @returns true if the stage was changed, false otherwise.
179
177
  */
180
- tryToGoNextStage(startProps: OnStartStageQuest, endProps: OnEndStageQuest): boolean;
178
+ tryToGoNextStage(props: OnStartEndStageQuest): boolean;
181
179
  /**
182
180
  * Complete the current stage and go to the next stage.
183
181
  * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
184
- * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
185
- * @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
182
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
186
183
  * @returns true if the stage was changed, false otherwise.
187
184
  */
188
- completeCurrentStageAndGoNext(startProps: OnStartStageQuest, endProps: OnEndStageQuest): boolean;
185
+ completeCurrentStageAndGoNext(props: OnStartEndStageQuest): boolean;
189
186
  /**
190
187
  * Go to the next stage without checking if the current stage is completed.
191
188
  * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
192
- * @param startProps
193
- * @param endProps
189
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
194
190
  * @returns returns true if the stage was changed, false otherwise.
195
191
  */
196
- goNextStage(startProps: OnStartStageQuest, endProps: OnEndStageQuest): boolean;
192
+ goNextStage(props: OnStartEndStageQuest): boolean;
197
193
  /**
198
194
  * If the current stage must start. It is true if the current stage is not started, can start and not completed.
199
195
  */
@@ -202,7 +198,7 @@ declare class Quest extends StoredClassModel {
202
198
  * Start the current stage.
203
199
  * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
204
200
  */
205
- startCurrentStage(props: OnStartStageQuest): void;
201
+ startCurrentStage(props: OnStartEndStageQuest): void;
206
202
  }
207
203
 
208
204
  type QuestsRequiredType = {
@@ -249,11 +245,11 @@ interface QuestProps {
249
245
  /**
250
246
  * The function that will be executed when the quest starts.
251
247
  */
252
- onStart?: (quest: Quest, props: OnStartStageQuest) => void;
248
+ onStart?: (quest: Quest, props: OnStartEndStageQuest) => void;
253
249
  /**
254
250
  * The function that will be executed when a stage end in the quest.
255
251
  */
256
- onNextStage?: (quest: Quest, props: OnEndStageQuest$1) => void;
252
+ onNextStage?: (quest: Quest, props: OnStartEndStageQuest) => void;
257
253
  }
258
254
 
259
255
  interface StageProps {
@@ -320,11 +316,11 @@ interface StageProps {
320
316
  /**
321
317
  * The function that will be executed when the stage starts.
322
318
  */
323
- onStart?: (stage: Stage, props: OnStartStageQuest) => void;
319
+ onStart?: (stage: Stage, props: OnStartEndStageQuest) => void;
324
320
  /**
325
321
  * The function that will be executed when the stage ends.
326
322
  */
327
- onEnd?: (stage: Stage, props: OnEndStageQuest) => void;
323
+ onEnd?: (stage: Stage, props: OnStartEndStageQuest) => void;
328
324
  }
329
325
 
330
326
  export { Quest as Q, Stage as S, type QuestProps as a, type StageProps as b, type QuestsRequiredType as c, StageQuest as d };
@@ -1,8 +1,7 @@
1
- import { OnRenderGraphicItemProps, GraphicItemType, OnStartStageQuest, OnEndStageQuest } from '@drincs/nqtr/dist/override';
1
+ import { OnRenderGraphicItemProps, GraphicItemType, OnStartEndStageQuest } from '@drincs/nqtr/dist/override';
2
2
  import { StoredClassModel } from '@drincs/pixi-vn';
3
3
  import Goal, { GoalStage } from './classes/quest/Goal.mjs';
4
4
  import StageFlags from './interface/quest/StageFlags.mjs';
5
- import OnEndStageQuest$1 from './override/OnEndStageQuest.mjs';
6
5
 
7
6
  declare class Stage extends StoredClassModel implements StageProps {
8
7
  constructor(id: string, props: StageProps);
@@ -61,12 +60,12 @@ declare class Stage extends StoredClassModel implements StageProps {
61
60
  /**
62
61
  * The function that will be called when the stage starts.
63
62
  */
64
- get onStart(): undefined | ((props: OnStartStageQuest) => void);
63
+ get onStart(): undefined | ((props: OnStartEndStageQuest) => void);
65
64
  private _onEnd?;
66
65
  /**
67
66
  * The function that will be called when the stage ends.
68
67
  */
69
- get onEnd(): undefined | ((props: OnEndStageQuest) => void);
68
+ get onEnd(): undefined | ((props: OnStartEndStageQuest) => void);
70
69
  }
71
70
  declare class StageQuest extends Stage {
72
71
  constructor(id: string, props: StageProps);
@@ -102,7 +101,7 @@ declare class StageQuest extends Stage {
102
101
  /**
103
102
  * The function that will be called when the stage starts.
104
103
  */
105
- start(props: OnStartStageQuest): void;
104
+ start(props: OnStartEndStageQuest): void;
106
105
  }
107
106
 
108
107
  declare class Quest extends StoredClassModel {
@@ -158,42 +157,39 @@ declare class Quest extends StoredClassModel {
158
157
  /**
159
158
  * The function that will be called when the quest starts.
160
159
  */
161
- get onStart(): undefined | ((props: OnStartStageQuest) => void);
160
+ get onStart(): undefined | ((props: OnStartEndStageQuest) => void);
162
161
  private _onNextStage?;
163
162
  /**
164
163
  * The function that will be called when the quest goes to the next stage.
165
164
  */
166
- get onNextStage(): undefined | ((props: OnEndStageQuest) => void);
165
+ get onNextStage(): undefined | ((props: OnStartEndStageQuest) => void);
167
166
  /**
168
167
  * Start the quest.
169
168
  * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
170
169
  * @returns
171
170
  */
172
- start(props: OnStartStageQuest): void;
171
+ start(props: OnStartEndStageQuest): void;
173
172
  /**
174
173
  * Go to the next stage if the current stage is completed.
175
174
  * If you want to force the change of stage, use goNextStage.
176
- * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
177
- * @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
175
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
178
176
  * @returns true if the stage was changed, false otherwise.
179
177
  */
180
- tryToGoNextStage(startProps: OnStartStageQuest, endProps: OnEndStageQuest): boolean;
178
+ tryToGoNextStage(props: OnStartEndStageQuest): boolean;
181
179
  /**
182
180
  * Complete the current stage and go to the next stage.
183
181
  * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
184
- * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
185
- * @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
182
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
186
183
  * @returns true if the stage was changed, false otherwise.
187
184
  */
188
- completeCurrentStageAndGoNext(startProps: OnStartStageQuest, endProps: OnEndStageQuest): boolean;
185
+ completeCurrentStageAndGoNext(props: OnStartEndStageQuest): boolean;
189
186
  /**
190
187
  * Go to the next stage without checking if the current stage is completed.
191
188
  * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
192
- * @param startProps
193
- * @param endProps
189
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
194
190
  * @returns returns true if the stage was changed, false otherwise.
195
191
  */
196
- goNextStage(startProps: OnStartStageQuest, endProps: OnEndStageQuest): boolean;
192
+ goNextStage(props: OnStartEndStageQuest): boolean;
197
193
  /**
198
194
  * If the current stage must start. It is true if the current stage is not started, can start and not completed.
199
195
  */
@@ -202,7 +198,7 @@ declare class Quest extends StoredClassModel {
202
198
  * Start the current stage.
203
199
  * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
204
200
  */
205
- startCurrentStage(props: OnStartStageQuest): void;
201
+ startCurrentStage(props: OnStartEndStageQuest): void;
206
202
  }
207
203
 
208
204
  type QuestsRequiredType = {
@@ -249,11 +245,11 @@ interface QuestProps {
249
245
  /**
250
246
  * The function that will be executed when the quest starts.
251
247
  */
252
- onStart?: (quest: Quest, props: OnStartStageQuest) => void;
248
+ onStart?: (quest: Quest, props: OnStartEndStageQuest) => void;
253
249
  /**
254
250
  * The function that will be executed when a stage end in the quest.
255
251
  */
256
- onNextStage?: (quest: Quest, props: OnEndStageQuest$1) => void;
252
+ onNextStage?: (quest: Quest, props: OnStartEndStageQuest) => void;
257
253
  }
258
254
 
259
255
  interface StageProps {
@@ -320,11 +316,11 @@ interface StageProps {
320
316
  /**
321
317
  * The function that will be executed when the stage starts.
322
318
  */
323
- onStart?: (stage: Stage, props: OnStartStageQuest) => void;
319
+ onStart?: (stage: Stage, props: OnStartEndStageQuest) => void;
324
320
  /**
325
321
  * The function that will be executed when the stage ends.
326
322
  */
327
- onEnd?: (stage: Stage, props: OnEndStageQuest) => void;
323
+ onEnd?: (stage: Stage, props: OnStartEndStageQuest) => void;
328
324
  }
329
325
 
330
326
  export { Quest as Q, Stage as S, type QuestProps as a, type StageProps as b, type QuestsRequiredType as c, StageQuest as d };
@@ -1,6 +1,6 @@
1
1
  export { A as ActivityRoom, C as CommitmentBaseModel, L as LocationBaseModel, M as MapBaseModel, R as RoomBaseModel } from '../Commitment-BHB-jYOi.mjs';
2
2
  export { default as Goal } from './quest/Goal.mjs';
3
- export { Q as Quest, S as Stage } from '../StageProps-BP4soUUZ.mjs';
3
+ export { Q as Quest, S as Stage } from '../StageProps-vuObH5D2.mjs';
4
4
  import '@drincs/nqtr/dist/override';
5
5
  import '@drincs/pixi-vn';
6
6
  import '../ActivityProps-D45DQdcT.mjs';
@@ -10,4 +10,3 @@ import '../types/ExecutionType.mjs';
10
10
  import '../types/OnRunCommitmentEvent.mjs';
11
11
  import '../interface/quest/GoalProps.mjs';
12
12
  import '../interface/quest/StageFlags.mjs';
13
- import '../override/OnEndStageQuest.mjs';
@@ -1,6 +1,6 @@
1
1
  export { A as ActivityRoom, C as CommitmentBaseModel, L as LocationBaseModel, M as MapBaseModel, R as RoomBaseModel } from '../Commitment-D-1lsnnU.js';
2
2
  export { default as Goal } from './quest/Goal.js';
3
- export { Q as Quest, S as Stage } from '../StageProps-DVGvhQgr.js';
3
+ export { Q as Quest, S as Stage } from '../StageProps-ssZax5Ip.js';
4
4
  import '@drincs/nqtr/dist/override';
5
5
  import '@drincs/pixi-vn';
6
6
  import '../ActivityProps-BkHX8xkA.js';
@@ -10,4 +10,3 @@ import '../types/ExecutionType.js';
10
10
  import '../types/OnRunCommitmentEvent.js';
11
11
  import '../interface/quest/GoalProps.js';
12
12
  import '../interface/quest/StageFlags.js';
13
- import '../override/OnEndStageQuest.js';
@@ -1339,11 +1339,10 @@ var Quest = class extends pixiVn.StoredClassModel {
1339
1339
  /**
1340
1340
  * Go to the next stage if the current stage is completed.
1341
1341
  * If you want to force the change of stage, use goNextStage.
1342
- * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
1343
- * @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
1342
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
1344
1343
  * @returns true if the stage was changed, false otherwise.
1345
1344
  */
1346
- tryToGoNextStage(startProps, endProps) {
1345
+ tryToGoNextStage(props) {
1347
1346
  if (!this.started) {
1348
1347
  return false;
1349
1348
  }
@@ -1356,34 +1355,32 @@ var Quest = class extends pixiVn.StoredClassModel {
1356
1355
  return false;
1357
1356
  }
1358
1357
  if (currentStage.completed) {
1359
- return this.goNextStage(startProps, endProps);
1358
+ return this.goNextStage(props);
1360
1359
  }
1361
1360
  return false;
1362
1361
  }
1363
1362
  /**
1364
1363
  * Complete the current stage and go to the next stage.
1365
1364
  * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
1366
- * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
1367
- * @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
1365
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
1368
1366
  * @returns true if the stage was changed, false otherwise.
1369
1367
  */
1370
- completeCurrentStageAndGoNext(startProps, endProps) {
1368
+ completeCurrentStageAndGoNext(props) {
1371
1369
  let currentStage = this.currentStage;
1372
1370
  if (!currentStage) {
1373
1371
  console.error(`[NQTR] Quest ${this.id} has no current stage`);
1374
1372
  return false;
1375
1373
  }
1376
1374
  currentStage.completed = true;
1377
- return this.goNextStage(startProps, endProps);
1375
+ return this.goNextStage(props);
1378
1376
  }
1379
1377
  /**
1380
1378
  * Go to the next stage without checking if the current stage is completed.
1381
1379
  * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
1382
- * @param startProps
1383
- * @param endProps
1380
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
1384
1381
  * @returns returns true if the stage was changed, false otherwise.
1385
1382
  */
1386
- goNextStage(startProps, endProps) {
1383
+ goNextStage(props) {
1387
1384
  if (!this.started) {
1388
1385
  console.warn(`[NQTR] Quest ${this.id} is not started`);
1389
1386
  return false;
@@ -1399,15 +1396,15 @@ var Quest = class extends pixiVn.StoredClassModel {
1399
1396
  return false;
1400
1397
  }
1401
1398
  this.currentStageIndex = currentStageIndex + 1;
1402
- this.onNextStage && this.onNextStage(endProps);
1399
+ this.onNextStage && this.onNextStage(props);
1403
1400
  if (prevStage && prevStage.onEnd) {
1404
- prevStage.onEnd(endProps);
1401
+ prevStage.onEnd(props);
1405
1402
  }
1406
1403
  let nextCurrentStage = this.currentStage;
1407
1404
  if (nextCurrentStage) {
1408
1405
  nextCurrentStage.inizialize();
1409
1406
  if (this.currentStageMustStart) {
1410
- this.startCurrentStage(startProps);
1407
+ this.startCurrentStage(props);
1411
1408
  }
1412
1409
  }
1413
1410
  return true;