@drincs/nqtr 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/dist/classes/Activity.d.mts +199 -0
  2. package/dist/classes/Activity.d.ts +199 -0
  3. package/dist/classes/Activity.js +508 -0
  4. package/dist/classes/Activity.js.map +1 -0
  5. package/dist/classes/Activity.mjs +503 -0
  6. package/dist/classes/Activity.mjs.map +1 -0
  7. package/dist/classes/Commitment.d.mts +6 -0
  8. package/dist/classes/Commitment.d.ts +6 -0
  9. package/dist/classes/Commitment.js +402 -0
  10. package/dist/classes/Commitment.js.map +1 -0
  11. package/dist/classes/Commitment.mjs +400 -0
  12. package/dist/classes/Commitment.mjs.map +1 -0
  13. package/dist/classes/index.d.mts +6 -0
  14. package/dist/classes/index.d.ts +6 -0
  15. package/dist/classes/index.js +520 -0
  16. package/dist/classes/index.js.map +1 -0
  17. package/dist/classes/index.mjs +517 -0
  18. package/dist/classes/index.mjs.map +1 -0
  19. package/dist/classes/navigation/ActivityRoom.d.mts +6 -0
  20. package/dist/classes/navigation/ActivityRoom.d.ts +6 -0
  21. package/dist/classes/navigation/ActivityRoom.js +435 -0
  22. package/dist/classes/navigation/ActivityRoom.js.map +1 -0
  23. package/dist/classes/navigation/ActivityRoom.mjs +433 -0
  24. package/dist/classes/navigation/ActivityRoom.mjs.map +1 -0
  25. package/dist/classes/navigation/Location.d.mts +6 -0
  26. package/dist/classes/navigation/Location.d.ts +6 -0
  27. package/dist/classes/navigation/Location.js +110 -0
  28. package/dist/classes/navigation/Location.js.map +1 -0
  29. package/dist/classes/navigation/Location.mjs +108 -0
  30. package/dist/classes/navigation/Location.mjs.map +1 -0
  31. package/dist/classes/navigation/Map.d.mts +6 -0
  32. package/dist/classes/navigation/Map.d.ts +6 -0
  33. package/dist/classes/navigation/Map.js +109 -0
  34. package/dist/classes/navigation/Map.js.map +1 -0
  35. package/dist/classes/navigation/Map.mjs +107 -0
  36. package/dist/classes/navigation/Map.mjs.map +1 -0
  37. package/dist/classes/navigation/Room.d.mts +6 -0
  38. package/dist/classes/navigation/Room.d.ts +6 -0
  39. package/dist/classes/navigation/Room.js +750 -0
  40. package/dist/classes/navigation/Room.js.map +1 -0
  41. package/dist/classes/navigation/Room.mjs +745 -0
  42. package/dist/classes/navigation/Room.mjs.map +1 -0
  43. package/dist/classes/navigation/index.d.mts +6 -0
  44. package/dist/classes/navigation/index.d.ts +6 -0
  45. package/dist/classes/navigation/index.js +945 -0
  46. package/dist/classes/navigation/index.js.map +1 -0
  47. package/dist/classes/navigation/index.mjs +941 -0
  48. package/dist/classes/navigation/index.mjs.map +1 -0
  49. package/dist/classes/quest/Goal.d.mts +23 -0
  50. package/dist/classes/quest/Goal.d.ts +23 -0
  51. package/dist/classes/quest/Goal.js +33 -0
  52. package/dist/classes/quest/Goal.js.map +1 -0
  53. package/dist/classes/quest/Goal.mjs +31 -0
  54. package/dist/classes/quest/Goal.mjs.map +1 -0
  55. package/dist/classes/quest/Quest.d.mts +3 -0
  56. package/dist/classes/quest/Quest.d.ts +3 -0
  57. package/dist/classes/quest/Quest.js +39 -0
  58. package/dist/classes/quest/Quest.js.map +1 -0
  59. package/dist/classes/quest/Quest.mjs +37 -0
  60. package/dist/classes/quest/Quest.mjs.map +1 -0
  61. package/dist/classes/quest/Stage.d.mts +3 -0
  62. package/dist/classes/quest/Stage.d.ts +3 -0
  63. package/dist/classes/quest/Stage.js +105 -0
  64. package/dist/classes/quest/Stage.js.map +1 -0
  65. package/dist/classes/quest/Stage.mjs +103 -0
  66. package/dist/classes/quest/Stage.mjs.map +1 -0
  67. package/dist/classes/quest/index.d.mts +3 -0
  68. package/dist/classes/quest/index.d.ts +3 -0
  69. package/dist/classes/quest/index.js +133 -0
  70. package/dist/classes/quest/index.js.map +1 -0
  71. package/dist/classes/quest/index.mjs +129 -0
  72. package/dist/classes/quest/index.mjs.map +1 -0
  73. package/dist/decorators/ActivityDecorator.d.mts +12 -0
  74. package/dist/decorators/ActivityDecorator.d.ts +12 -0
  75. package/dist/decorators/ActivityDecorator.js +33 -0
  76. package/dist/decorators/ActivityDecorator.js.map +1 -0
  77. package/dist/decorators/ActivityDecorator.mjs +29 -0
  78. package/dist/decorators/ActivityDecorator.mjs.map +1 -0
  79. package/dist/decorators/CommitmentDecorator.d.mts +21 -0
  80. package/dist/decorators/CommitmentDecorator.d.ts +21 -0
  81. package/dist/decorators/CommitmentDecorator.js +77 -0
  82. package/dist/decorators/CommitmentDecorator.js.map +1 -0
  83. package/dist/decorators/CommitmentDecorator.mjs +68 -0
  84. package/dist/decorators/CommitmentDecorator.mjs.map +1 -0
  85. package/dist/decorators/RoomDecorator.d.mts +46 -0
  86. package/dist/decorators/RoomDecorator.d.ts +46 -0
  87. package/dist/decorators/RoomDecorator.js +57 -0
  88. package/dist/decorators/RoomDecorator.js.map +1 -0
  89. package/dist/decorators/RoomDecorator.mjs +49 -0
  90. package/dist/decorators/RoomDecorator.mjs.map +1 -0
  91. package/dist/decorators/index.d.mts +9 -0
  92. package/dist/decorators/index.d.ts +9 -0
  93. package/dist/decorators/index.js +145 -0
  94. package/dist/decorators/index.js.map +1 -0
  95. package/dist/decorators/index.mjs +132 -0
  96. package/dist/decorators/index.mjs.map +1 -0
  97. package/dist/enums/ExecutionTypeEnum.d.mts +6 -0
  98. package/dist/enums/ExecutionTypeEnum.d.ts +6 -0
  99. package/dist/enums/ExecutionTypeEnum.js +12 -0
  100. package/dist/enums/ExecutionTypeEnum.js.map +1 -0
  101. package/dist/enums/ExecutionTypeEnum.mjs +10 -0
  102. package/dist/enums/ExecutionTypeEnum.mjs.map +1 -0
  103. package/dist/enums/index.d.mts +1 -0
  104. package/dist/enums/index.d.ts +1 -0
  105. package/dist/enums/index.js +12 -0
  106. package/dist/enums/index.js.map +1 -0
  107. package/dist/enums/index.mjs +10 -0
  108. package/dist/enums/index.mjs.map +1 -0
  109. package/dist/functions/ActivityFunctions.d.mts +11 -0
  110. package/dist/functions/ActivityFunctions.d.ts +11 -0
  111. package/dist/functions/ActivityFunctions.js +54 -0
  112. package/dist/functions/ActivityFunctions.js.map +1 -0
  113. package/dist/functions/ActivityFunctions.mjs +51 -0
  114. package/dist/functions/ActivityFunctions.mjs.map +1 -0
  115. package/dist/functions/NavigationFunctions.d.mts +13 -0
  116. package/dist/functions/NavigationFunctions.d.ts +13 -0
  117. package/dist/functions/NavigationFunctions.js +173 -0
  118. package/dist/functions/NavigationFunctions.js.map +1 -0
  119. package/dist/functions/NavigationFunctions.mjs +168 -0
  120. package/dist/functions/NavigationFunctions.mjs.map +1 -0
  121. package/dist/functions/RoutineFunctions.d.mts +12 -0
  122. package/dist/functions/RoutineFunctions.d.ts +12 -0
  123. package/dist/functions/RoutineFunctions.js +87 -0
  124. package/dist/functions/RoutineFunctions.js.map +1 -0
  125. package/dist/functions/RoutineFunctions.mjs +83 -0
  126. package/dist/functions/RoutineFunctions.mjs.map +1 -0
  127. package/dist/functions/index.d.mts +9 -0
  128. package/dist/functions/index.d.ts +9 -0
  129. package/dist/functions/index.js +264 -0
  130. package/dist/functions/index.js.map +1 -0
  131. package/dist/functions/index.mjs +254 -0
  132. package/dist/functions/index.mjs.map +1 -0
  133. package/dist/index-BjOzVDyw.d.ts +76 -0
  134. package/dist/index-BvCfRbJB.d.mts +564 -0
  135. package/dist/index-Ci6Aw7YE.d.ts +564 -0
  136. package/dist/index-gJ26gdgL.d.mts +76 -0
  137. package/dist/index.d.mts +16 -925
  138. package/dist/index.d.ts +16 -925
  139. package/dist/index.js +169 -156
  140. package/dist/index.js.map +1 -1
  141. package/dist/index.mjs +117 -82
  142. package/dist/index.mjs.map +1 -1
  143. package/dist/managers/TimeManager.d.mts +84 -0
  144. package/dist/managers/TimeManager.d.ts +84 -0
  145. package/dist/managers/TimeManager.js +251 -0
  146. package/dist/managers/TimeManager.js.map +1 -0
  147. package/dist/managers/TimeManager.mjs +249 -0
  148. package/dist/managers/TimeManager.mjs.map +1 -0
  149. package/dist/managers/index.d.mts +2 -0
  150. package/dist/managers/index.d.ts +2 -0
  151. package/dist/managers/index.js +251 -0
  152. package/dist/managers/index.js.map +1 -0
  153. package/dist/managers/index.mjs +249 -0
  154. package/dist/managers/index.mjs.map +1 -0
  155. package/dist/override/OnRunActivityProps.d.mts +19 -0
  156. package/dist/override/OnRunActivityProps.d.ts +19 -0
  157. package/dist/override/OnRunActivityProps.js +4 -0
  158. package/dist/override/OnRunActivityProps.js.map +1 -0
  159. package/dist/override/OnRunActivityProps.mjs +3 -0
  160. package/dist/override/OnRunActivityProps.mjs.map +1 -0
  161. package/dist/override/index.d.mts +1 -0
  162. package/dist/override/index.d.ts +1 -0
  163. package/dist/override/index.js +4 -0
  164. package/dist/override/index.js.map +1 -0
  165. package/dist/override/index.mjs +3 -0
  166. package/dist/override/index.mjs.map +1 -0
  167. package/dist/types/GraphicItem.d.mts +5 -0
  168. package/dist/types/GraphicItem.d.ts +5 -0
  169. package/dist/types/GraphicItem.js +4 -0
  170. package/dist/types/GraphicItem.js.map +1 -0
  171. package/dist/types/GraphicItem.mjs +3 -0
  172. package/dist/types/GraphicItem.mjs.map +1 -0
  173. package/dist/types/QuestsRequired.d.mts +3 -0
  174. package/dist/types/QuestsRequired.d.ts +3 -0
  175. package/dist/types/QuestsRequired.js +4 -0
  176. package/dist/types/QuestsRequired.js.map +1 -0
  177. package/dist/types/QuestsRequired.mjs +3 -0
  178. package/dist/types/QuestsRequired.mjs.map +1 -0
  179. package/dist/types/TimeSettings.d.mts +58 -0
  180. package/dist/types/TimeSettings.d.ts +58 -0
  181. package/dist/types/TimeSettings.js +4 -0
  182. package/dist/types/TimeSettings.js.map +1 -0
  183. package/dist/types/TimeSettings.mjs +3 -0
  184. package/dist/types/TimeSettings.mjs.map +1 -0
  185. package/dist/types/index.d.mts +4 -0
  186. package/dist/types/index.d.ts +4 -0
  187. package/dist/types/index.js +4 -0
  188. package/dist/types/index.js.map +1 -0
  189. package/dist/types/index.mjs +3 -0
  190. package/dist/types/index.mjs.map +1 -0
  191. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -1,925 +1,16 @@
