@drincs/nqtr 0.1.15 → 0.1.17

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 (212) hide show
  1. package/dist/ActivityProps-BoJeWa2B.d.mts +124 -0
  2. package/dist/ActivityProps-_79x9-BX.d.ts +124 -0
  3. package/dist/{index-Cu8ZAiqF.d.ts → Commitment-BObBFSTM.d.ts} +237 -220
  4. package/dist/{index-DhsRZJ3g.d.mts → Commitment-BrnOOgEN.d.mts} +237 -220
  5. package/dist/{index-gJ26gdgL.d.mts → Quest-Bdm0R9LA.d.mts} +7 -12
  6. package/dist/{index-BjOzVDyw.d.ts → Quest-CxJcXETG.d.ts} +7 -12
  7. package/dist/classes/Activity.d.mts +41 -127
  8. package/dist/classes/Activity.d.ts +41 -127
  9. package/dist/classes/Activity.js +2 -151
  10. package/dist/classes/Activity.js.map +1 -1
  11. package/dist/classes/Activity.mjs +2 -148
  12. package/dist/classes/Activity.mjs.map +1 -1
  13. package/dist/classes/ActivityStoredAbstract.d.mts +3 -0
  14. package/dist/classes/ActivityStoredAbstract.d.ts +3 -0
  15. package/dist/classes/ActivityStoredAbstract.js +399 -0
  16. package/dist/classes/ActivityStoredAbstract.js.map +1 -0
  17. package/dist/classes/ActivityStoredAbstract.mjs +397 -0
  18. package/dist/classes/ActivityStoredAbstract.mjs.map +1 -0
  19. package/dist/classes/Commitment.d.mts +4 -1
  20. package/dist/classes/Commitment.d.ts +4 -1
  21. package/dist/classes/Commitment.js +21 -4
  22. package/dist/classes/Commitment.js.map +1 -1
  23. package/dist/classes/Commitment.mjs +21 -4
  24. package/dist/classes/Commitment.mjs.map +1 -1
  25. package/dist/classes/index.d.mts +9 -2
  26. package/dist/classes/index.d.ts +9 -2
  27. package/dist/classes/index.js +884 -5
  28. package/dist/classes/index.js.map +1 -1
  29. package/dist/classes/index.mjs +879 -6
  30. package/dist/classes/index.mjs.map +1 -1
  31. package/dist/classes/navigation/ActivityRoom.d.mts +5 -2
  32. package/dist/classes/navigation/ActivityRoom.d.ts +5 -2
  33. package/dist/classes/navigation/ActivityRoom.js +3 -3
  34. package/dist/classes/navigation/ActivityRoom.js.map +1 -1
  35. package/dist/classes/navigation/ActivityRoom.mjs +3 -3
  36. package/dist/classes/navigation/ActivityRoom.mjs.map +1 -1
  37. package/dist/classes/navigation/Location.d.mts +5 -2
  38. package/dist/classes/navigation/Location.d.ts +5 -2
  39. package/dist/classes/navigation/Location.js.map +1 -1
  40. package/dist/classes/navigation/Location.mjs.map +1 -1
  41. package/dist/classes/navigation/Map.d.mts +5 -2
  42. package/dist/classes/navigation/Map.d.ts +5 -2
  43. package/dist/classes/navigation/Map.js.map +1 -1
  44. package/dist/classes/navigation/Map.mjs.map +1 -1
  45. package/dist/classes/navigation/Room.d.mts +4 -1
  46. package/dist/classes/navigation/Room.d.ts +4 -1
  47. package/dist/classes/navigation/Room.js +3 -3
  48. package/dist/classes/navigation/Room.js.map +1 -1
  49. package/dist/classes/navigation/Room.mjs +3 -3
  50. package/dist/classes/navigation/Room.mjs.map +1 -1
  51. package/dist/classes/quest/Goal.d.mts +3 -6
  52. package/dist/classes/quest/Goal.d.ts +3 -6
  53. package/dist/classes/quest/Goal.js.map +1 -1
  54. package/dist/classes/quest/Goal.mjs.map +1 -1
  55. package/dist/classes/quest/Quest.d.mts +3 -1
  56. package/dist/classes/quest/Quest.d.ts +3 -1
  57. package/dist/classes/quest/Quest.js.map +1 -1
  58. package/dist/classes/quest/Quest.mjs.map +1 -1
  59. package/dist/classes/quest/Stage.d.mts +3 -1
  60. package/dist/classes/quest/Stage.d.ts +3 -1
  61. package/dist/classes/quest/Stage.js.map +1 -1
  62. package/dist/classes/quest/Stage.mjs.map +1 -1
  63. package/dist/decorators/ActivityDecorator.d.mts +16 -0
  64. package/dist/decorators/ActivityDecorator.d.ts +16 -0
  65. package/dist/decorators/ActivityDecorator.js.map +1 -1
  66. package/dist/decorators/ActivityDecorator.mjs.map +1 -1
  67. package/dist/decorators/CommitmentDecorator.d.mts +5 -2
  68. package/dist/decorators/CommitmentDecorator.d.ts +5 -2
  69. package/dist/decorators/CommitmentDecorator.js +3 -3
  70. package/dist/decorators/CommitmentDecorator.js.map +1 -1
  71. package/dist/decorators/CommitmentDecorator.mjs +3 -3
  72. package/dist/decorators/CommitmentDecorator.mjs.map +1 -1
  73. package/dist/decorators/RoomDecorator.d.mts +9 -2
  74. package/dist/decorators/RoomDecorator.d.ts +9 -2
  75. package/dist/decorators/RoomDecorator.js.map +1 -1
  76. package/dist/decorators/RoomDecorator.mjs.map +1 -1
  77. package/dist/decorators/index.d.mts +4 -1
  78. package/dist/decorators/index.d.ts +4 -1
  79. package/dist/decorators/index.js +3 -3
  80. package/dist/decorators/index.js.map +1 -1
  81. package/dist/decorators/index.mjs +3 -3
  82. package/dist/decorators/index.mjs.map +1 -1
  83. package/dist/functions/ActivityFunctions.d.mts +5 -2
  84. package/dist/functions/ActivityFunctions.d.ts +5 -2
  85. package/dist/functions/ActivityFunctions.js.map +1 -1
  86. package/dist/functions/ActivityFunctions.mjs.map +1 -1
  87. package/dist/functions/NavigationFunctions.d.mts +5 -2
  88. package/dist/functions/NavigationFunctions.d.ts +5 -2
  89. package/dist/functions/NavigationFunctions.js.map +1 -1
  90. package/dist/functions/NavigationFunctions.mjs.map +1 -1
  91. package/dist/functions/RoutineFunctions.d.mts +5 -2
  92. package/dist/functions/RoutineFunctions.d.ts +5 -2
  93. package/dist/functions/RoutineFunctions.js.map +1 -1
  94. package/dist/functions/RoutineFunctions.mjs.map +1 -1
  95. package/dist/functions/index.d.mts +5 -2
  96. package/dist/functions/index.d.ts +5 -2
  97. package/dist/functions/index.js.map +1 -1
  98. package/dist/functions/index.mjs.map +1 -1
  99. package/dist/index.d.mts +9 -4
  100. package/dist/index.d.ts +9 -4
  101. package/dist/index.js +171 -154
  102. package/dist/index.js.map +1 -1
  103. package/dist/index.mjs +171 -154
  104. package/dist/index.mjs.map +1 -1
  105. package/dist/interface/ActivityProps.d.mts +3 -0
  106. package/dist/interface/ActivityProps.d.ts +3 -0
  107. package/dist/{override/OnRunActivityProps.js → interface/ActivityProps.js} +1 -1
  108. package/dist/interface/ActivityProps.mjs +3 -0
  109. package/dist/interface/CommitmentProps.d.mts +8 -0
  110. package/dist/interface/CommitmentProps.d.ts +8 -0
  111. package/dist/interface/CommitmentProps.js +4 -0
  112. package/dist/interface/CommitmentProps.js.map +1 -0
  113. package/dist/interface/CommitmentProps.mjs +3 -0
  114. package/dist/interface/CommitmentProps.mjs.map +1 -0
  115. package/dist/interface/RoomActivityMemory.d.mts +9 -0
  116. package/dist/interface/RoomActivityMemory.d.ts +9 -0
  117. package/dist/interface/RoomActivityMemory.js +4 -0
  118. package/dist/interface/RoomActivityMemory.js.map +1 -0
  119. package/dist/interface/RoomActivityMemory.mjs +3 -0
  120. package/dist/interface/RoomActivityMemory.mjs.map +1 -0
  121. package/dist/interface/RoomProps.d.mts +8 -0
  122. package/dist/interface/RoomProps.d.ts +8 -0
  123. package/dist/interface/RoomProps.js +4 -0
  124. package/dist/interface/RoomProps.js.map +1 -0
  125. package/dist/interface/RoomProps.mjs +3 -0
  126. package/dist/interface/RoomProps.mjs.map +1 -0
  127. package/dist/interface/index.d.mts +12 -0
  128. package/dist/interface/index.d.ts +12 -0
  129. package/dist/interface/index.js +4 -0
  130. package/dist/interface/index.js.map +1 -0
  131. package/dist/interface/index.mjs +3 -0
  132. package/dist/interface/index.mjs.map +1 -0
  133. package/dist/interface/navigation/LocationProps.d.mts +8 -0
  134. package/dist/interface/navigation/LocationProps.d.ts +8 -0
  135. package/dist/interface/navigation/LocationProps.js +4 -0
  136. package/dist/interface/navigation/LocationProps.js.map +1 -0
  137. package/dist/interface/navigation/LocationProps.mjs +3 -0
  138. package/dist/interface/navigation/LocationProps.mjs.map +1 -0
  139. package/dist/interface/navigation/MapProps.d.mts +8 -0
  140. package/dist/interface/navigation/MapProps.d.ts +8 -0
  141. package/dist/interface/navigation/MapProps.js +4 -0
  142. package/dist/interface/navigation/MapProps.js.map +1 -0
  143. package/dist/interface/navigation/MapProps.mjs +3 -0
  144. package/dist/interface/navigation/MapProps.mjs.map +1 -0
  145. package/dist/interface/quest/GoalProps.d.mts +7 -0
  146. package/dist/interface/quest/GoalProps.d.ts +7 -0
  147. package/dist/interface/quest/GoalProps.js +4 -0
  148. package/dist/interface/quest/GoalProps.js.map +1 -0
  149. package/dist/interface/quest/GoalProps.mjs +3 -0
  150. package/dist/interface/quest/GoalProps.mjs.map +1 -0
  151. package/dist/interface/quest/QuestProps.d.mts +9 -0
  152. package/dist/interface/quest/QuestProps.d.ts +9 -0
  153. package/dist/interface/quest/QuestProps.js +4 -0
  154. package/dist/interface/quest/QuestProps.js.map +1 -0
  155. package/dist/interface/quest/QuestProps.mjs +3 -0
  156. package/dist/interface/quest/QuestProps.mjs.map +1 -0
  157. package/dist/interface/quest/StageProps.d.mts +5 -0
  158. package/dist/interface/quest/StageProps.d.ts +5 -0
  159. package/dist/interface/quest/StageProps.js +4 -0
  160. package/dist/interface/quest/StageProps.js.map +1 -0
  161. package/dist/interface/quest/StageProps.mjs +3 -0
  162. package/dist/interface/quest/StageProps.mjs.map +1 -0
  163. package/dist/managers/TimeManager.d.mts +1 -1
  164. package/dist/managers/TimeManager.d.ts +1 -1
  165. package/dist/managers/TimeManager.js +1 -1
  166. package/dist/managers/TimeManager.js.map +1 -1
  167. package/dist/managers/TimeManager.mjs +1 -1
  168. package/dist/managers/TimeManager.mjs.map +1 -1
  169. package/dist/managers/index.js +1 -1
  170. package/dist/managers/index.js.map +1 -1
  171. package/dist/managers/index.mjs +1 -1
  172. package/dist/managers/index.mjs.map +1 -1
  173. package/dist/override/{OnRunActivityProps.d.mts → OnRunProps.d.mts} +3 -3
  174. package/dist/override/{OnRunActivityProps.d.ts → OnRunProps.d.ts} +3 -3
  175. package/dist/override/OnRunProps.js +4 -0
  176. package/dist/override/OnRunProps.js.map +1 -0
  177. package/dist/override/OnRunProps.mjs +3 -0
  178. package/dist/override/OnRunProps.mjs.map +1 -0
  179. package/dist/override/index.d.mts +1 -1
  180. package/dist/override/index.d.ts +1 -1
  181. package/dist/types/OnRunActivityEvent.d.mts +8 -0
  182. package/dist/types/OnRunActivityEvent.d.ts +8 -0
  183. package/dist/types/OnRunActivityEvent.js +4 -0
  184. package/dist/types/OnRunActivityEvent.js.map +1 -0
  185. package/dist/types/OnRunActivityEvent.mjs +3 -0
  186. package/dist/types/OnRunActivityEvent.mjs.map +1 -0
  187. package/dist/types/OnRunCommitmentEvent.d.mts +8 -0
  188. package/dist/types/OnRunCommitmentEvent.d.ts +8 -0
  189. package/dist/types/OnRunCommitmentEvent.js +4 -0
  190. package/dist/types/OnRunCommitmentEvent.js.map +1 -0
  191. package/dist/types/OnRunCommitmentEvent.mjs +3 -0
  192. package/dist/types/OnRunCommitmentEvent.mjs.map +1 -0
  193. package/dist/types/QuestsRequired.d.mts +4 -2
  194. package/dist/types/QuestsRequired.d.ts +4 -2
  195. package/dist/types/index.d.mts +4 -2
  196. package/dist/types/index.d.ts +4 -2
  197. package/package.json +2 -2
  198. package/dist/classes/navigation/index.d.mts +0 -5
  199. package/dist/classes/navigation/index.d.ts +0 -5
  200. package/dist/classes/navigation/index.js +0 -987
  201. package/dist/classes/navigation/index.js.map +0 -1
  202. package/dist/classes/navigation/index.mjs +0 -983
  203. package/dist/classes/navigation/index.mjs.map +0 -1
  204. package/dist/classes/quest/index.d.mts +0 -3
  205. package/dist/classes/quest/index.d.ts +0 -3
  206. package/dist/classes/quest/index.js +0 -133
  207. package/dist/classes/quest/index.js.map +0 -1
  208. package/dist/classes/quest/index.mjs +0 -129
  209. package/dist/classes/quest/index.mjs.map +0 -1
  210. package/dist/override/OnRunActivityProps.mjs +0 -3
  211. /package/dist/{override/OnRunActivityProps.js.map → interface/ActivityProps.js.map} +0 -0
  212. /package/dist/{override/OnRunActivityProps.mjs.map → interface/ActivityProps.mjs.map} +0 -0
