@drincs/nqtr 0.2.1 → 0.2.3

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 (115) hide show
  1. package/dist/{Commitment-CtNWnNQX.d.mts → Commitment-BHB-jYOi.d.mts} +4 -4
  2. package/dist/{Commitment-BJTIpBQ5.d.ts → Commitment-D-1lsnnU.d.ts} +4 -4
  3. package/dist/{StageProps-CkXejAbn.d.mts → StageProps-CJSp_a54.d.mts} +38 -3
  4. package/dist/{StageProps-BFsiCaZT.d.ts → StageProps-CV4rWD7t.d.ts} +38 -3
  5. package/dist/classes/Commitment.d.mts +2 -2
  6. package/dist/classes/Commitment.d.ts +2 -2
  7. package/dist/classes/index.d.mts +4 -4
  8. package/dist/classes/index.d.ts +4 -4
  9. package/dist/classes/index.js +384 -133
  10. package/dist/classes/index.js.map +1 -1
  11. package/dist/classes/index.mjs +384 -133
  12. package/dist/classes/index.mjs.map +1 -1
  13. package/dist/classes/navigation/ActivityRoom.d.mts +2 -2
  14. package/dist/classes/navigation/ActivityRoom.d.ts +2 -2
  15. package/dist/classes/navigation/ActivityRoom.js +3 -0
  16. package/dist/classes/navigation/ActivityRoom.js.map +1 -1
  17. package/dist/classes/navigation/ActivityRoom.mjs +3 -0
  18. package/dist/classes/navigation/ActivityRoom.mjs.map +1 -1
  19. package/dist/classes/navigation/Location.d.mts +3 -3
  20. package/dist/classes/navigation/Location.d.ts +3 -3
  21. package/dist/classes/navigation/Map.d.mts +3 -3
  22. package/dist/classes/navigation/Map.d.ts +3 -3
  23. package/dist/classes/navigation/Room.d.mts +1 -1
  24. package/dist/classes/navigation/Room.d.ts +1 -1
  25. package/dist/classes/navigation/Room.js +76 -73
  26. package/dist/classes/navigation/Room.js.map +1 -1
  27. package/dist/classes/navigation/Room.mjs +76 -73
  28. package/dist/classes/navigation/Room.mjs.map +1 -1
  29. package/dist/classes/quest/Quest.d.mts +1 -1
  30. package/dist/classes/quest/Quest.d.ts +1 -1
  31. package/dist/classes/quest/Quest.js +117 -25
  32. package/dist/classes/quest/Quest.js.map +1 -1
  33. package/dist/classes/quest/Quest.mjs +117 -25
  34. package/dist/classes/quest/Quest.mjs.map +1 -1
  35. package/dist/classes/quest/Stage.d.mts +1 -1
  36. package/dist/classes/quest/Stage.d.ts +1 -1
  37. package/dist/classes/quest/Stage.js +34 -9
  38. package/dist/classes/quest/Stage.js.map +1 -1
  39. package/dist/classes/quest/Stage.mjs +34 -9
  40. package/dist/classes/quest/Stage.mjs.map +1 -1
  41. package/dist/decorators/ActivityDecorator.d.mts +10 -11
  42. package/dist/decorators/ActivityDecorator.d.ts +10 -11
  43. package/dist/decorators/ActivityDecorator.js +384 -9
  44. package/dist/decorators/ActivityDecorator.js.map +1 -1
  45. package/dist/decorators/ActivityDecorator.mjs +384 -9
  46. package/dist/decorators/ActivityDecorator.mjs.map +1 -1
  47. package/dist/decorators/CommitmentDecorator.d.mts +3 -3
  48. package/dist/decorators/CommitmentDecorator.d.ts +3 -3
  49. package/dist/decorators/QuestDecorator.d.mts +10 -4
  50. package/dist/decorators/QuestDecorator.d.ts +10 -4
  51. package/dist/decorators/QuestDecorator.js +121 -25
  52. package/dist/decorators/QuestDecorator.js.map +1 -1
  53. package/dist/decorators/QuestDecorator.mjs +121 -26
  54. package/dist/decorators/QuestDecorator.mjs.map +1 -1
  55. package/dist/decorators/RoomDecorator.d.mts +3 -3
  56. package/dist/decorators/RoomDecorator.d.ts +3 -3
  57. package/dist/decorators/index.d.mts +4 -4
  58. package/dist/decorators/index.d.ts +4 -4
  59. package/dist/decorators/index.js +342 -115
  60. package/dist/decorators/index.js.map +1 -1
  61. package/dist/decorators/index.mjs +342 -116
  62. package/dist/decorators/index.mjs.map +1 -1
  63. package/dist/functions/ActivityFunctions.d.mts +10 -3
  64. package/dist/functions/ActivityFunctions.d.ts +10 -3
  65. package/dist/functions/ActivityFunctions.js.map +1 -1
  66. package/dist/functions/ActivityFunctions.mjs.map +1 -1
  67. package/dist/functions/NavigationFunctions.d.mts +22 -5
  68. package/dist/functions/NavigationFunctions.d.ts +22 -5
  69. package/dist/functions/NavigationFunctions.js +2 -2
  70. package/dist/functions/NavigationFunctions.js.map +1 -1
  71. package/dist/functions/NavigationFunctions.mjs +2 -2
  72. package/dist/functions/NavigationFunctions.mjs.map +1 -1
  73. package/dist/functions/QuestFunctions.d.mts +8 -0
  74. package/dist/functions/QuestFunctions.d.ts +8 -0
  75. package/dist/functions/QuestFunctions.js +21 -0
  76. package/dist/functions/QuestFunctions.js.map +1 -0
  77. package/dist/functions/QuestFunctions.mjs +19 -0
  78. package/dist/functions/QuestFunctions.mjs.map +1 -0
  79. package/dist/functions/RoutineFunctions.d.mts +9 -4
  80. package/dist/functions/RoutineFunctions.d.ts +9 -4
  81. package/dist/functions/RoutineFunctions.js +40 -0
  82. package/dist/functions/RoutineFunctions.js.map +1 -1
  83. package/dist/functions/RoutineFunctions.mjs +40 -1
  84. package/dist/functions/RoutineFunctions.mjs.map +1 -1
  85. package/dist/functions/index.d.mts +6 -5
  86. package/dist/functions/index.d.ts +6 -5
  87. package/dist/functions/index.js +23 -2
  88. package/dist/functions/index.js.map +1 -1
  89. package/dist/functions/index.mjs +21 -2
  90. package/dist/functions/index.mjs.map +1 -1
  91. package/dist/index.d.mts +9 -8
  92. package/dist/index.d.ts +9 -8
  93. package/dist/index.js +328 -213
  94. package/dist/index.js.map +1 -1
  95. package/dist/index.mjs +323 -211
  96. package/dist/index.mjs.map +1 -1
  97. package/dist/interface/CommitmentProps.d.mts +2 -2
  98. package/dist/interface/CommitmentProps.d.ts +2 -2
  99. package/dist/interface/RoomProps.d.mts +2 -2
  100. package/dist/interface/RoomProps.d.ts +2 -2
  101. package/dist/interface/index.d.mts +3 -3
  102. package/dist/interface/index.d.ts +3 -3
  103. package/dist/interface/navigation/LocationProps.d.mts +3 -3
  104. package/dist/interface/navigation/LocationProps.d.ts +3 -3
  105. package/dist/interface/navigation/MapProps.d.mts +3 -3
  106. package/dist/interface/navigation/MapProps.d.ts +3 -3
  107. package/dist/interface/quest/QuestProps.d.mts +1 -1
  108. package/dist/interface/quest/QuestProps.d.ts +1 -1
  109. package/dist/interface/quest/StageProps.d.mts +1 -1
  110. package/dist/interface/quest/StageProps.d.ts +1 -1
  111. package/dist/types/QuestsRequired.d.mts +1 -1
  112. package/dist/types/QuestsRequired.d.ts +1 -1
  113. package/dist/types/index.d.mts +1 -1
  114. package/dist/types/index.d.ts +1 -1
  115. package/package.json +5 -5