1
- import { CanvasBase, StoredClassModel, CharacterBaseModel } from '@drincs/pixi-vn';
2
-
3
- type GraphicItemType<TCanvasItem extends CanvasBase<any> = CanvasBase<any>> = string | Element | TCanvasItem;
4
-
5
- interface ActivityProps {
6
- /**
7
- * The name
8
- * @default ""
9
- */
10
- name?: string;
11
- /**
12
- * The hour when the activity starts. If the activity is not started yet, it will be hidden.
13
- * If you set 3, the activity will be hidden into hours 1 and 2, and will be shown from hour 3.
14
- * @default TimeManager.minDayHours
15
- */
16
- fromHour?: number;
17
- /**
18
- * The hour when the activity ends. If the activity is ended yet, it will be hidden.
19
- * If you set 3, the activity will be shown into hours 1 and 2 and will be hidden from hour 3.
20
- * @default TimeManager.maxDayHours + 1
21
- */
22
- toHour?: number;
23
- /**
24
- * The day when the activity starts. If the activity is not started yet, it will be hidden.
25
- * If you set 3, the activity will be hidden into days 1 and 2, and will be shown from day 3.
26
- * @default undefined
27
- */
28
- fromDay?: number;
29
- /**
30
- * The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
31
- * If you set 3, the activity will be shown into days 1 and 2 and will be deleted or hidden from day 3.
32
- * @default undefined
33
- */
34
- toDay?: number;
35
- /**
36
- * Whether is disabled. You can also pass a Pixi'VN flag name.
37
- * @default false
38
- */
39
- disabled?: boolean | string;
40
- /**
41
- * Whether is hidden. You can also pass a Pixi'VN flag name.
42
- * @default false
43
- */
44
- hidden?: boolean | string;
45
- /**
46
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
47
- * @default undefined
48
- */
49
- icon?: GraphicItemType;
50
- }
51
- declare abstract class ActivityStoredAbstract {
52
- constructor(onRun: (activity: ActivityStoredAbstract) => void, props: ActivityProps);
53
- abstract setStorageProperty<T>(propertyName: string, value: T | undefined): void;
54
- abstract getStorageProperty<T>(propertyName: string): T | undefined;
55
- abstract get id(): string;
56
- private defaultName?;
57
- get name(): string;
58
- set name(value: string | undefined);
59
- private defaultFromHour?;
60
- get fromHour(): number;
61
- set fromHour(value: number | undefined);
62
- private defaultToHour?;
63
- get toHour(): number;
64
- set toHour(value: number | undefined);
65
- private defaultFromDay?;
66
- get fromDay(): number | undefined;
67
- set fromDay(value: number | undefined);
68
- private defaultToDay?;
69
- get toDay(): number | undefined;
70
- set toDay(value: number | undefined);
71
- private defaultDisabled;
72
- get disabled(): boolean;
73
- set disabled(value: boolean | string);
74
- private defaultHidden;
75
- get hidden(): boolean;
76
- set hidden(value: boolean | string);
77
- private _icon?;
78
- get icon(): GraphicItemType | undefined;
79
- private _onRun;
80
- get onRun(): () => void;
81
- isExpired(): boolean;
82
- export(): ActivityProps;
83
- }
84
- declare class ActivityModel {
85
- constructor(id: string, onRun: (activity: ActivityModel) => void, props: ActivityProps);
86
- private _id;
87
- get id(): string;
88
- private _name?;
89
- get name(): string | undefined;
90
- private _fromHour?;
91
- get fromHour(): number | undefined;
92
- private _toHour?;
93
- get toHour(): number | undefined;
94
- private _fromDay?;
95
- get fromDay(): number | undefined;
96
- private _toDay?;
97
- get toDay(): number | undefined;
98
- private _disabled?;
99
- get disabled(): boolean | undefined;
100
- private _hidden;
101
- get hidden(): boolean;
102
- private _icon?;
103
- get icon(): GraphicItemType | undefined;
104
- private _onRun;
105
- get onRun(): () => void;
106
- isDeadline(): boolean;
107
- export(): ActivityProps;
108
- }
109
-
110
- declare enum ExecutionTypeEnum {
111
- AUTOMATIC = "automatic",
112
- INTERACTION = "interaction"
113
- }
114
-
115
- interface MapBaseModelProps<TMap extends MapBaseModel = MapBaseModel> {
116
- /**
117
- * The name
118
- * @default ""
119
- */
120
- name?: string;
121
- /**
122
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
123
- * Or an object to manage multiple image types. For example to have a image based on time.
124
- * @example
125
- * ```ts
126
- * {
127
- * "morning": "morning-background.jpg",
128
- * "afternoon": "afternoon-background.jpg",
129
- * "evening": "evening-background.jpg",
130
- * "night": "night-background.jpg"
131
- * }
132
- * ```
133
- * @default undefined
134
- */
135
- image?: GraphicItemType | Record<any, GraphicItemType> | object;
136
- /**
137
- * The neighboring maps that are available in this map.
138
- * @example
139
- * ```ts
140
- * {
141
- * "north": atlantaMap,
142
- * "south": miamiMap,
143
- * "east": savannahMap,
144
- * "west": birminghamMap
145
- * }
146
- * ```
147
- * @default {}
148
- */
149
- neighboringMaps?: {
150
- [key: string]: TMap;
151
- };
152
- /**
153
- * Whether is disabled. You can also pass a Pixi'VN flag name.
154
- * @default false
155
- */
156
- disabled?: boolean | string;
157
- /**
158
- * Whether is hidden. You can also pass a Pixi'VN flag name.
159
- * @default false
160
- */
161
- hidden?: boolean | string;
162
- }
163
- /**
164
- * The base model of a map. I suggest you extend this class to create your own map model.
165
- * @example
166
- * ```typescript
167
- * export const mainMap = new MapBaseModel('main_map', {
168
- * name: 'Main Map',
169
- * image: "https://image.jpg",
170
- * neighboringMaps: {
171
- * "north": northMap,
172
- * "south": southMap,
173
- * "east": eastMap,
174
- * "west": westMap
175
- * }
176
- * });
177
- * ```
178
- */
179
- declare class MapBaseModel extends StoredClassModel {
180
- /**
181
- * @param id The id of the map, it must be unique.
182
- * @param props The properties of the map.
183
- */
184
- constructor(id: string, props?: MapBaseModelProps);
185
- private defaultName;
186
- /**
187
- * The name of the map.
188
- * If you set undefined, it will return the initial value of name.
189
- */
190
- get name(): string;
191
- set name(value: string | undefined);
192
- private defaultImage?;
193
- /**
194
- * The image of the map. It can be a string, an Element or a Pixi'VN Canvas Item.
195
- * If you set undefined, it will return the initial value of image.
196
- */
197
- get image(): GraphicItemType | Record<any, GraphicItemType> | object | undefined;
198
- set image(value: GraphicItemType | Record<any, GraphicItemType> | object | undefined);
199
- private defaultDisabled;
200
- /**
201
- * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
202
- */
203
- get disabled(): boolean;
204
- set disabled(value: boolean | string);
205
- private defaultHidden;
206
- /**
207
- * Whether is hidden. If it is a string, it is a Pixi'VN flag name.
208
- */
209
- get hidden(): boolean;
210
- set hidden(value: boolean | string);
211
- private _neighboringMaps?;
212
- /**
213
- * The neighboring maps that are available in this map.
214
- */
215
- get neighboringMaps(): {
216
- [key: string]: MapBaseModel;
217
- };
218
- set neighboringMaps(value: {
219
- [key: string]: MapBaseModel;
220
- } | undefined);
221
- /**
222
- * Get all locations in the map.
223
- * @returns The locations in the map.
224
- */
225
- getLocations<TLocation extends LocationBaseModel = LocationBaseModel>(): TLocation[];
226
- }
227
-
228
- declare class ActivityRoom<TRoom extends RoomBaseModel = RoomBaseModel> extends ActivityStoredAbstract {
229
- constructor(id: string, room: TRoom, onRun: (activity: ActivityStoredAbstract) => void, props: ActivityProps);
230
- setStorageProperty<T>(_: string, __: T | undefined): void;
231
- getStorageProperty<T>(propertyName: string): T | undefined;
232
- private _id;
233
- get id(): string;
234
- private _room;
235
- get room(): TRoom;
236
- export(): object;
237
- }
238
-
239
- interface RoomBaseModelProps {
240
- /**
241
- * The name
242
- * @default ""
243
- */
244
- name?: string;
245
- /**
246
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
247
- * Or an object to manage multiple image types. For example to have a image based on time.
248
- * @example
249
- * ```ts
250
- * {
251
- * "morning": "morning-background.jpg",
252
- * "afternoon": "afternoon-background.jpg",
253
- * "evening": "evening-background.jpg",
254
- * "night": "night-background.jpg"
255
- * }
256
- * ```
257
- * @default undefined
258
- */
259
- image?: GraphicItemType | Record<any, GraphicItemType> | object;
260
- /**
261
- * The activities that are available in this room.
262
- * @default []
263
- */
264
- defaultActivities?: ActivityModel[];
265
- /**
266
- * Whether is disabled. You can also pass a Pixi'VN flag name.
267
- * @default false
268
- */
269
- disabled?: boolean | string;
270
- /**
271
- * Whether is hidden. You can also pass a Pixi'VN flag name.
272
- * @default false
273
- */
274
- hidden?: boolean | string;
275
- /**
276
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
277
- * @default undefined
278
- */
279
- icon?: GraphicItemType;
280
- /**
281
- * Whether is an entrance room, so when the player enters in the location, it will be the first room to be shown.
282
- * @default false
283
- */
284
- isEntrance?: boolean;
285
- }
286
- /**
287
- * The base model of a room. I suggest you extend this class to create your own room model.
288
- * You must use the saveRoom function to save the room in the registered rooms.
289
- * @example
290
- * ```ts
291
- * export const mcRoom = new RoomBaseModel('mc_room', mcHome, {
292
- * name: "MC Room",
293
- * icon: "https://icon.jpg",
294
- * image: "https://image.jpg",
295
- * isEntrance: false,
296
- * })
297
- * saveRoom(mcRoom)
298
- * ```
299
- */
300
- declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseModel> extends StoredClassModel {
301
- /**
302
- * @param id The id of the room, it must be unique.
303
- * @param location The location where the room is.
304
- * @param props The properties of the room.
305
- */
306
- constructor(id: string, location: TLocation, props?: RoomBaseModelProps);
307
- private _location;
308
- /**
309
- * The location where the room is.
310
- */
311
- get location(): TLocation;
312
- private _isEntrance?;
313
- /**
314
- * Whether is an entrance room, so when the player enters in the location, it will be the first room to be shown.
315
- */
316
- get isEntrance(): boolean;
317
- private defaultName;
318
- /**
319
- * The name.
320
- * If you set undefined, it will return the initial value of name.
321
- */
322
- get name(): string;
323
- set name(value: string | undefined);
324
- private defaultImage?;
325
- /**
326
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
327
- * If you set undefined, it will return the initial value of image.
328
- */
329
- get image(): GraphicItemType | Record<any, GraphicItemType> | object | undefined;
330
- set image(value: GraphicItemType | Record<any, GraphicItemType> | object | undefined);
331
- private defaultActivityIds;
332
- /**
333
- * The activities that are available in this room.
334
- */
335
- get defaultActivities(): ActivityRoom<this>[];
336
- private get activityIds();
337
- /**
338
- * The activities that are available in this room.
339
- */
340
- get activities(): ActivityRoom<this>[];
341
- /**
342
- * Get the memory of an activity. This function can be used into olther libraries to get the memory of the activity.
343
- * @param id The id of the activity.
344
- * @returns The memory of the activity.
345
- */
346
- getActivityMemory(id: string): object | undefined;
347
- /**
348
- * Get the activity by id.
349
- * @param id The id of the activity.
350
- * @returns The room activity.
351
- */
352
- getActivity(id: string): ActivityRoom<this> | undefined;
353
- /**
354
- * Set the memory of an activity. This function can be used into olther libraries to set the memory of the activity.
355
- * @param id The id of the activity.
356
- * @param memory The memory of the activity.
357
- */
358
- setActivity(activity: ActivityRoom): void;
359
- /**
360
- * Add an activity to the room.
361
- * @param activity The activity to add.
362
- */
363
- addActivity(activity: ActivityModel): void;
364
- /**
365
- * Remove an activity from the room.
366
- * @param activity The activity to remove.
367
- */
368
- removeActivity(activity: ActivityModel | string): void;
369
- /**
370
- * Clear all expired activities.
371
- */
372
- clearExpiredActivities(): void;
373
- private defaultDisabled;
374
- /**
375
- * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
376
- */
377
- get disabled(): boolean;
378
- set disabled(value: boolean | string);
379
- private defaultHidden;
380
- /**
381
- * Whether is hidden. If it is a string, it is a Pixi'VN flag name.
382
- */
383
- get hidden(): boolean;
384
- set hidden(value: boolean | string);
385
- /**
386
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
387
- */
388
- private _icon?;
389
- get icon(): GraphicItemType | undefined;
390
- /**
391
- * Get the character commitments of the room.
392
- * @returns The character commitments of the room.
393
- */
394
- getRoutine<TCommitment extends CommitmentBaseModel = CommitmentBaseModel>(): TCommitment[];
395
- }
396
-
397
- interface LocationBaseModelProps {
398
- /**
399
- * The name
400
- * @default ""
401
- */
402
- name?: string;
403
- /**
404
- * Whether is disabled. You can also pass a Pixi'VN flag name.
405
- * @default false
406
- */
407
- disabled?: boolean | string;
408
- /**
409
- * Whether is hidden. You can also pass a Pixi'VN flag name.
410
- * @default false
411
- */
412
- hidden?: boolean | string;
413
- /**
414
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
415
- * @default undefined
416
- */
417
- icon?: GraphicItemType;
418
- }
419
- /**
420
- * The base model of a location. I suggest you extend this class to create your own location model.
421
- * @example
422
- * ```typescript
423
- * export const mcHome = new LocationBaseModel('mc_home', mainMap, {
424
- * name: 'MC Home',
425
- * icon: "https://icon.jpg",
426
- * });
427
- * ```
428
- */
429
- declare class LocationBaseModel<TMap extends MapBaseModel = MapBaseModel> extends StoredClassModel {
430
- /**
431
- * @param id The id of the location, it must be unique.
432
- * @param map The map where the location is.
433
- * @param props The properties of the location.
434
- */
435
- constructor(id: string, map: TMap, props?: LocationBaseModelProps);
436
- private defaultName;
437
- /**
438
- * The name of the location.
439
- * If you set undefined, it will return the initial value of name.
440
- */
441
- get name(): string;
442
- set name(value: string | undefined);
443
- private defaultDisabled;
444
- /**
445
- * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
446
- */
447
- get disabled(): boolean;
448
- set disabled(value: boolean | string);
449
- private defaultHidden;
450
- /**
451
- * Whether is hidden. If it is a string, it is a Pixi'VN flag name.
452
- */
453
- get hidden(): boolean;
454
- set hidden(value: boolean | string);
455
- private _icon?;
456
- /**
457
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
458
- */
459
- get icon(): GraphicItemType | undefined;
460
- private _map;
461
- /**
462
- * The map where the location is.
463
- */
464
- get map(): TMap;
465
- /**
466
- * Get the entrance room of the location.
467
- * You can cast the room to a specific type that extends RoomBaseModel.
468
- * @returns The entrance room or the first room if there is no entrance.
469
- * @example
470
- * ```typescript
471
- * const entranceHome = new RoomBaseModel("entrance-home", home, { isEntrance: true })
472
- * saveRoom(entranceHome)
473
- * const home = new LocationBaseModel("home", map, { name: "Home" })
474
- *
475
- * const entrance = home.getEntrance() // entrance === entranceHome
476
- * ```
477
- */
478
- getEntrance<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom | undefined;
479
- /**
480
- * Get all rooms in the location.
481
- * You can cast the rooms to a specific type that extends RoomBaseModel.
482
- * @returns The rooms in the location.
483
- */
484
- getRooms<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom[];
485
- }
486
-
487
- interface CommitmentBaseModelProps {
488
- /**
489
- * The name
490
- * @default ""
491
- */
492
- name?: string;
493
- /**
494
- * The hour when the commitment starts. If the commitment is not started yet, it will be hidden.
495
- * If you set 3, the commitment will be hidden into hours 1 and 2, and will be shown from hour 3.
496
- * @default TimeManager.minDayHours
497
- */
498
- fromHour?: number;
499
- /**
500
- * The hour when the commitment ends. If the commitment is ended yet, it will be hidden.
501
- * If you set 3, the commitment will be shown into hours 1 and 2 and will be hidden from hour 3.
502
- * @default TimeManager.maxDayHours + 1
503
- */
504
- toHour?: number;
505
- /**
506
- * The day when the commitment starts. If the commitment is not started yet, it will be hidden.
507
- * If you set 3, the commitment will be hidden into days 1 and 2, and will be shown from day 3.
508
- * @default undefined
509
- */
510
- fromDay?: number;
511
- /**
512
- * The day when the commitment ends. If the commitment is ended yet, it will be deleted or hidden.
513
- * If you set 3, the commitment will be shown into days 1 and 2 and will be deleted or hidden from day 3.
514
- * @default undefined
515
- */
516
- toDay?: number;
517
- /**
518
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
519
- * Or an object to manage multiple image types. For example to have a image based on time.
520
- * @example
521
- * ```ts
522
- * {
523
- * "morning": "morning-background.jpg",
524
- * "afternoon": "afternoon-background.jpg",
525
- * "evening": "evening-background.jpg",
526
- * "night": "night-background.jpg"
527
- * }
528
- * ```
529
- * @default undefined
530
- */
531
- image?: GraphicItemType | Record<any, GraphicItemType> | object;
532
- /**
533
- * 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
- * @default ExecutionTypeEnum.INTERACTION
535
- */
536
- executionType?: ExecutionTypeEnum;
537
- /**
538
- * Is a function that is called when the player interacts with the character.
539
- * @param commitment
540
- * @returns
541
- * @default undefined
542
- */
543
- onRun?: (commitment: CommitmentBaseModel) => void;
544
- /**
545
- * Whether is disabled. You can also pass a Pixi'VN flag name.
546
- * 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.
547
- * @default false
548
- */
549
- disabled?: boolean | string;
550
- /**
551
- * Whether is hidden. You can also pass a Pixi'VN flag name.
552
- * @default false
553
- */
554
- hidden?: boolean | string;
555
- }
556
- /**
557
- * The base model of a commitment. I suggest you extend this class to create your own commitment model.
558
- * You must use the saveRoom function to save the commitment in the registered commitments.
559
- * @example
560
- * ```ts
561
- * export const mcRoom = new CommitmentBaseModel("test", character, room, {
562
- * name: "Test",
563
- * image: "https://image.jpg",
564
- * executionType: ExecutionTypeEnum.INTERACTION,
565
- * onRun: (commitment) => {
566
- * // Do something
567
- * }
568
- })
569
- * saveCommitment(mcRoom)
570
- * ```
571
- */
572
- declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = CharacterBaseModel, TRoom extends RoomBaseModel = RoomBaseModel> extends StoredClassModel {
573
- /**
574
- * @param id The id of the commitment, it must be unique.
575
- * @param character The character or characters that are in the commitment and so in the room.
576
- * @param room The room where the commitment is.
577
- * @param props The properties of the commitment.
578
- */
579
- constructor(id: string, character: TCharacter | TCharacter[] | undefined, room: TRoom, props: CommitmentBaseModelProps);
580
- private _characters;
581
- /**
582
- * The character or characters that are in the commitment and so in the room.
583
- */
584
- get characters(): TCharacter[];
585
- private _room;
586
- /**
587
- * The room where the commitment is.
588
- */
589
- get room(): TRoom;
590
- private _name;
591
- /**
592
- * The name
593
- */
594
- get name(): GraphicItemType;
595
- private defaultFromHour?;
596
- /**
597
- * The hour when the commitment starts. If the commitment is not started yet, it will be hidden.
598
- * If you set undefined, it will return the initial value of fromHour.
599
- */
600
- get fromHour(): number;
601
- set fromHour(value: number | undefined);
602
- private defaultToHour?;
603
- /**
604
- * The hour when the commitment ends. If the commitment is ended yet, it will be hidden.
605
- * If you set undefined, it will return the initial value of toHour.
606
- */
607
- get toHour(): number;
608
- set toHour(value: number | undefined);
609
- private defaultFromDay?;
610
- /**
611
- * The day when the commitment starts. If the commitment is not started yet, it will be hidden.
612
- * If you set undefined, it will return the initial value of fromDay.
613
- */
614
- get fromDay(): number | undefined;
615
- set fromDay(value: number | undefined);
616
- private defaultToDay?;
617
- /**
618
- * The day when the commitment ends. If the commitment is ended yet, it will be deleted or hidden.
619
- * If you set undefined, it will return the initial value of toDay.
620
- */
621
- get toDay(): number | undefined;
622
- set toDay(value: number | undefined);
623
- private _image?;
624
- /**
625
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
626
- */
627
- get image(): GraphicItemType | Record<any, GraphicItemType> | object | undefined;
628
- private _executionType;
629
- /**
630
- * 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.
631
- */
632
- get executionType(): ExecutionTypeEnum;
633
- private _onRun?;
634
- /**
635
- * Is a function that is called when the player interacts with the character.
636
- */
637
- onRun(): void;
638
- private defaultDisabled;
639
- /**
640
- * Whether is disabled. You can also pass a Pixi'VN flag name.
641
- */
642
- get disabled(): boolean;
643
- set disabled(value: boolean | string);
644
- private defaultHidden;
645
- /**
646
- * Whether is hidden. You can also pass a Pixi'VN flag name.
647
- */
648
- get hidden(): boolean;
649
- set hidden(value: boolean | string);
650
- /**
651
- * Whether the commitment is expired.
652
- * @returns Whether the commitment is expired.
653
- */
654
- isExpired(): boolean;
655
- }
656
-
657
- interface GoalProps {
658
- description: string;
659
- need?: number;
660
- have?: number;
661
- }
662
- interface IGoal {
663
- description: string;
664
- need: number;
665
- have: number;
666
- }
667
- declare class Goal implements IGoal {
668
- constructor(props: GoalProps);
669
- private _description;
670
- get description(): string;
671
- need: number;
672
- have: number;
673
- get isComplete(): boolean;
674
- setComplete(): void;
675
- find(): void;
676
- get export(): IGoal;
677
- }
678
-
679
- type QuestsRequiredType<TQuest extends QuestBaseModel = QuestBaseModel> = {
680
- quest: TQuest;
681
- stageNumber: number;
682
- } | TQuest;
683
-
684
- interface StageBaseModelProps {
685
- goals?: Goal[];
686
- name?: string;
687
- description?: string;
688
- adviceDescription?: string;
689
- image?: string;
690
- daysRequiredToStart: number;
691
- flagsRequired: string[];
692
- questsRequired: QuestsRequiredType[];
693
- requestDescription?: string;
694
- onStart: () => void;
695
- onEnd: () => void;
696
- }
697
- declare class StageBaseModel extends StoredClassModel {
698
- constructor(id: string, props: StageBaseModelProps);
699
- private _completed;
700
- get completed(): boolean;
701
- private _active;
702
- get active(): boolean;
703
- private defaultGoals;
704
- get goals(): Goal[];
705
- set goals(value: Goal[]);
706
- private _name;
707
- get name(): string;
708
- private _description;
709
- get description(): string;
710
- private _adviceDescription;
711
- get adviceDescription(): string;
712
- private _image;
713
- get image(): string;
714
- private _daysRequiredToStart;
715
- get daysRequiredToStart(): number;
716
- private _flagsRequired;
717
- get flagsRequired(): string[];
718
- private _questsRequired;
719
- get questsRequired(): QuestsRequiredType[];
720
- private _requestDescription;
721
- get requestDescription(): string;
722
- private _onStart;
723
- get onStart(): () => void;
724
- private _onEnd;
725
- get onEnd(): () => void;
726
- }
727
-
728
- interface QuestBaseModelProps {
729
- name?: string;
730
- description?: string;
731
- icon?: string;
732
- image?: string;
733
- isInDevelopment?: boolean;
734
- }
735
- declare class QuestBaseModel<TStage extends StageBaseModel = StageBaseModel> extends StoredClassModel {
736
- constructor(id: string, stages: TStage[], props: QuestBaseModelProps);
737
- private _stages;
738
- get stages(): TStage[];
739
- private _name;
740
- get name(): string;
741
- private _description;
742
- get description(): string;
743
- private _icon;
744
- get icon(): string;
745
- private _image;
746
- get image(): string;
747
- private _isInDevelopment;
748
- get isInDevelopment(): boolean;
749
- }
750
-
751
- declare function saveActivity(activity: ActivityModel | ActivityModel[]): void;
752
- declare function getActivityById(id: string): ActivityModel | undefined;
753
-
754
- declare function saveCommitment<TCommitment extends CommitmentBaseModel = CommitmentBaseModel>(commitment: TCommitment | TCommitment[]): void;
755
- declare function getCommitmentById<TCommitment extends CommitmentBaseModel = CommitmentBaseModel>(id: string): TCommitment | undefined;
756
- declare function setFixedCommitments<TCommitment extends CommitmentBaseModel = CommitmentBaseModel>(commitments: TCommitment[] | TCommitment): void;
757
- declare function addTemporaryCommitment<TCommitment extends CommitmentBaseModel = CommitmentBaseModel>(commitment: TCommitment[] | TCommitment): void;
758
- declare function getFixedCommitments<TCommitment extends CommitmentBaseModel = CommitmentBaseModel>(): TCommitment[];
759
- declare function getTemporaryCommitments<TCommitment extends CommitmentBaseModel = CommitmentBaseModel>(): TCommitment[];
760
-
761
- /**
762
- * Save a room in the registered rooms.
763
- * @param room The room to save.
764
- * @returns
765
- */
766
- declare function saveRoom<TRoom extends RoomBaseModel = RoomBaseModel>(room: TRoom | TRoom[]): void;
767
- /**
768
- * Get a room by its id.
769
- * @param id The id of the room.
770
- * @returns The room or undefined if not found.
771
- */
772
- declare function getRoomById<TRoom extends RoomBaseModel = RoomBaseModel>(id: string): TRoom | undefined;
773
- /**
774
- * Get all locations in the registered rooms.
775
- * @returns All locations in the registered rooms.
776
- */
777
- declare function getAllLocations<TLocation extends LocationBaseModel = LocationBaseModel>(): TLocation[];
778
- /**
779
- * Get all maps in the registered rooms.
780
- * @returns All maps in the registered rooms.
781
- */
782
- declare function getAllMaps<TMap extends MapBaseModel = MapBaseModel>(): TMap[];
783
-
784
- declare function clearExpiredActivities(): void;
785
- declare function currentActivities(): ActivityRoom[];
786
-
787
- declare function setCurrentRoom<TRoom extends RoomBaseModel = RoomBaseModel>(room: TRoom | LocationBaseModel): void;
788
- declare function getCurrentRoom<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom | undefined;
789
- declare function getCurrenrLocation<TLocation extends LocationBaseModel = LocationBaseModel>(): TLocation | undefined;
790
- declare function getCueerntMap<TMap extends MapBaseModel = MapBaseModel>(): TMap | undefined;
791
-
792
- declare function clearExpiredRoutine(): void;
793
- declare function getCurrentCommitments<TCommitment extends CommitmentBaseModel = CommitmentBaseModel>(): TCommitment[];
794
- declare function getCommitmentByCharacter<TCommitment extends CommitmentBaseModel = CommitmentBaseModel, TCharacter extends CharacterBaseModel = CharacterBaseModel>(character: TCharacter): TCommitment | undefined;
795
-
796
- type ITimeStlot = {
797
- name: string;
798
- startHour: number;
799
- };
800
- /**
801
- * Time Settings, which can be set using `TimeManager.editSettings`
802
- */
803
- type TimeSettings = {
804
- /**
805
- * Minimum hour of the day (default: 0)
806
- */
807
- minDayHours?: number;
808
- /**
809
- * Maximum hour of the day (default: 24)
810
- */
811
- maxDayHours?: number;
812
- /**
813
- * Default time spent (default: 1)
814
- */
815
- defaultTimeSpent?: number;
816
- /**
817
- * Time slots (default: [])
818
- * @example
819
- * ```ts
820
- * [
821
- * { name: 'Morning', startHour: 5 },
822
- * { name: 'Afternoon', startHour: 12 },
823
- * { name: 'Evening', startHour: 18 },
824
- * { name: 'Night', startHour: 22 }
825
- * ]
826
- */
827
- timeSlots?: ITimeStlot[];
828
- /**
829
- * Week length (default: 7)
830
- */
831
- weekLength?: number;
832
- /**
833
- * Weekend start day. For example, if the real life weekend starts on Saturday, then the value should be 6 (default: weekLength - 1)
834
- */
835
- weekendStartDay?: number;
836
- /**
837
- * Week days names (default: [])
838
- * @example
839
- * ```ts
840
- * ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
841
- * ```
842
- */
843
- weekDaysNames?: string[];
844
- };
845
-
846
- declare class TimeManager {
847
- private constructor();
848
- private static editSettings;
849
- /**
850
- * Get time settings
851
- */
852
- static get settings(): TimeSettings;
853
- /**
854
- * Set time settings, Is very important to set the settings before using the nqtr library, bacause more of the features are based on the time settings.
855
- */
856
- static set settings(value: TimeSettings);
857
- static get minDayHours(): number;
858
- static get maxDayHours(): number;
859
- static get defaultTimeSpent(): number;
860
- static get timeSlots(): ITimeStlot[];
861
- static get weekLength(): number;
862
- static get weekendStartDay(): number;
863
- static get weekDaysNames(): string[];
864
- /**
865
- * Get the current hour
866
- */
867
- static get currentHour(): number;
868
- static set currentHour(value: number | undefined);
869
- /**
870
- * Get the current day
871
- */
872
- static get currentDay(): number;
873
- static set currentDay(value: number | undefined);
874
- /**
875
- * If the current day is greater than or equal to the weekend start day, then it will return true.
876
- */
877
- static get isWeekend(): boolean;
878
- /**
879
- * Get the current week day number (1-TimeManager.weekLength).
880
- * For example, if the week length is 7 and the current day is 10, then the result will be 4.
881
- */
882
- static get currentWeekDayNumber(): number;
883
- /**
884
- * Get the current week day name. If the week days names are not defined, then it will return undefined.
885
- * For example, if the week days names are ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] and the current day is 10, then the result will be 'Thursday'.
886
- */
887
- static get currentDayName(): string | undefined;
888
- /**
889
- * Get the current TimeManager.timeSlots index.
890
- * You can use this property to create "Image that changes based on the time period":
891
- * @example
892
- * ```ts
893
- * import { TimeManager } from '@drincs/nqtr';
894
- *
895
- * function changeBackground() {
896
- * return (
897
- * <img src={`background-${TimeManager.currentTimeSlot}.png`} />
898
- * )
899
- * }
900
- */
901
- static get currentTimeSlot(): number;
902
- /**
903
- * This function will increase the current hour by the given time spent.
904
- * If the new hour is greater than or equal to the max day hours, then it will increase the day and set the new hour.
905
- * @param timeSpent is the time spent in hours (default: TimeManager.defaultTimeSpent)
906
- * @returns TimeManager.currentHour
907
- */
908
- static increaseHour(timeSpent?: number): number;
909
- /**
910
- * This function will increase the current day by the given days.
911
- * @param newDayHour is the hour of the new day (default: TimeManager.minDayHours)
912
- * @param days is the number of days to increase (default: 1)
913
- * @returns TimeManager.currentDay
914
- */
915
- static increaseDay(newDayHour?: number, days?: number): number;
916
- /**
917
- * This function will check if the current hour is between the given hours.
918
- * @param fromHour the starting hour. If the TimeManager.currentHour is equal to this hour, the function will return true.
919
- * @param toHour the ending hour.
920
- * @returns true if the current hour is between the given hours, otherwise false.
921
- */
922
- static nowIsBetween(fromHour: number, toHour: number): boolean;
923
- }
924
-
925
- export { ActivityModel, type ActivityProps, CommitmentBaseModel, type CommitmentBaseModelProps, ExecutionTypeEnum, Goal, type GoalProps, type ITimeStlot, LocationBaseModel, type LocationBaseModelProps, MapBaseModel, type MapBaseModelProps, QuestBaseModel, type QuestBaseModelProps, type QuestsRequiredType, RoomBaseModel, type RoomBaseModelProps, StageBaseModel, type StageBaseModelProps, TimeManager, type TimeSettings, addTemporaryCommitment, clearExpiredActivities, clearExpiredRoutine, currentActivities, getActivityById, getAllLocations, getAllMaps, getCommitmentByCharacter, getCommitmentById, getCueerntMap, getCurrenrLocation, getCurrentCommitments, getCurrentRoom, getFixedCommitments, getRoomById, getTemporaryCommitments, saveActivity, saveCommitment, saveRoom, setCurrentRoom, setFixedCommitments };
1
+ export { default as ActivityModel, ActivityProps } from './classes/Activity.mjs';
2
+ export { C as CommitmentBaseModel, a as CommitmentBaseModelProps, L as LocationBaseModel, b as LocationBaseModelProps, M as MapBaseModel, c as MapBaseModelProps, R as RoomBaseModel, d as RoomBaseModelProps } from './index-BvCfRbJB.mjs';
3
+ export { default as Goal, GoalProps } from './classes/quest/Goal.mjs';
4
+ export { Q as QuestBaseModel, a as QuestBaseModelProps, c as QuestsRequiredType, S as StageBaseModel, b as StageBaseModelProps } from './index-gJ26gdgL.mjs';
5
+ export { getActivityById, saveActivity } from './decorators/ActivityDecorator.mjs';
6
+ export { addTemporaryCommitment, getCommitmentById, getFixedCommitments, getTemporaryCommitments, saveCommitment, setFixedCommitments } from './decorators/CommitmentDecorator.mjs';
7
+ export { getAllLocations, getAllMaps, getRoomById, saveRoom } from './decorators/RoomDecorator.mjs';
8
+ export { ExecutionTypeEnum } from './enums/ExecutionTypeEnum.mjs';
9
+ export { clearExpiredActivities, currentActivities } from './functions/ActivityFunctions.mjs';
10
+ export { getCueerntMap, getCurrenrLocation, getCurrentRoom, setCurrentRoom } from './functions/NavigationFunctions.mjs';
11
+ export { clearExpiredRoutine, getCommitmentByCharacter, getCurrentCommitments } from './functions/RoutineFunctions.mjs';
12
+ export { default as TimeManager } from './managers/TimeManager.mjs';
13
+ export { ITimeStlot, TimeSettings } from './types/TimeSettings.mjs';
14
+ import './override/OnRunActivityProps.mjs';
15
+ import './types/GraphicItem.mjs';
16
+ import '@drincs/pixi-vn';