@@ -1,14 +1,41 @@
1
- import ActivityModel, { ActivityStoredAbstract, OnRunActivityEvent, ActivityProps } from './classes/Activity.js';
2
- import { GraphicItemType, OnRenderGraphicItemProps } from '@drincs/nqtr/dist/override';
3
- import { StoredClassModel, CharacterBaseModel } from '@drincs/pixi-vn';
1
+ import { GraphicItemType, OnRenderGraphicItemProps, OnRunProps } from '@drincs/nqtr/dist/override';
2
+ import { CharacterBaseModel, StoredClassModel } from '@drincs/pixi-vn';
4
3
  import { ExecutionTypeEnum } from './enums/ExecutionTypeEnum.js';
4
+ import ActivityModel from './classes/Activity.js';
5
+ import { a as ActivityStoredAbstract, A as ActivityProps } from './ActivityProps-_79x9-BX.js';
6
+ import { OnRunActivityEvent } from './types/OnRunActivityEvent.js';
7
+ import { OnRunCommitmentEvent } from './types/OnRunCommitmentEvent.js';
5
8
 
6
- interface MapBaseModelProps {
9
+ interface CommitmentProps<TCharacter extends CharacterBaseModel = CharacterBaseModel, TRoom extends RoomBaseModel = RoomBaseModel> {
7
10
  /**
8
11
  * The name
9
12
  * @default ""
10
13
  */
11
14
  name?: string;
15
+ /**
16
+ * The hour when the commitment starts. If the commitment is not started yet, it will be hidden.
17
+ * If you set 3, the commitment will be hidden into hours 1 and 2, and will be shown from hour 3.
18
+ * @default TimeManager.minDayHours
19
+ */
20
+ fromHour?: number;
21
+ /**
22
+ * The hour when the commitment ends. If the commitment is ended yet, it will be hidden.
23
+ * If you set 3, the commitment will be shown into hours 1 and 2 and will be hidden from hour 3.
24
+ * @default TimeManager.maxDayHours + 1
25
+ */
26
+ toHour?: number;
27
+ /**
28
+ * The day when the commitment starts. If the commitment is not started yet, it will be hidden.
29
+ * If you set 3, the commitment will be hidden into days 1 and 2, and will be shown from day 3.
30
+ * @default undefined
31
+ */
32
+ fromDay?: number;
33
+ /**
34
+ * The day when the commitment ends. If the commitment is ended yet, it will be deleted or hidden.
35
+ * If you set 3, the commitment will be shown into days 1 and 2 and will be deleted or hidden from day 3.
36
+ * @default undefined
37
+ */
38
+ toDay?: number;
12
39
  /**
13
40
  * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
14
41
  * Or an object to manage multiple image types. For example to have a image based on time.
@@ -23,7 +50,81 @@ interface MapBaseModelProps {
23
50
  * ```
24
51
  * @default undefined
25
52
  */
26
- renderImage?: GraphicItemType | ((map: MapBaseModel, props?: OnRenderGraphicItemProps) => GraphicItemType);
53
+ renderImage?: GraphicItemType | ((commitment: CommitmentBaseModel<TCharacter, TRoom>, props: OnRenderGraphicItemProps) => GraphicItemType);
54
+ /**
55
+ * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
56
+ * @default ExecutionTypeEnum.INTERACTION
57
+ */
58
+ executionType?: ExecutionTypeEnum;
59
+ /**
60
+ * Is a function that is called when the player interacts with the character.
61
+ * @param commitment
62
+ * @returns
63
+ * @default undefined
64
+ */
65
+ onRun?: OnRunCommitmentEvent<CommitmentBaseModel>;
66
+ /**
67
+ * Whether is disabled. You can also pass a Pixi'VN flag name.
68
+ * If it is disabled this commitment will not be taken into consideration. So the characters will not be in the room, but will be busy with other commitments.
69
+ * @default false
70
+ */
71
+ disabled?: boolean | string;
72
+ /**
73
+ * Whether is hidden. You can also pass a Pixi'VN flag name.
74
+ * @default false
75
+ */
76
+ hidden?: boolean | string;
77
+ /**
78
+ * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
79
+ * @default undefined
80
+ */
81
+ renderIcon?: GraphicItemType | ((commitment: CommitmentBaseModel, props: OnRenderGraphicItemProps) => GraphicItemType);
82
+ }
83
+
84
+ interface LocationProps<TMap extends MapBaseModel = MapBaseModel> {
85
+ /**
86
+ * The name
87
+ * @default ""
88
+ */
89
+ name?: string;
90
+ /**
91
+ * Whether is disabled. You can also pass a Pixi'VN flag name.
92
+ * @default false
93
+ */
94
+ disabled?: boolean | string;
95
+ /**
96
+ * Whether is hidden. You can also pass a Pixi'VN flag name.
97
+ * @default false
98
+ */
99
+ hidden?: boolean | string;
100
+ /**
101
+ * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
102
+ * @default undefined
103
+ */
104
+ renderIcon?: GraphicItemType | ((location: LocationBaseModel<TMap>, props: OnRenderGraphicItemProps) => GraphicItemType);
105
+ }
106
+
107
+ interface MapProps {
108
+ /**
109
+ * The name
110
+ * @default ""
111
+ */
112
+ name?: string;
113
+ /**
114
+ * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
115
+ * Or an object to manage multiple image types. For example to have a image based on time.
116
+ * @example
117
+ * ```ts
118
+ * {
119
+ * "morning": "morning-background.jpg",
120
+ * "afternoon": "afternoon-background.jpg",
121
+ * "evening": "evening-background.jpg",
122
+ * "night": "night-background.jpg"
123
+ * }
124
+ * ```
125
+ * @default undefined
126
+ */
127
+ renderImage?: GraphicItemType | ((map: MapBaseModel, props: OnRenderGraphicItemProps) => GraphicItemType);
27
128
  /**
28
129
  * The neighboring maps that are available in this map.
29
130
  * @example
@@ -51,6 +152,72 @@ interface MapBaseModelProps {
51
152
  */
52
153
  hidden?: boolean | string;
53
154
  }
155
+
156
+ interface RoomProps<TLocation extends LocationBaseModel = LocationBaseModel> {
157
+ /**
158
+ * The name
159
+ * @default ""
160
+ */
161
+ name?: string;
162
+ /**
163
+ * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
164
+ * Or an object to manage multiple image types. For example to have a image based on time.
165
+ * @example
166
+ * ```ts
167
+ * {
168
+ * "morning": "morning-background.jpg",
169
+ * "afternoon": "afternoon-background.jpg",
170
+ * "evening": "evening-background.jpg",
171
+ * "night": "night-background.jpg"
172
+ * }
173
+ * ```
174
+ * @default undefined
175
+ */
176
+ renderImage?: GraphicItemType | ((room: RoomBaseModel<TLocation>, props: OnRenderGraphicItemProps) => GraphicItemType);
177
+ /**
178
+ * The activities that are available in this room.
179
+ * @default []
180
+ */
181
+ defaultActivities?: ActivityModel[];
182
+ /**
183
+ * Whether is disabled. You can also pass a Pixi'VN flag name.
184
+ * @default false
185
+ */
186
+ disabled?: boolean | string;
187
+ /**
188
+ * Whether is hidden. You can also pass a Pixi'VN flag name.
189
+ * @default false
190
+ */
191
+ hidden?: boolean | string;
192
+ /**
193
+ * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
194
+ * @default undefined
195
+ */
196
+ renderIcon?: GraphicItemType | ((room: RoomBaseModel<TLocation>, props: OnRenderGraphicItemProps) => GraphicItemType);
197
+ /**
198
+ * Whether is an entrance room, so when the player enters in the location, it will be the first room to be shown.
199
+ * @default false
200
+ */
201
+ isEntrance?: boolean;
202
+ }
203
+
204
+ /**
205
+ * The activity generated by the room.
206
+ */
207
+ declare class ActivityRoom<TRoom extends RoomBaseModel = RoomBaseModel> extends ActivityStoredAbstract {
208
+ constructor(id: string, room: TRoom, onRun: OnRunActivityEvent<ActivityStoredAbstract>, props: ActivityProps);
209
+ setStorageProperty<T>(_: string, __: T | undefined): void;
210
+ getStorageProperty<T>(propertyName: string): T | undefined;
211
+ private _id;
212
+ get id(): string;
213
+ /**
214
+ * The room where the activity is.
215
+ */
216
+ private _room;
217
+ get room(): TRoom;
218
+ export(): object;
219
+ }
220
+
54
221
  /**
55
222
  * The base model of a map. I suggest you extend this class to create your own map model.
56
223
  * @example
@@ -72,7 +239,7 @@ declare class MapBaseModel extends StoredClassModel {
72
239
  * @param id The id of the map, it must be unique.
73
240
  * @param props The properties of the map.
74
241
  */
75
- constructor(id: string, props?: MapBaseModelProps);
242
+ constructor(id: string, props?: MapProps);
76
243
  private defaultName;
77
244
  /**
78
245
  * The name of the map.
@@ -84,7 +251,7 @@ declare class MapBaseModel extends StoredClassModel {
84
251
  /**
85
252
  * The function for rendering the image of the map.
86
253
  */
87
- get renderImage(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
254
+ get renderImage(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
88
255
  private defaultDisabled;
89
256
  /**
90
257
  * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
@@ -124,70 +291,74 @@ declare class MapBaseModel extends StoredClassModel {
124
291
  }
125
292
 
126
293
  /**
127
- * The activity generated by the room.
294
+ * The base model of a location. I suggest you extend this class to create your own location model.
295
+ * @example
296
+ * ```typescript
297
+ * export const mcHome = new LocationBaseModel('mc_home', mainMap, {
298
+ * name: 'MC Home',
299
+ * icon: "https://icon.jpg",
300
+ * });
301
+ * ```
128
302
  */
129
- declare class ActivityRoom<TRoom extends RoomBaseModel = RoomBaseModel> extends ActivityStoredAbstract {
130
- constructor(id: string, room: TRoom, onRun: OnRunActivityEvent<ActivityStoredAbstract>, props: ActivityProps);
131
- setStorageProperty<T>(_: string, __: T | undefined): void;
132
- getStorageProperty<T>(propertyName: string): T | undefined;
133
- private _id;
134
- get id(): string;
303
+ declare class LocationBaseModel<TMap extends MapBaseModel = MapBaseModel> extends StoredClassModel {
135
304
  /**
136
- * The room where the activity is.
305
+ * @param id The id of the location, it must be unique.
306
+ * @param map The map where the location is.
307
+ * @param props The properties of the location.
137
308
  */
138
- private _room;
139
- get room(): TRoom;
140
- export(): object;
141
- }
142
-
143
- declare const ROOM_CATEGORY = "__nqtr-room__";
144
- interface RoomBaseModelProps<TLocation extends LocationBaseModel = LocationBaseModel> {
309
+ constructor(id: string, map: TMap, props?: LocationProps<TMap>);
310
+ private defaultName;
145
311
  /**
146
- * The name
147
- * @default ""
312
+ * The name of the location.
313
+ * If you set undefined, it will return the initial value of name.
148
314
  */
149
- name?: string;
315
+ get name(): string;
316
+ set name(value: string | undefined);
317
+ private defaultDisabled;
150
318
  /**
151
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
152
- * Or an object to manage multiple image types. For example to have a image based on time.
153
- * @example
154
- * ```ts
155
- * {
156
- * "morning": "morning-background.jpg",
157
- * "afternoon": "afternoon-background.jpg",
158
- * "evening": "evening-background.jpg",
159
- * "night": "night-background.jpg"
160
- * }
161
- * ```
162
- * @default undefined
319
+ * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
163
320
  */
164
- renderImage?: GraphicItemType | ((room: RoomBaseModel<TLocation>, props?: OnRenderGraphicItemProps) => GraphicItemType);
321
+ get disabled(): boolean;
322
+ set disabled(value: boolean | string);
323
+ private defaultHidden;
165
324
  /**
166
- * The activities that are available in this room.
167
- * @default []
325
+ * Whether is hidden. If it is a string, it is a Pixi'VN flag name.
168
326
  */
169
- defaultActivities?: ActivityModel[];
327
+ get hidden(): boolean;
328
+ set hidden(value: boolean | string);
329
+ private _renderIcon?;
170
330
  /**
171
- * Whether is disabled. You can also pass a Pixi'VN flag name.
172
- * @default false
331
+ * The function for rendering the icon of the location.
173
332
  */
174
- disabled?: boolean | string;
333
+ get renderIcon(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
334
+ private _map;
175
335
  /**
176
- * Whether is hidden. You can also pass a Pixi'VN flag name.
177
- * @default false
336
+ * The map where the location is.
178
337
  */
179
- hidden?: boolean | string;
338
+ get map(): TMap;
180
339
  /**
181
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
182
- * @default undefined
340
+ * Get the entrance room of the location.
341
+ * You can cast the room to a specific type that extends RoomBaseModel.
342
+ * @returns The entrance room or the first room if there is no entrance.
343
+ * @example
344
+ * ```typescript
345
+ * const entranceHome = new RoomBaseModel("entrance-home", home, { isEntrance: true })
346
+ * saveRoom(entranceHome)
347
+ * const home = new LocationBaseModel("home", map, { name: "Home" })
348
+ *
349
+ * const entrance = home.getEntrance() // entrance === entranceHome
350
+ * ```
183
351
  */
184
- renderIcon?: GraphicItemType | ((room: RoomBaseModel<TLocation>, props?: OnRenderGraphicItemProps) => GraphicItemType);
352
+ getEntrance<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom | undefined;
185
353
  /**
186
- * Whether is an entrance room, so when the player enters in the location, it will be the first room to be shown.
187
- * @default false
354
+ * Get all rooms in the location.
355
+ * You can cast the rooms to a specific type that extends RoomBaseModel.
356
+ * @returns The rooms in the location.
188
357
  */
189
- isEntrance?: boolean;
358
+ getRooms<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom[];
190
359
  }
360
+
361
+ declare const ROOM_CATEGORY = "__nqtr-room__";
191
362
  /**
192
363
  * The base model of a room. I suggest you extend this class to create your own room model.
193
364
  * You must use the saveRoom function to save the room in the registered rooms.
@@ -208,7 +379,7 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
208
379
  * @param location The location where the room is.
209
380
  * @param props The properties of the room.
210
381
  */
211
- constructor(id: string, location: TLocation, props?: RoomBaseModelProps<TLocation>);
382
+ constructor(id: string, location: TLocation, props?: RoomProps<TLocation>);
212
383
  private _location;
213
384
  /**
214
385
  * The location where the room is.
@@ -230,7 +401,7 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
230
401
  /**
231
402
  * The function for rendering the image of the room.
232
403
  */
233
- get renderImage(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
404
+ get renderImage(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
234
405
  private defaultActivityIds;
235
406
  /**
236
407
  * The activities that are available in this room.
@@ -289,7 +460,7 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
289
460
  /**
290
461
  * The function for rendering the icon of the room.
291
462
  */
292
- get renderIcon(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
463
+ get renderIcon(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
293
464
  /**
294
465
  * Get the character commitments of the room.
295
466
  * @returns The character commitments of the room.
@@ -297,165 +468,6 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
297
468
  getRoutine<TCommitment extends CommitmentBaseModel = CommitmentBaseModel>(): TCommitment[];
298
469
  }
299
470
 
300
- interface LocationBaseModelProps<TMap extends MapBaseModel = MapBaseModel> {
301
- /**
302
- * The name
303
- * @default ""
304
- */
305
- name?: string;
306
- /**
307
- * Whether is disabled. You can also pass a Pixi'VN flag name.
308
- * @default false
309
- */
310
- disabled?: boolean | string;
311
- /**
312
- * Whether is hidden. You can also pass a Pixi'VN flag name.
313
- * @default false
314
- */
315
- hidden?: boolean | string;
316
- /**
317
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
318
- * @default undefined
319
- */
320
- renderIcon?: GraphicItemType | ((location: LocationBaseModel<TMap>, props?: OnRenderGraphicItemProps) => GraphicItemType);
321
- }
322
- /**
323
- * The base model of a location. I suggest you extend this class to create your own location model.
324
- * @example
325
- * ```typescript
326
- * export const mcHome = new LocationBaseModel('mc_home', mainMap, {
327
- * name: 'MC Home',
328
- * icon: "https://icon.jpg",
329
- * });
330
- * ```
331
- */
332
- declare class LocationBaseModel<TMap extends MapBaseModel = MapBaseModel> extends StoredClassModel {
333
- /**
334
- * @param id The id of the location, it must be unique.
335
- * @param map The map where the location is.
336
- * @param props The properties of the location.
337
- */
338
- constructor(id: string, map: TMap, props?: LocationBaseModelProps<TMap>);
339
- private defaultName;
340
- /**
341
- * The name of the location.
342
- * If you set undefined, it will return the initial value of name.
343
- */
344
- get name(): string;
345
- set name(value: string | undefined);
346
- private defaultDisabled;
347
- /**
348
- * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
349
- */
350
- get disabled(): boolean;
351
- set disabled(value: boolean | string);
352
- private defaultHidden;
353
- /**
354
- * Whether is hidden. If it is a string, it is a Pixi'VN flag name.
355
- */
356
- get hidden(): boolean;
357
- set hidden(value: boolean | string);
358
- private _renderIcon?;
359
- /**
360
- * The function for rendering the icon of the location.
361
- */
362
- get renderIcon(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
363
- private _map;
364
- /**
365
- * The map where the location is.
366
- */
367
- get map(): TMap;
368
- /**
369
- * Get the entrance room of the location.
370
- * You can cast the room to a specific type that extends RoomBaseModel.
371
- * @returns The entrance room or the first room if there is no entrance.
372
- * @example
373
- * ```typescript
374
- * const entranceHome = new RoomBaseModel("entrance-home", home, { isEntrance: true })
375
- * saveRoom(entranceHome)
376
- * const home = new LocationBaseModel("home", map, { name: "Home" })
377
- *
378
- * const entrance = home.getEntrance() // entrance === entranceHome
379
- * ```
380
- */
381
- getEntrance<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom | undefined;
382
- /**
383
- * Get all rooms in the location.
384
- * You can cast the rooms to a specific type that extends RoomBaseModel.
385
- * @returns The rooms in the location.
386
- */
387
- getRooms<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom[];
388
- }
389
-
390
- interface CommitmentBaseModelProps<TCharacter extends CharacterBaseModel = CharacterBaseModel, TRoom extends RoomBaseModel = RoomBaseModel> {
391
- /**
392
- * The name
393
- * @default ""
394
- */
395
- name?: string;
396
- /**
397
- * The hour when the commitment starts. If the commitment is not started yet, it will be hidden.
398
- * If you set 3, the commitment will be hidden into hours 1 and 2, and will be shown from hour 3.
399
- * @default TimeManager.minDayHours
400
- */
401
- fromHour?: number;
402
- /**
403
- * The hour when the commitment ends. If the commitment is ended yet, it will be hidden.
404
- * If you set 3, the commitment will be shown into hours 1 and 2 and will be hidden from hour 3.
405
- * @default TimeManager.maxDayHours + 1
406
- */
407
- toHour?: number;
408
- /**
409
- * The day when the commitment starts. If the commitment is not started yet, it will be hidden.
410
- * If you set 3, the commitment will be hidden into days 1 and 2, and will be shown from day 3.
411
- * @default undefined
412
- */
413
- fromDay?: number;
414
- /**
415
- * The day when the commitment ends. If the commitment is ended yet, it will be deleted or hidden.
416
- * If you set 3, the commitment will be shown into days 1 and 2 and will be deleted or hidden from day 3.
417
- * @default undefined
418
- */
419
- toDay?: number;
420
- /**
421
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
422
- * Or an object to manage multiple image types. For example to have a image based on time.
423
- * @example
424
- * ```ts
425
- * {
426
- * "morning": "morning-background.jpg",
427
- * "afternoon": "afternoon-background.jpg",
428
- * "evening": "evening-background.jpg",
429
- * "night": "night-background.jpg"
430
- * }
431
- * ```
432
- * @default undefined
433
- */
434
- renderImage?: GraphicItemType | ((commitment: CommitmentBaseModel<TCharacter, TRoom>, props?: OnRenderGraphicItemProps) => GraphicItemType);
435
- /**
436
- * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
437
- * @default ExecutionTypeEnum.INTERACTION
438
- */
439
- executionType?: ExecutionTypeEnum;
440
- /**
441
- * Is a function that is called when the player interacts with the character.
442
- * @param commitment
443
- * @returns
444
- * @default undefined
445
- */
446
- onRun?: (commitment: CommitmentBaseModel) => void;
447
- /**
448
- * Whether is disabled. You can also pass a Pixi'VN flag name.
449
- * If it is disabled this commitment will not be taken into consideration. So the characters will not be in the room, but will be busy with other commitments.
450
- * @default false
451
- */
452
- disabled?: boolean | string;
453
- /**
454
- * Whether is hidden. You can also pass a Pixi'VN flag name.
455
- * @default false
456
- */
457
- hidden?: boolean | string;
458
- }
459
471
  /**
460
472
  * The base model of a commitment. I suggest you extend this class to create your own commitment model.
461
473
  * You must use the saveRoom function to save the commitment in the registered commitments.
@@ -468,7 +480,7 @@ interface CommitmentBaseModelProps<TCharacter extends CharacterBaseModel = Chara
468
480
  * onRun: (commitment) => {
469
481
  * // Do something
470
482
  * }
471
- })
483
+ * })
472
484
  * saveCommitment(mcRoom)
473
485
  * ```
474
486
  */
@@ -479,7 +491,7 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
479
491
  * @param room The room where the commitment is.
480
492
  * @param props The properties of the commitment.
481
493
  */
482
- constructor(id: string, character: TCharacter | TCharacter[] | undefined, room: TRoom, props: CommitmentBaseModelProps<TCharacter, TRoom>);
494
+ constructor(id: string, character: TCharacter | TCharacter[] | undefined, room: TRoom, props: CommitmentProps<TCharacter, TRoom>);
483
495
  private _characters;
484
496
  /**
485
497
  * The character or characters that are in the commitment and so in the room.
@@ -527,17 +539,22 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
527
539
  /**
528
540
  * The function for rendering the image of the room.
529
541
  */
530
- get renderImage(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
542
+ get renderImage(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
531
543
  private _executionType;
532
544
  /**
533
545
  * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
534
546
  */
535
547
  get executionType(): ExecutionTypeEnum;
548
+ private _renderIcon?;
549
+ /**
550
+ * The function for rendering the icon of the commitment.
551
+ */
552
+ get renderIcon(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
536
553
  private _onRun?;
537
554
  /**
538
555
  * Is a function that is called when the player interacts with the character.
539
556
  */
540
- onRun(): void;
557
+ onRun(): undefined | ((props: OnRunProps) => void);
541
558
  private defaultDisabled;
542
559
  /**
543
560
  * Whether is disabled. You can also pass a Pixi'VN flag name.
@@ -557,4 +574,4 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
557
574
  isExpired(): boolean;
558
575
  }
559
576
 
560
- export { ActivityRoom as A, CommitmentBaseModel as C, LocationBaseModel as L, MapBaseModel as M, RoomBaseModel as R, type CommitmentBaseModelProps as a, type LocationBaseModelProps as b, type MapBaseModelProps as c, type RoomBaseModelProps as d, ROOM_CATEGORY as e };
577
+ export { ActivityRoom as A, CommitmentBaseModel as C, LocationBaseModel as L, MapBaseModel as M, RoomBaseModel as R, type CommitmentProps as a, type LocationProps as b, type MapProps as c, type RoomProps as d, ROOM_CATEGORY as e };