@drincs/nqtr 0.0.5 → 0.0.7
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.
- package/dist/index.d.mts +229 -134
- package/dist/index.d.ts +229 -134
- package/dist/index.js +200 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +194 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,38 +5,46 @@ type GraphicItemType<TCanvasItem extends CanvasBase<any> = CanvasBase<any>> = st
|
|
|
5
5
|
interface ActivityProps {
|
|
6
6
|
/**
|
|
7
7
|
* The name
|
|
8
|
+
* @default ""
|
|
8
9
|
*/
|
|
9
10
|
name?: string;
|
|
10
11
|
/**
|
|
11
12
|
* The hour when the activity starts. If the activity is not started yet, it will be hidden.
|
|
12
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
|
|
13
15
|
*/
|
|
14
16
|
fromHour?: number;
|
|
15
17
|
/**
|
|
16
18
|
* The hour when the activity ends. If the activity is ended yet, it will be hidden.
|
|
17
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
|
|
18
21
|
*/
|
|
19
22
|
toHour?: number;
|
|
20
23
|
/**
|
|
21
24
|
* The day when the activity starts. If the activity is not started yet, it will be hidden.
|
|
22
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
|
|
23
27
|
*/
|
|
24
28
|
fromDay?: number;
|
|
25
29
|
/**
|
|
26
30
|
* The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
|
|
27
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
|
|
28
33
|
*/
|
|
29
34
|
toDay?: number;
|
|
30
35
|
/**
|
|
31
36
|
* Whether is disabled. You can also pass a Pixi'VN flag name.
|
|
37
|
+
* @default false
|
|
32
38
|
*/
|
|
33
39
|
disabled?: boolean | string;
|
|
34
40
|
/**
|
|
35
41
|
* Whether is hidden. You can also pass a Pixi'VN flag name.
|
|
42
|
+
* @default false
|
|
36
43
|
*/
|
|
37
44
|
hidden?: boolean | string;
|
|
38
45
|
/**
|
|
39
46
|
* The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
|
|
47
|
+
* @default undefined
|
|
40
48
|
*/
|
|
41
49
|
icon?: GraphicItemType;
|
|
42
50
|
}
|
|
@@ -99,9 +107,15 @@ declare class ActivityModel {
|
|
|
99
107
|
export(): ActivityProps;
|
|
100
108
|
}
|
|
101
109
|
|
|
110
|
+
declare enum ExecutionTypeEnum {
|
|
111
|
+
AUTOMATIC = "automatic",
|
|
112
|
+
INTERACTION = "interaction"
|
|
113
|
+
}
|
|
114
|
+
|
|
102
115
|
interface MapBaseModelProps<TMap extends MapBaseModel = MapBaseModel> {
|
|
103
116
|
/**
|
|
104
117
|
* The name
|
|
118
|
+
* @default ""
|
|
105
119
|
*/
|
|
106
120
|
name?: string;
|
|
107
121
|
/**
|
|
@@ -116,10 +130,9 @@ interface MapBaseModelProps<TMap extends MapBaseModel = MapBaseModel> {
|
|
|
116
130
|
* "night": "night-background.jpg"
|
|
117
131
|
* }
|
|
118
132
|
* ```
|
|
133
|
+
* @default undefined
|
|
119
134
|
*/
|
|
120
|
-
image?: GraphicItemType |
|
|
121
|
-
[key: string]: GraphicItemType;
|
|
122
|
-
};
|
|
135
|
+
image?: GraphicItemType | Record<any, GraphicItemType> | object;
|
|
123
136
|
/**
|
|
124
137
|
* The neighboring maps that are available in this map.
|
|
125
138
|
* @example
|
|
@@ -131,16 +144,19 @@ interface MapBaseModelProps<TMap extends MapBaseModel = MapBaseModel> {
|
|
|
131
144
|
* "west": birminghamMap
|
|
132
145
|
* }
|
|
133
146
|
* ```
|
|
147
|
+
* @default {}
|
|
134
148
|
*/
|
|
135
149
|
neighboringMaps?: {
|
|
136
150
|
[key: string]: TMap;
|
|
137
151
|
};
|
|
138
152
|
/**
|
|
139
153
|
* Whether is disabled. You can also pass a Pixi'VN flag name.
|
|
154
|
+
* @default false
|
|
140
155
|
*/
|
|
141
156
|
disabled?: boolean | string;
|
|
142
157
|
/**
|
|
143
158
|
* Whether is hidden. You can also pass a Pixi'VN flag name.
|
|
159
|
+
* @default false
|
|
144
160
|
*/
|
|
145
161
|
hidden?: boolean | string;
|
|
146
162
|
}
|
|
@@ -169,21 +185,17 @@ declare class MapBaseModel extends StoredClassModel {
|
|
|
169
185
|
private defaultName;
|
|
170
186
|
/**
|
|
171
187
|
* The name of the map.
|
|
172
|
-
* If you set undefined, it will return the
|
|
188
|
+
* If you set undefined, it will return the initial value of name.
|
|
173
189
|
*/
|
|
174
190
|
get name(): string;
|
|
175
191
|
set name(value: string | undefined);
|
|
176
192
|
private defaultImage?;
|
|
177
193
|
/**
|
|
178
194
|
* The image of the map. It can be a string, an Element or a Pixi'VN Canvas Item.
|
|
179
|
-
* If you set undefined, it will return the
|
|
195
|
+
* If you set undefined, it will return the initial value of image.
|
|
180
196
|
*/
|
|
181
|
-
get image(): GraphicItemType |
|
|
182
|
-
|
|
183
|
-
} | undefined;
|
|
184
|
-
set image(value: GraphicItemType | {
|
|
185
|
-
[key: string]: GraphicItemType;
|
|
186
|
-
} | undefined);
|
|
197
|
+
get image(): GraphicItemType | Record<any, GraphicItemType> | object | undefined;
|
|
198
|
+
set image(value: GraphicItemType | Record<any, GraphicItemType> | object | undefined);
|
|
187
199
|
private defaultDisabled;
|
|
188
200
|
/**
|
|
189
201
|
* Whether is disabled. If it is a string, it is a Pixi'VN flag name.
|
|
@@ -196,114 +208,21 @@ declare class MapBaseModel extends StoredClassModel {
|
|
|
196
208
|
*/
|
|
197
209
|
get hidden(): boolean;
|
|
198
210
|
set hidden(value: boolean | string);
|
|
211
|
+
private _neighboringMaps?;
|
|
199
212
|
/**
|
|
200
|
-
*
|
|
201
|
-
* @returns The locations in the map.
|
|
202
|
-
*/
|
|
203
|
-
getLocations<TLocation extends LocationBaseModel = LocationBaseModel>(): TLocation[];
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
declare enum ExecutionTypeEnum {
|
|
207
|
-
AUTOMATIC = "automatic",
|
|
208
|
-
INTERACTION = "interaction"
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
interface CommitmentBaseModelProps {
|
|
212
|
-
/**
|
|
213
|
-
* The name
|
|
214
|
-
*/
|
|
215
|
-
name?: string;
|
|
216
|
-
/**
|
|
217
|
-
* The hour when the commitment starts. If the commitment is not started yet, it will be hidden.
|
|
218
|
-
* If you set 3, the commitment will be hidden into hours 1 and 2, and will be shown from hour 3.
|
|
219
|
-
*/
|
|
220
|
-
fromHour?: number;
|
|
221
|
-
/**
|
|
222
|
-
* The hour when the commitment ends. If the commitment is ended yet, it will be hidden.
|
|
223
|
-
* If you set 3, the commitment will be shown into hours 1 and 2 and will be hidden from hour 3.
|
|
224
|
-
*/
|
|
225
|
-
toHour?: number;
|
|
226
|
-
/**
|
|
227
|
-
* The day when the commitment starts. If the commitment is not started yet, it will be hidden.
|
|
228
|
-
* If you set 3, the commitment will be hidden into days 1 and 2, and will be shown from day 3.
|
|
229
|
-
*/
|
|
230
|
-
fromDay?: number;
|
|
231
|
-
/**
|
|
232
|
-
* The day when the commitment ends. If the commitment is ended yet, it will be deleted or hidden.
|
|
233
|
-
* If you set 3, the commitment will be shown into days 1 and 2 and will be deleted or hidden from day 3.
|
|
234
|
-
*/
|
|
235
|
-
toDay?: number;
|
|
236
|
-
/**
|
|
237
|
-
* The image. It can be a string, an Element or a Pixi'VN Canvas Item.
|
|
238
|
-
* Or an object to manage multiple image types. For example to have a image based on time.
|
|
239
|
-
* @example
|
|
240
|
-
* ```ts
|
|
241
|
-
* {
|
|
242
|
-
* "morning": "morning-background.jpg",
|
|
243
|
-
* "afternoon": "afternoon-background.jpg",
|
|
244
|
-
* "evening": "evening-background.jpg",
|
|
245
|
-
* "night": "night-background.jpg"
|
|
246
|
-
* }
|
|
247
|
-
* ```
|
|
213
|
+
* The neighboring maps that are available in this map.
|
|
248
214
|
*/
|
|
249
|
-
|
|
250
|
-
[key: string]:
|
|
215
|
+
get neighboringMaps(): {
|
|
216
|
+
[key: string]: MapBaseModel;
|
|
251
217
|
};
|
|
218
|
+
set neighboringMaps(value: {
|
|
219
|
+
[key: string]: MapBaseModel;
|
|
220
|
+
} | undefined);
|
|
252
221
|
/**
|
|
253
|
-
*
|
|
254
|
-
|
|
255
|
-
executionType?: ExecutionTypeEnum;
|
|
256
|
-
/**
|
|
257
|
-
* Is a function that is called when the player interacts with the character.
|
|
258
|
-
* @param commitment
|
|
259
|
-
* @returns
|
|
260
|
-
*/
|
|
261
|
-
onRun?: (commitment: CommitmentBaseModel) => void;
|
|
262
|
-
/**
|
|
263
|
-
* Whether is disabled. You can also pass a Pixi'VN flag name.
|
|
264
|
-
* 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.
|
|
265
|
-
*/
|
|
266
|
-
disabled?: boolean | string;
|
|
267
|
-
/**
|
|
268
|
-
* Whether is hidden. You can also pass a Pixi'VN flag name.
|
|
222
|
+
* Get all locations in the map.
|
|
223
|
+
* @returns The locations in the map.
|
|
269
224
|
*/
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = CharacterBaseModel, TRoom extends RoomBaseModel = RoomBaseModel> extends StoredClassModel {
|
|
273
|
-
constructor(id: string, character: TCharacter | TCharacter[] | undefined, room: TRoom, props: CommitmentBaseModelProps);
|
|
274
|
-
private _characters;
|
|
275
|
-
get characters(): TCharacter[];
|
|
276
|
-
private _room;
|
|
277
|
-
get room(): TRoom;
|
|
278
|
-
private _name;
|
|
279
|
-
get name(): GraphicItemType;
|
|
280
|
-
private defaultFromHour?;
|
|
281
|
-
get fromHour(): number;
|
|
282
|
-
set fromHour(value: number | undefined);
|
|
283
|
-
private defaultToHour?;
|
|
284
|
-
get toHour(): number;
|
|
285
|
-
set toHour(value: number | undefined);
|
|
286
|
-
private defaultFromDay?;
|
|
287
|
-
get fromDay(): number | undefined;
|
|
288
|
-
set fromDay(value: number | undefined);
|
|
289
|
-
private defaultToDay?;
|
|
290
|
-
get toDay(): number | undefined;
|
|
291
|
-
set toDay(value: number | undefined);
|
|
292
|
-
private _image?;
|
|
293
|
-
get image(): GraphicItemType | {
|
|
294
|
-
[key: string]: GraphicItemType;
|
|
295
|
-
} | undefined;
|
|
296
|
-
private _executionType;
|
|
297
|
-
get executionType(): ExecutionTypeEnum;
|
|
298
|
-
private _onRun?;
|
|
299
|
-
onRun(): void;
|
|
300
|
-
private defaultDisabled;
|
|
301
|
-
get disabled(): boolean;
|
|
302
|
-
set disabled(value: boolean | string);
|
|
303
|
-
private defaultHidden;
|
|
304
|
-
get hidden(): boolean;
|
|
305
|
-
set hidden(value: boolean | string);
|
|
306
|
-
isExpired(): boolean;
|
|
225
|
+
getLocations<TLocation extends LocationBaseModel = LocationBaseModel>(): TLocation[];
|
|
307
226
|
}
|
|
308
227
|
|
|
309
228
|
declare class ActivityRoom<TRoom extends RoomBaseModel = RoomBaseModel> extends ActivityStoredAbstract {
|
|
@@ -320,6 +239,7 @@ declare class ActivityRoom<TRoom extends RoomBaseModel = RoomBaseModel> extends
|
|
|
320
239
|
interface RoomBaseModelProps {
|
|
321
240
|
/**
|
|
322
241
|
* The name
|
|
242
|
+
* @default ""
|
|
323
243
|
*/
|
|
324
244
|
name?: string;
|
|
325
245
|
/**
|
|
@@ -334,28 +254,32 @@ interface RoomBaseModelProps {
|
|
|
334
254
|
* "night": "night-background.jpg"
|
|
335
255
|
* }
|
|
336
256
|
* ```
|
|
257
|
+
* @default undefined
|
|
337
258
|
*/
|
|
338
|
-
image?: GraphicItemType |
|
|
339
|
-
[key: string]: GraphicItemType;
|
|
340
|
-
};
|
|
259
|
+
image?: GraphicItemType | Record<any, GraphicItemType> | object;
|
|
341
260
|
/**
|
|
342
261
|
* The activities that are available in this room.
|
|
262
|
+
* @default []
|
|
343
263
|
*/
|
|
344
264
|
defaultActivities?: ActivityModel[];
|
|
345
265
|
/**
|
|
346
266
|
* Whether is disabled. You can also pass a Pixi'VN flag name.
|
|
267
|
+
* @default false
|
|
347
268
|
*/
|
|
348
269
|
disabled?: boolean | string;
|
|
349
270
|
/**
|
|
350
271
|
* Whether is hidden. You can also pass a Pixi'VN flag name.
|
|
272
|
+
* @default false
|
|
351
273
|
*/
|
|
352
274
|
hidden?: boolean | string;
|
|
353
275
|
/**
|
|
354
276
|
* The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
|
|
277
|
+
* @default undefined
|
|
355
278
|
*/
|
|
356
279
|
icon?: GraphicItemType;
|
|
357
280
|
/**
|
|
358
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
|
|
359
283
|
*/
|
|
360
284
|
isEntrance?: boolean;
|
|
361
285
|
}
|
|
@@ -393,21 +317,17 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
|
|
|
393
317
|
private defaultName;
|
|
394
318
|
/**
|
|
395
319
|
* The name.
|
|
396
|
-
* If you set undefined, it will return the
|
|
320
|
+
* If you set undefined, it will return the initial value of name.
|
|
397
321
|
*/
|
|
398
322
|
get name(): string;
|
|
399
323
|
set name(value: string | undefined);
|
|
400
324
|
private defaultImage?;
|
|
401
325
|
/**
|
|
402
326
|
* The image. It can be a string, an Element or a Pixi'VN Canvas Item.
|
|
403
|
-
* If you set undefined, it will return the
|
|
327
|
+
* If you set undefined, it will return the initial value of image.
|
|
404
328
|
*/
|
|
405
|
-
get image(): GraphicItemType |
|
|
406
|
-
|
|
407
|
-
} | undefined;
|
|
408
|
-
set image(value: GraphicItemType | {
|
|
409
|
-
[key: string]: GraphicItemType;
|
|
410
|
-
} | undefined);
|
|
329
|
+
get image(): GraphicItemType | Record<any, GraphicItemType> | object | undefined;
|
|
330
|
+
set image(value: GraphicItemType | Record<any, GraphicItemType> | object | undefined);
|
|
411
331
|
private defaultActivityIds;
|
|
412
332
|
/**
|
|
413
333
|
* The activities that are available in this room.
|
|
@@ -477,18 +397,22 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
|
|
|
477
397
|
interface LocationBaseModelProps {
|
|
478
398
|
/**
|
|
479
399
|
* The name
|
|
400
|
+
* @default ""
|
|
480
401
|
*/
|
|
481
402
|
name?: string;
|
|
482
403
|
/**
|
|
483
404
|
* Whether is disabled. You can also pass a Pixi'VN flag name.
|
|
405
|
+
* @default false
|
|
484
406
|
*/
|
|
485
407
|
disabled?: boolean | string;
|
|
486
408
|
/**
|
|
487
409
|
* Whether is hidden. You can also pass a Pixi'VN flag name.
|
|
410
|
+
* @default false
|
|
488
411
|
*/
|
|
489
412
|
hidden?: boolean | string;
|
|
490
413
|
/**
|
|
491
414
|
* The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
|
|
415
|
+
* @default undefined
|
|
492
416
|
*/
|
|
493
417
|
icon?: GraphicItemType;
|
|
494
418
|
}
|
|
@@ -512,7 +436,7 @@ declare class LocationBaseModel<TMap extends MapBaseModel = MapBaseModel> extend
|
|
|
512
436
|
private defaultName;
|
|
513
437
|
/**
|
|
514
438
|
* The name of the location.
|
|
515
|
-
* If you set undefined, it will return the
|
|
439
|
+
* If you set undefined, it will return the initial value of name.
|
|
516
440
|
*/
|
|
517
441
|
get name(): string;
|
|
518
442
|
set name(value: string | undefined);
|
|
@@ -560,6 +484,176 @@ declare class LocationBaseModel<TMap extends MapBaseModel = MapBaseModel> extend
|
|
|
560
484
|
getRooms<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom[];
|
|
561
485
|
}
|
|
562
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
|
+
|
|
563
657
|
interface GoalProps {
|
|
564
658
|
description: string;
|
|
565
659
|
need?: number;
|
|
@@ -699,10 +793,14 @@ declare function clearExpiredRoutine(): void;
|
|
|
699
793
|
declare function getCurrentCommitments<TCommitment extends CommitmentBaseModel = CommitmentBaseModel>(): TCommitment[];
|
|
700
794
|
declare function getCommitmentByCharacter<TCommitment extends CommitmentBaseModel = CommitmentBaseModel, TCharacter extends CharacterBaseModel = CharacterBaseModel>(character: TCharacter): TCommitment | undefined;
|
|
701
795
|
|
|
796
|
+
type ITimeStlot = {
|
|
797
|
+
name: string;
|
|
798
|
+
startHour: number;
|
|
799
|
+
};
|
|
702
800
|
/**
|
|
703
801
|
* Time Settings, which can be set using `TimeManager.editSettings`
|
|
704
802
|
*/
|
|
705
|
-
|
|
803
|
+
type TimeSettings = {
|
|
706
804
|
/**
|
|
707
805
|
* Minimum hour of the day (default: 0)
|
|
708
806
|
*/
|
|
@@ -743,11 +841,8 @@ interface TimeSettings {
|
|
|
743
841
|
* ```
|
|
744
842
|
*/
|
|
745
843
|
weekDaysNames?: string[];
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
name: string;
|
|
749
|
-
startHour: number;
|
|
750
|
-
}
|
|
844
|
+
};
|
|
845
|
+
|
|
751
846
|
declare class TimeManager {
|
|
752
847
|
private constructor();
|
|
753
848
|
private static editSettings;
|
|
@@ -803,7 +898,7 @@ declare class TimeManager {
|
|
|
803
898
|
* )
|
|
804
899
|
* }
|
|
805
900
|
*/
|
|
806
|
-
static get
|
|
901
|
+
static get currentTimeSlot(): number;
|
|
807
902
|
/**
|
|
808
903
|
* This function will increase the current hour by the given time spent.
|
|
809
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.
|
|
@@ -827,4 +922,4 @@ declare class TimeManager {
|
|
|
827
922
|
static nowIsBetween(fromHour: number, toHour: number): boolean;
|
|
828
923
|
}
|
|
829
924
|
|
|
830
|
-
export { ActivityModel, type ActivityProps, ExecutionTypeEnum, Goal, type GoalProps, 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 };
|
|
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 };
|