@drincs/nqtr 0.2.7 → 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 (61) hide show
  1. package/dist/{StageProps-Bok_NwL7.d.ts → StageProps-ssZax5Ip.d.ts} +18 -21
  2. package/dist/{StageProps-CFQizpZF.d.mts → StageProps-vuObH5D2.d.mts} +18 -21
  3. package/dist/classes/index.d.mts +1 -1
  4. package/dist/classes/index.d.ts +1 -1
  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 -1
  12. package/dist/classes/quest/Quest.d.ts +1 -1
  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 -1
  18. package/dist/classes/quest/Stage.d.ts +1 -1
  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 -1
  22. package/dist/decorators/QuestDecorator.d.ts +1 -1
  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 -1
  28. package/dist/decorators/index.d.ts +1 -1
  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 -1
  46. package/dist/index.d.ts +1 -1
  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 -1
  52. package/dist/interface/index.d.ts +1 -1
  53. package/dist/interface/quest/QuestProps.d.mts +1 -1
  54. package/dist/interface/quest/QuestProps.d.ts +1 -1
  55. package/dist/interface/quest/StageProps.d.mts +1 -1
  56. package/dist/interface/quest/StageProps.d.ts +1 -1
  57. package/dist/types/QuestsRequired.d.mts +1 -1
  58. package/dist/types/QuestsRequired.d.ts +1 -1
  59. package/dist/types/index.d.mts +1 -1
  60. package/dist/types/index.d.ts +1 -1
  61. package/package.json +2 -2
@@ -1,4 +1,4 @@
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';
@@ -60,12 +60,12 @@ declare class Stage extends StoredClassModel implements StageProps {
60
60
  /**
61
61
  * The function that will be called when the stage starts.
62
62
  */
63
- get onStart(): undefined | ((props: OnStartStageQuest) => void);
63
+ get onStart(): undefined | ((props: OnStartEndStageQuest) => void);
64
64
  private _onEnd?;
65
65
  /**
66
66
  * The function that will be called when the stage ends.
67
67
  */
68
- get onEnd(): undefined | ((props: OnEndStageQuest) => void);
68
+ get onEnd(): undefined | ((props: OnStartEndStageQuest) => void);
69
69
  }