@@ -1,9 +1,9 @@
1
1
  import { GraphicItemType, OnRenderGraphicItemProps, OnRunProps } from '@drincs/nqtr/dist/override';
2
2
  import { CharacterBaseModel, StoredClassModel } from '@drincs/pixi-vn';
3
- import ExecutionType from './types/ExecutionType.mjs';
4
- import ActivityModel from './classes/Activity.mjs';
5
3
  import { a as ActivityStoredAbstract, A as ActivityProps } from './ActivityProps-D45DQdcT.mjs';
6
4
  import { OnRunActivityEvent } from './types/OnRunActivityEvent.mjs';
5
+ import ActivityModel from './classes/Activity.mjs';
6
+ import ExecutionType from './types/ExecutionType.mjs';
7
7
  import { OnRunCommitmentEvent } from './types/OnRunCommitmentEvent.mjs';
8
8
 
9
9
  interface CommitmentProps<TCharacter extends CharacterBaseModel = CharacterBaseModel, TRoom extends RoomBaseModel = RoomBaseModel> {
@@ -217,10 +217,10 @@ declare class ActivityRoom<TRoom extends RoomBaseModel = RoomBaseModel> extends
217
217
  getStorageProperty<T>(propertyName: string): T | undefined;
218
218
  private _id;
219
219
  get id(): string;
220
+ private _room;
220
221
  /**
221
222
  * The room where the activity is.
222
223
  */
223
- private _room;
224
224
  get room(): TRoom;
225
225
  export(): object;
226
226
  }
@@ -368,7 +368,7 @@ declare class LocationBaseModel<TMap extends MapBaseModel = MapBaseModel> extend
368
368
  declare const ROOM_CATEGORY = "__nqtr-room__";
369
369
  /**
370
370
  * The base model of a room. I suggest you extend this class to create your own room model.
371
- * You must use the saveRoom function to save the room in the registered rooms.
371
+ * **You must use the {@link saveRoom} function to save the room in the registered rooms.**
372
372
  * @example
373
373
  * ```ts
374
374
  * export const mcRoom = new RoomBaseModel('mc_room', mcHome, {
@@ -1,9 +1,9 @@
1
1
  import { GraphicItemType, OnRenderGraphicItemProps, OnRunProps } from '@drincs/nqtr/dist/override';
2
2
  import { CharacterBaseModel, StoredClassModel } from '@drincs/pixi-vn';
3
- import ExecutionType from './types/ExecutionType.js';
4
- import ActivityModel from './classes/Activity.js';
5
3
  import { a as ActivityStoredAbstract, A as ActivityProps } from './ActivityProps-BkHX8xkA.js';
6
4
  import { OnRunActivityEvent } from './types/OnRunActivityEvent.js';
5
+ import ActivityModel from './classes/Activity.js';
6
+ import ExecutionType from './types/ExecutionType.js';
7
7
  import { OnRunCommitmentEvent } from './types/OnRunCommitmentEvent.js';
8
8
 
9
9
  interface CommitmentProps<TCharacter extends CharacterBaseModel = CharacterBaseModel, TRoom extends RoomBaseModel = RoomBaseModel> {
@@ -217,10 +217,10 @@ declare class ActivityRoom<TRoom extends RoomBaseModel = RoomBaseModel> extends
217
217
  getStorageProperty<T>(propertyName: string): T | undefined;
218
218
  private _id;
219
219
  get id(): string;
220
+ private _room;
220
221
  /**
221
222
  * The room where the activity is.
222
223
  */
223
- private _room;
224
224
  get room(): TRoom;
225
225
  export(): object;
226
226
  }
@@ -368,7 +368,7 @@ declare class LocationBaseModel<TMap extends MapBaseModel = MapBaseModel> extend
368
368
  declare const ROOM_CATEGORY = "__nqtr-room__";
369
369
  /**
370
370
  * The base model of a room. I suggest you extend this class to create your own room model.
371
- * You must use the saveRoom function to save the room in the registered rooms.
371
+ * **You must use the {@link saveRoom} function to save the room in the registered rooms.**
372
372
  * @example
373
373
  * ```ts
374
374
  * export const mcRoom = new RoomBaseModel('mc_room', mcHome, {
@@ -75,6 +75,11 @@ declare class StageQuest extends Stage {
75
75
  */
76
76
  get completed(): boolean;
77
77
  set completed(value: boolean);
78
+ /**
79
+ * If the stage is started.
80
+ */
81
+ get started(): boolean;
82
+ set started(value: boolean);
78
83
  /**
79
84
  * The list of goals that the player needs to complete to finish the stage.
80
85
  */
@@ -89,10 +94,14 @@ declare class StageQuest extends Stage {
89
94
  * Check if the stage can start.
90
95
  */
91
96
  get canStart(): boolean;
97
+ /**
98
+ * Inizialize the stage. **This function should be called only by the Quest class.**
99
+ */
100
+ inizialize(): void;
92
101
  /**
93
102
  * The function that will be called when the stage starts.
94
103
  */
95
- get onStart(): undefined | ((props: OnStartStage) => void);
104
+ start(props: OnStartStage): void;
96
105
  }