70
70
  declare class StageQuest extends Stage {
71
71
  constructor(id: string, props: StageProps);
@@ -101,7 +101,7 @@ declare class StageQuest extends Stage {
101
101
  /**
102
102
  * The function that will be called when the stage starts.
103
103
  */
104
- start(props: OnStartStageQuest): void;
104
+ start(props: OnStartEndStageQuest): void;
105
105
  }
106
106
 
107
107
  declare class Quest extends StoredClassModel {
@@ -157,42 +157,39 @@ declare class Quest extends StoredClassModel {
157
157
  /**
158
158
  * The function that will be called when the quest starts.
159
159
  */
160
- get onStart(): undefined | ((props: OnStartStageQuest) => void);
160
+ get onStart(): undefined | ((props: OnStartEndStageQuest) => void);
161
161
  private _onNextStage?;
162
162
  /**
163
163
  * The function that will be called when the quest goes to the next stage.
164
164
  */
165
- get onNextStage(): undefined | ((props: OnEndStageQuest) => void);
165
+ get onNextStage(): undefined | ((props: OnStartEndStageQuest) => void);
166
166
  /**
167
167
  * Start the quest.
168
168
  * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
169
169
  * @returns
170
170
  */
171
- start(props: OnStartStageQuest): void;
171
+ start(props: OnStartEndStageQuest): void;
172
172
  /**
173
173
  * Go to the next stage if the current stage is completed.
174
174
  * If you want to force the change of stage, use goNextStage.
175
- * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
176
- * @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 {}.
177
176
  * @returns true if the stage was changed, false otherwise.
178
177
  */
179
- tryToGoNextStage(startProps: OnStartStageQuest, endProps: OnEndStageQuest): boolean;
178
+ tryToGoNextStage(props: OnStartEndStageQuest): boolean;
180
179
  /**
181
180
  * Complete the current stage and go to the next stage.
182
181
  * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
183
- * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
184
- * @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 {}.
185
183
  * @returns true if the stage was changed, false otherwise.
186
184
  */
187
- completeCurrentStageAndGoNext(startProps: OnStartStageQuest, endProps: OnEndStageQuest): boolean;
185
+ completeCurrentStageAndGoNext(props: OnStartEndStageQuest): boolean;
188
186
  /**
189
187
  * Go to the next stage without checking if the current stage is completed.
190
188
  * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
191
- * @param startProps
192
- * @param endProps
189
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
193
190
  * @returns returns true if the stage was changed, false otherwise.
194
191
  */
195
- goNextStage(startProps: OnStartStageQuest, endProps: OnEndStageQuest): boolean;
192
+ goNextStage(props: OnStartEndStageQuest): boolean;
196
193
  /**
197
194
  * If the current stage must start. It is true if the current stage is not started, can start and not completed.
198
195
  */
@@ -201,7 +198,7 @@ declare class Quest extends StoredClassModel {
201
198
  * Start the current stage.
202
199
  * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
203
200
  */
204
- startCurrentStage(props: OnStartStageQuest): void;
201
+ startCurrentStage(props: OnStartEndStageQuest): void;
205
202
  }
206
203
 
207
204
  type QuestsRequiredType = {
@@ -248,11 +245,11 @@ interface QuestProps {
248
245
  /**
249
246
  * The function that will be executed when the quest starts.
250
247
  */
251
- onStart?: (quest: Quest, props: OnStartStageQuest) => void;
248
+ onStart?: (quest: Quest, props: OnStartEndStageQuest) => void;
252
249
  /**
253
250
  * The function that will be executed when a stage end in the quest.
254
251
  */
255
- onNextStage?: (quest: Quest, props: OnEndStageQuest) => void;
252
+ onNextStage?: (quest: Quest, props: OnStartEndStageQuest) => void;
256
253
  }
257
254
 
258
255
  interface StageProps {
@@ -319,11 +316,11 @@ interface StageProps {
319
316
  /**
320
317
  * The function that will be executed when the stage starts.
321
318
  */
322
- onStart?: (stage: Stage, props: OnStartStageQuest) => void;
319
+ onStart?: (stage: Stage, props: OnStartEndStageQuest) => void;
323
320
  /**
324
321
  * The function that will be executed when the stage ends.
325
322
  */
326
- onEnd?: (stage: Stage, props: OnEndStageQuest) => void;
323
+ onEnd?: (stage: Stage, props: OnStartEndStageQuest) => void;
327
324
  }
328
325
 
329
326
  export { Quest as Q, Stage as S, type QuestProps as a, type StageProps as b, type QuestsRequiredType as c, StageQuest as d };
@@ -1,4 +1,4 @@
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';
@@ -60,12 +60,12 @@ declare class Stage extends StoredClassModel implements StageProps {
60
60
  /**
61
61
  * The function that will be called when the stage starts.
62
62
  */
63
- get onStart(): undefined | ((props: OnStartStageQuest) => void);
63
+ get onStart(): undefined | ((props: OnStartEndStageQuest) => void);
64
64
  private _onEnd?;
65
65
  /**
66
66
  * The function that will be called when the stage ends.
67
67
  */
68
- get onEnd(): undefined | ((props: OnEndStageQuest) => void);
68
+ get onEnd(): undefined | ((props: OnStartEndStageQuest) => void);
69
69
  }
70
70
  declare class StageQuest extends Stage {
71
71
  constructor(id: string, props: StageProps);
@@ -101,7 +101,7 @@ declare class StageQuest extends Stage {
101
101
  /**
102
102
  * The function that will be called when the stage starts.
103
103
  */
104
- start(props: OnStartStageQuest): void;
104
+ start(props: OnStartEndStageQuest): void;
105
105
  }
106
106
 
107
107
  declare class Quest extends StoredClassModel {
@@ -157,42 +157,39 @@ declare class Quest extends StoredClassModel {
157
157
  /**
158
158
  * The function that will be called when the quest starts.
159
159
  */
160
- get onStart(): undefined | ((props: OnStartStageQuest) => void);
160
+ get onStart(): undefined | ((props: OnStartEndStageQuest) => void);
161
161
  private _onNextStage?;
162
162
  /**
163
163
  * The function that will be called when the quest goes to the next stage.
164
164
  */
165
- get onNextStage(): undefined | ((props: OnEndStageQuest) => void);
165
+ get onNextStage(): undefined | ((props: OnStartEndStageQuest) => void);
166
166
  /**
167
167
  * Start the quest.
168
168
  * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
169
169
  * @returns
170
170
  */
171
- start(props: OnStartStageQuest): void;
171
+ start(props: OnStartEndStageQuest): void;
172
172
  /**
173
173
  * Go to the next stage if the current stage is completed.
174
174
  * If you want to force the change of stage, use goNextStage.
175
- * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
176
- * @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 {}.
177
176
  * @returns true if the stage was changed, false otherwise.
178
177
  */
179
- tryToGoNextStage(startProps: OnStartStageQuest, endProps: OnEndStageQuest): boolean;
178
+ tryToGoNextStage(props: OnStartEndStageQuest): boolean;
180
179
  /**
181
180
  * Complete the current stage and go to the next stage.
182
181
  * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
183
- * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
184
- * @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 {}.
185
183
  * @returns true if the stage was changed, false otherwise.
186
184
  */
187
- completeCurrentStageAndGoNext(startProps: OnStartStageQuest, endProps: OnEndStageQuest): boolean;
185
+ completeCurrentStageAndGoNext(props: OnStartEndStageQuest): boolean;
188
186
  /**
189
187
  * Go to the next stage without checking if the current stage is completed.
190
188
  * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
191
- * @param startProps
192
- * @param endProps
189
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
193
190
  * @returns returns true if the stage was changed, false otherwise.
194
191
  */
195
- goNextStage(startProps: OnStartStageQuest, endProps: OnEndStageQuest): boolean;
192
+ goNextStage(props: OnStartEndStageQuest): boolean;
196
193
  /**
197
194
  * If the current stage must start. It is true if the current stage is not started, can start and not completed.
198
195
  */
@@ -201,7 +198,7 @@ declare class Quest extends StoredClassModel {
201
198
  * Start the current stage.
202
199
  * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
203
200
  */
204
- startCurrentStage(props: OnStartStageQuest): void;
201
+ startCurrentStage(props: OnStartEndStageQuest): void;
205
202
  }
206
203
 
207
204
  type QuestsRequiredType = {
@@ -248,11 +245,11 @@ interface QuestProps {
248
245
  /**
249
246
  * The function that will be executed when the quest starts.
250
247
  */
251
- onStart?: (quest: Quest, props: OnStartStageQuest) => void;
248
+ onStart?: (quest: Quest, props: OnStartEndStageQuest) => void;
252
249
  /**
253
250
  * The function that will be executed when a stage end in the quest.
254
251
  */
255
- onNextStage?: (quest: Quest, props: OnEndStageQuest) => void;
252
+ onNextStage?: (quest: Quest, props: OnStartEndStageQuest) => void;
256
253
  }
257
254
 
258
255
  interface StageProps {
@@ -319,11 +316,11 @@ interface StageProps {
319
316
  /**
320
317
  * The function that will be executed when the stage starts.
321
318
  */
322
- onStart?: (stage: Stage, props: OnStartStageQuest) => void;
319
+ onStart?: (stage: Stage, props: OnStartEndStageQuest) => void;
323
320
  /**
324
321
  * The function that will be executed when the stage ends.
325
322
  */
326
- onEnd?: (stage: Stage, props: OnEndStageQuest) => void;
323
+ onEnd?: (stage: Stage, props: OnStartEndStageQuest) => void;
327
324
  }
328
325
 
329
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-CFQizpZF.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';
@@ -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-Bok_NwL7.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';
@@ -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;