97
106
 
98
107
  declare class Quest extends StoredClassModel {
@@ -151,12 +160,38 @@ declare class Quest extends StoredClassModel {
151
160
  */
152
161
  start(props: OnStartStage): void;
153
162
  /**
154
- * Try to go to the next stage.
163
+ * Go to the next stage if the current stage is completed.
164
+ * If you want to force the change of stage, use goNextStage.
155
165
  * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
156
166
  * @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
157
167
  * @returns true if the stage was changed, false otherwise.
158
168
  */
159
169
  tryToGoNextStage(startProps: OnStartStage, endProps: OnEndStage): boolean;
170
+ /**
171
+ * Complete the current stage and go to the next stage.
172
+ * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
173
+ * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
174
+ * @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
175
+ * @returns true if the stage was changed, false otherwise.
176
+ */
177
+ completeCurrentStageAndGoNext(startProps: OnStartStage, endProps: OnEndStage): boolean;
178
+ /**
179
+ * Go to the next stage without checking if the current stage is completed.
180
+ * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
181
+ * @param startProps
182
+ * @param endProps
183
+ * @returns returns true if the stage was changed, false otherwise.
184
+ */
185
+ goNextStage(startProps: OnStartStage, endProps: OnEndStage): boolean;
186
+ /**
187
+ * If the current stage must start. It is true if the current stage is not started, can start and not completed.
188
+ */
189
+ get currentStageMustStart(): boolean;
190
+ /**
191
+ * Start the current stage.
192
+ * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
193
+ */
194
+ startCurrentStage(props: OnStartStage): void;
160
195
  }
161
196
 
162
197
  type QuestsRequiredType = {
@@ -273,4 +308,4 @@ interface StageProps {
273
308
  onEnd?: (props: OnEndStage) => void;
274
309
  }
275
310
 
276
- export { type QuestProps as Q, Stage as S, type StageProps as a, type QuestsRequiredType as b, Quest as c, StageQuest as d };
311
+ export { Quest as Q, Stage as S, type QuestProps as a, type StageProps as b, type QuestsRequiredType as c, StageQuest as d };
@@ -75,6 +75,11 @@ declare class StageQuest extends Stage {
75
75
  */
76
76
  get completed(): boolean;
77
77
  set completed(value: boolean);
78
+ /**
79
+ * If the stage is started.
80
+ */
81
+ get started(): boolean;
82
+ set started(value: boolean);
78
83
  /**
79
84
  * The list of goals that the player needs to complete to finish the stage.
80
85
  */
@@ -89,10 +94,14 @@ declare class StageQuest extends Stage {
89
94
  * Check if the stage can start.
90
95
  */
91
96
  get canStart(): boolean;
97
+ /**
98
+ * Inizialize the stage. **This function should be called only by the Quest class.**
99
+ */
100
+ inizialize(): void;
92
101
  /**
93
102
  * The function that will be called when the stage starts.
94
103
  */
95
- get onStart(): undefined | ((props: OnStartStage) => void);
104
+ start(props: OnStartStage): void;
96
105
  }
97
106
 
98
107
  declare class Quest extends StoredClassModel {
@@ -151,12 +160,38 @@ declare class Quest extends StoredClassModel {
151
160
  */
152
161
  start(props: OnStartStage): void;
153
162
  /**
154
- * Try to go to the next stage.
163
+ * Go to the next stage if the current stage is completed.
164
+ * If you want to force the change of stage, use goNextStage.
155
165
  * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
156
166
  * @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
157
167
  * @returns true if the stage was changed, false otherwise.
158
168
  */
159
169
  tryToGoNextStage(startProps: OnStartStage, endProps: OnEndStage): boolean;
170
+ /**
171
+ * Complete the current stage and go to the next stage.
172
+ * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
173
+ * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
174
+ * @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
175
+ * @returns true if the stage was changed, false otherwise.
176
+ */
177
+ completeCurrentStageAndGoNext(startProps: OnStartStage, endProps: OnEndStage): boolean;
178
+ /**
179
+ * Go to the next stage without checking if the current stage is completed.
180
+ * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
181
+ * @param startProps
182
+ * @param endProps
183
+ * @returns returns true if the stage was changed, false otherwise.
184
+ */
185
+ goNextStage(startProps: OnStartStage, endProps: OnEndStage): boolean;
186
+ /**
187
+ * If the current stage must start. It is true if the current stage is not started, can start and not completed.
188
+ */
189
+ get currentStageMustStart(): boolean;
190
+ /**
191
+ * Start the current stage.
192
+ * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
193
+ */
194
+ startCurrentStage(props: OnStartStage): void;
160
195
  }
161
196
 
162
197
  type QuestsRequiredType = {
@@ -273,4 +308,4 @@ interface StageProps {
273
308
  onEnd?: (props: OnEndStage) => void;
274
309
  }
275
310
 
276
- export { type QuestProps as Q, Stage as S, type StageProps as a, type QuestsRequiredType as b, Quest as c, StageQuest as d };
311
+ 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,8 @@
1
1
  import '@drincs/nqtr/dist/override';
2
2
  import '@drincs/pixi-vn';
3
- export { C as default } from '../Commitment-CtNWnNQX.mjs';
3
+ export { C as default } from '../Commitment-BHB-jYOi.mjs';
4
4
  import '../types/ExecutionType.mjs';
5
- import './Activity.mjs';
6
5
  import '../ActivityProps-D45DQdcT.mjs';
7
6
  import '../types/OnRunActivityEvent.mjs';
7
+ import './Activity.mjs';
8
8
  import '../types/OnRunCommitmentEvent.mjs';
@@ -1,8 +1,8 @@
1
1
  import '@drincs/nqtr/dist/override';
2
2
  import '@drincs/pixi-vn';
3
- export { C as default } from '../Commitment-BJTIpBQ5.js';
3
+ export { C as default } from '../Commitment-D-1lsnnU.js';
4
4
  import '../types/ExecutionType.js';
5
- import './Activity.js';
6
5
  import '../ActivityProps-BkHX8xkA.js';
7
6
  import '../types/OnRunActivityEvent.js';
7
+ import './Activity.js';
8
8
  import '../types/OnRunCommitmentEvent.js';
@@ -1,11 +1,11 @@
1
- export { default as ActivityModel } from './Activity.mjs';
2
- export { A as ActivityRoom, C as CommitmentBaseModel, L as LocationBaseModel, M as MapBaseModel, R as RoomBaseModel } from '../Commitment-CtNWnNQX.mjs';
1
+ export { A as ActivityRoom, C as CommitmentBaseModel, L as LocationBaseModel, M as MapBaseModel, R as RoomBaseModel } from '../Commitment-BHB-jYOi.mjs';
3
2
  export { default as Goal } from './quest/Goal.mjs';
4
- export { S as Stage } from '../StageProps-CkXejAbn.mjs';
3
+ export { Q as Quest, S as Stage } from '../StageProps-CJSp_a54.mjs';
5
4
  import '@drincs/nqtr/dist/override';
5
+ import '@drincs/pixi-vn';
6
6
  import '../ActivityProps-D45DQdcT.mjs';
7
7
  import '../types/OnRunActivityEvent.mjs';
8
- import '@drincs/pixi-vn';
8
+ import './Activity.mjs';
9
9
  import '../types/ExecutionType.mjs';
10
10
  import '../types/OnRunCommitmentEvent.mjs';
11
11
  import '../interface/quest/GoalProps.mjs';
@@ -1,11 +1,11 @@
1
- export { default as ActivityModel } from './Activity.js';
2
- export { A as ActivityRoom, C as CommitmentBaseModel, L as LocationBaseModel, M as MapBaseModel, R as RoomBaseModel } from '../Commitment-BJTIpBQ5.js';
1
+ export { A as ActivityRoom, C as CommitmentBaseModel, L as LocationBaseModel, M as MapBaseModel, R as RoomBaseModel } from '../Commitment-D-1lsnnU.js';
3
2
  export { default as Goal } from './quest/Goal.js';
4
- export { S as Stage } from '../StageProps-BFsiCaZT.js';
3
+ export { Q as Quest, S as Stage } from '../StageProps-CV4rWD7t.js';
5
4
  import '@drincs/nqtr/dist/override';
5
+ import '@drincs/pixi-vn';
6
6
  import '../ActivityProps-BkHX8xkA.js';
7
7
  import '../types/OnRunActivityEvent.js';
8
- import '@drincs/pixi-vn';
8
+ import './Activity.js';
9
9
  import '../types/ExecutionType.js';
10
10
  import '../types/OnRunCommitmentEvent.js';
11
11
  import '../interface/quest/GoalProps.js';