@drincs/nqtr 0.1.14 → 0.1.16
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/ActivityProps-B1IaFbGD.d.ts +124 -0
- package/dist/ActivityProps-BmIzqtXr.d.mts +124 -0
- package/dist/{index-Cu8ZAiqF.d.ts → Commitment-BjkhJtTx.d.ts} +227 -220
- package/dist/{index-DhsRZJ3g.d.mts → Commitment-BxUQoZST.d.mts} +227 -220
- package/dist/{index-gJ26gdgL.d.mts → Quest-Bdm0R9LA.d.mts} +7 -12
- package/dist/{index-BjOzVDyw.d.ts → Quest-CxJcXETG.d.ts} +7 -12
- package/dist/classes/Activity.d.mts +41 -127
- package/dist/classes/Activity.d.ts +41 -127
- package/dist/classes/Activity.js +2 -151
- package/dist/classes/Activity.js.map +1 -1
- package/dist/classes/Activity.mjs +2 -148
- package/dist/classes/Activity.mjs.map +1 -1
- package/dist/classes/ActivityStoredAbstract.d.mts +3 -0
- package/dist/classes/ActivityStoredAbstract.d.ts +3 -0
- package/dist/classes/ActivityStoredAbstract.js +399 -0
- package/dist/classes/ActivityStoredAbstract.js.map +1 -0
- package/dist/classes/ActivityStoredAbstract.mjs +397 -0
- package/dist/classes/ActivityStoredAbstract.mjs.map +1 -0
- package/dist/classes/Commitment.d.mts +4 -1
- package/dist/classes/Commitment.d.ts +4 -1
- package/dist/classes/Commitment.js +5 -4
- package/dist/classes/Commitment.js.map +1 -1
- package/dist/classes/Commitment.mjs +5 -4
- package/dist/classes/Commitment.mjs.map +1 -1
- package/dist/classes/index.d.mts +9 -2
- package/dist/classes/index.d.ts +9 -2
- package/dist/classes/index.js +868 -5
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +863 -6
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/navigation/ActivityRoom.d.mts +5 -2
- package/dist/classes/navigation/ActivityRoom.d.ts +5 -2
- package/dist/classes/navigation/ActivityRoom.js +3 -3
- package/dist/classes/navigation/ActivityRoom.js.map +1 -1
- package/dist/classes/navigation/ActivityRoom.mjs +3 -3
- package/dist/classes/navigation/ActivityRoom.mjs.map +1 -1
- package/dist/classes/navigation/Location.d.mts +5 -2
- package/dist/classes/navigation/Location.d.ts +5 -2
- package/dist/classes/navigation/Location.js.map +1 -1
- package/dist/classes/navigation/Location.mjs.map +1 -1
- package/dist/classes/navigation/Map.d.mts +5 -2
- package/dist/classes/navigation/Map.d.ts +5 -2
- package/dist/classes/navigation/Map.js.map +1 -1
- package/dist/classes/navigation/Map.mjs.map +1 -1
- package/dist/classes/navigation/Room.d.mts +4 -1
- package/dist/classes/navigation/Room.d.ts +4 -1
- package/dist/classes/navigation/Room.js +3 -3
- package/dist/classes/navigation/Room.js.map +1 -1
- package/dist/classes/navigation/Room.mjs +3 -3
- package/dist/classes/navigation/Room.mjs.map +1 -1
- package/dist/classes/quest/Goal.d.mts +3 -6
- package/dist/classes/quest/Goal.d.ts +3 -6
- package/dist/classes/quest/Goal.js.map +1 -1
- package/dist/classes/quest/Goal.mjs.map +1 -1
- package/dist/classes/quest/Quest.d.mts +3 -1
- package/dist/classes/quest/Quest.d.ts +3 -1
- package/dist/classes/quest/Quest.js.map +1 -1
- package/dist/classes/quest/Quest.mjs.map +1 -1
- package/dist/classes/quest/Stage.d.mts +3 -1
- package/dist/classes/quest/Stage.d.ts +3 -1
- package/dist/classes/quest/Stage.js.map +1 -1
- package/dist/classes/quest/Stage.mjs.map +1 -1
- package/dist/decorators/ActivityDecorator.d.mts +16 -0
- package/dist/decorators/ActivityDecorator.d.ts +16 -0
- package/dist/decorators/ActivityDecorator.js.map +1 -1
- package/dist/decorators/ActivityDecorator.mjs.map +1 -1
- package/dist/decorators/CommitmentDecorator.d.mts +5 -2
- package/dist/decorators/CommitmentDecorator.d.ts +5 -2
- package/dist/decorators/CommitmentDecorator.js +3 -3
- package/dist/decorators/CommitmentDecorator.js.map +1 -1
- package/dist/decorators/CommitmentDecorator.mjs +3 -3
- package/dist/decorators/CommitmentDecorator.mjs.map +1 -1
- package/dist/decorators/RoomDecorator.d.mts +9 -2
- package/dist/decorators/RoomDecorator.d.ts +9 -2
- package/dist/decorators/RoomDecorator.js.map +1 -1
- package/dist/decorators/RoomDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +4 -1
- package/dist/decorators/index.d.ts +4 -1
- package/dist/decorators/index.js +3 -3
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +3 -3
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/ActivityFunctions.d.mts +5 -2
- package/dist/functions/ActivityFunctions.d.ts +5 -2
- package/dist/functions/ActivityFunctions.js.map +1 -1
- package/dist/functions/ActivityFunctions.mjs.map +1 -1
- package/dist/functions/NavigationFunctions.d.mts +5 -2
- package/dist/functions/NavigationFunctions.d.ts +5 -2
- package/dist/functions/NavigationFunctions.js.map +1 -1
- package/dist/functions/NavigationFunctions.mjs.map +1 -1
- package/dist/functions/RoutineFunctions.d.mts +5 -2
- package/dist/functions/RoutineFunctions.d.ts +5 -2
- package/dist/functions/RoutineFunctions.js.map +1 -1
- package/dist/functions/RoutineFunctions.mjs.map +1 -1
- package/dist/functions/index.d.mts +5 -2
- package/dist/functions/index.d.ts +5 -2
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +155 -154
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +155 -154
- package/dist/index.mjs.map +1 -1
- package/dist/interface/ActivityProps.d.mts +3 -0
- package/dist/interface/ActivityProps.d.ts +3 -0
- package/dist/{override/GraphicHTMLElement.js → interface/ActivityProps.js} +1 -1
- package/dist/interface/ActivityProps.mjs +3 -0
- package/dist/interface/CommitmentProps.d.mts +8 -0
- package/dist/interface/CommitmentProps.d.ts +8 -0
- package/dist/{override/OnRunActivityProps.js → interface/CommitmentProps.js} +1 -1
- package/dist/interface/CommitmentProps.mjs +3 -0
- package/dist/interface/RoomActivityMemory.d.mts +9 -0
- package/dist/interface/RoomActivityMemory.d.ts +9 -0
- package/dist/interface/RoomActivityMemory.js +4 -0
- package/dist/interface/RoomActivityMemory.js.map +1 -0
- package/dist/interface/RoomActivityMemory.mjs +3 -0
- package/dist/interface/RoomActivityMemory.mjs.map +1 -0
- package/dist/interface/RoomProps.d.mts +8 -0
- package/dist/interface/RoomProps.d.ts +8 -0
- package/dist/interface/RoomProps.js +4 -0
- package/dist/interface/RoomProps.js.map +1 -0
- package/dist/interface/RoomProps.mjs +3 -0
- package/dist/interface/RoomProps.mjs.map +1 -0
- package/dist/interface/index.d.mts +12 -0
- package/dist/interface/index.d.ts +12 -0
- package/dist/interface/index.js +4 -0
- package/dist/interface/index.js.map +1 -0
- package/dist/interface/index.mjs +3 -0
- package/dist/interface/index.mjs.map +1 -0
- package/dist/interface/navigation/LocationProps.d.mts +8 -0
- package/dist/interface/navigation/LocationProps.d.ts +8 -0
- package/dist/interface/navigation/LocationProps.js +4 -0
- package/dist/interface/navigation/LocationProps.js.map +1 -0
- package/dist/interface/navigation/LocationProps.mjs +3 -0
- package/dist/interface/navigation/LocationProps.mjs.map +1 -0
- package/dist/interface/navigation/MapProps.d.mts +8 -0
- package/dist/interface/navigation/MapProps.d.ts +8 -0
- package/dist/interface/navigation/MapProps.js +4 -0
- package/dist/interface/navigation/MapProps.js.map +1 -0
- package/dist/interface/navigation/MapProps.mjs +3 -0
- package/dist/interface/navigation/MapProps.mjs.map +1 -0
- package/dist/interface/quest/GoalProps.d.mts +7 -0
- package/dist/interface/quest/GoalProps.d.ts +7 -0
- package/dist/interface/quest/GoalProps.js +4 -0
- package/dist/interface/quest/GoalProps.js.map +1 -0
- package/dist/interface/quest/GoalProps.mjs +3 -0
- package/dist/interface/quest/GoalProps.mjs.map +1 -0
- package/dist/interface/quest/QuestProps.d.mts +9 -0
- package/dist/interface/quest/QuestProps.d.ts +9 -0
- package/dist/interface/quest/QuestProps.js +4 -0
- package/dist/interface/quest/QuestProps.js.map +1 -0
- package/dist/interface/quest/QuestProps.mjs +3 -0
- package/dist/interface/quest/QuestProps.mjs.map +1 -0
- package/dist/interface/quest/StageProps.d.mts +5 -0
- package/dist/interface/quest/StageProps.d.ts +5 -0
- package/dist/interface/quest/StageProps.js +4 -0
- package/dist/interface/quest/StageProps.js.map +1 -0
- package/dist/interface/quest/StageProps.mjs +3 -0
- package/dist/interface/quest/StageProps.mjs.map +1 -0
- package/dist/managers/TimeManager.d.mts +1 -1
- package/dist/managers/TimeManager.d.ts +1 -1
- package/dist/managers/TimeManager.js +1 -1
- package/dist/managers/TimeManager.js.map +1 -1
- package/dist/managers/TimeManager.mjs +1 -1
- package/dist/managers/TimeManager.mjs.map +1 -1
- package/dist/managers/index.js +1 -1
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +1 -1
- package/dist/managers/index.mjs.map +1 -1
- package/dist/override/GraphicItemType.d.mts +3 -4
- package/dist/override/GraphicItemType.d.ts +3 -4
- package/dist/override/{OnRunActivityProps.d.mts → OnRunProps.d.mts} +3 -3
- package/dist/override/{OnRunActivityProps.d.ts → OnRunProps.d.ts} +3 -3
- package/dist/override/OnRunProps.js +4 -0
- package/dist/override/OnRunProps.js.map +1 -0
- package/dist/override/OnRunProps.mjs +3 -0
- package/dist/override/OnRunProps.mjs.map +1 -0
- package/dist/override/index.d.mts +1 -2
- package/dist/override/index.d.ts +1 -2
- package/dist/types/OnRunActivityEvent.d.mts +8 -0
- package/dist/types/OnRunActivityEvent.d.ts +8 -0
- package/dist/types/OnRunActivityEvent.js +4 -0
- package/dist/types/OnRunActivityEvent.js.map +1 -0
- package/dist/types/OnRunActivityEvent.mjs +3 -0
- package/dist/types/OnRunActivityEvent.mjs.map +1 -0
- package/dist/types/OnRunCommitmentEvent.d.mts +8 -0
- package/dist/types/OnRunCommitmentEvent.d.ts +8 -0
- package/dist/types/OnRunCommitmentEvent.js +4 -0
- package/dist/types/OnRunCommitmentEvent.js.map +1 -0
- package/dist/types/OnRunCommitmentEvent.mjs +3 -0
- package/dist/types/OnRunCommitmentEvent.mjs.map +1 -0
- package/dist/types/QuestsRequired.d.mts +4 -2
- package/dist/types/QuestsRequired.d.ts +4 -2
- package/dist/types/index.d.mts +4 -2
- package/dist/types/index.d.ts +4 -2
- package/package.json +1 -1
- package/dist/classes/navigation/index.d.mts +0 -5
- package/dist/classes/navigation/index.d.ts +0 -5
- package/dist/classes/navigation/index.js +0 -987
- package/dist/classes/navigation/index.js.map +0 -1
- package/dist/classes/navigation/index.mjs +0 -983
- package/dist/classes/navigation/index.mjs.map +0 -1
- package/dist/classes/quest/index.d.mts +0 -3
- package/dist/classes/quest/index.d.ts +0 -3
- package/dist/classes/quest/index.js +0 -133
- package/dist/classes/quest/index.js.map +0 -1
- package/dist/classes/quest/index.mjs +0 -129
- package/dist/classes/quest/index.mjs.map +0 -1
- package/dist/override/GraphicHTMLElement.d.mts +0 -7
- package/dist/override/GraphicHTMLElement.d.ts +0 -7
- package/dist/override/GraphicHTMLElement.mjs +0 -3
- package/dist/override/OnRunActivityProps.mjs +0 -3
- /package/dist/{override/GraphicHTMLElement.js.map → interface/ActivityProps.js.map} +0 -0
- /package/dist/{override/GraphicHTMLElement.mjs.map → interface/ActivityProps.mjs.map} +0 -0
- /package/dist/{override/OnRunActivityProps.js.map → interface/CommitmentProps.js.map} +0 -0
- /package/dist/{override/OnRunActivityProps.mjs.map → interface/CommitmentProps.mjs.map} +0 -0
|
@@ -1,14 +1,41 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { StoredClassModel, CharacterBaseModel } from '@drincs/pixi-vn';
|
|
1
|
+
import { GraphicItemType, OnRenderGraphicItemProps, OnRunActivityProps } 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-B1IaFbGD.js';
|
|
6
|
+
import { OnRunActivityEvent } from './types/OnRunActivityEvent.js';
|
|
7
|
+
import { OnRunCommitmentEvent } from './types/OnRunCommitmentEvent.js';
|
|
5
8
|
|
|
6
|
-
interface
|
|
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,76 @@ interface MapBaseModelProps {
|
|
|
23
50
|
* ```
|
|
24
51
|
* @default undefined
|
|
25
52
|
*/
|
|
26
|
-
renderImage?: 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
|
+
|
|
79
|
+
interface LocationProps<TMap extends MapBaseModel = MapBaseModel> {
|
|
80
|
+
/**
|
|
81
|
+
* The name
|
|
82
|
+
* @default ""
|
|
83
|
+
*/
|
|
84
|
+
name?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Whether is disabled. You can also pass a Pixi'VN flag name.
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
disabled?: boolean | string;
|
|
90
|
+
/**
|
|
91
|
+
* Whether is hidden. You can also pass a Pixi'VN flag name.
|
|
92
|
+
* @default false
|
|
93
|
+
*/
|
|
94
|
+
hidden?: boolean | string;
|
|
95
|
+
/**
|
|
96
|
+
* The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
|
|
97
|
+
* @default undefined
|
|
98
|
+
*/
|
|
99
|
+
renderIcon?: GraphicItemType | ((location: LocationBaseModel<TMap>, props: OnRenderGraphicItemProps) => GraphicItemType);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
interface MapProps {
|
|
103
|
+
/**
|
|
104
|
+
* The name
|
|
105
|
+
* @default ""
|
|
106
|
+
*/
|
|
107
|
+
name?: string;
|
|
108
|
+
/**
|
|
109
|
+
* The image. It can be a string, an Element or a Pixi'VN Canvas Item.
|
|
110
|
+
* Or an object to manage multiple image types. For example to have a image based on time.
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* {
|
|
114
|
+
* "morning": "morning-background.jpg",
|
|
115
|
+
* "afternoon": "afternoon-background.jpg",
|
|
116
|
+
* "evening": "evening-background.jpg",
|
|
117
|
+
* "night": "night-background.jpg"
|
|
118
|
+
* }
|
|
119
|
+
* ```
|
|
120
|
+
* @default undefined
|
|
121
|
+
*/
|
|
122
|
+
renderImage?: GraphicItemType | ((map: MapBaseModel, props: OnRenderGraphicItemProps) => GraphicItemType);
|
|
27
123
|
/**
|
|
28
124
|
* The neighboring maps that are available in this map.
|
|
29
125
|
* @example
|
|
@@ -51,6 +147,72 @@ interface MapBaseModelProps {
|
|
|
51
147
|
*/
|
|
52
148
|
hidden?: boolean | string;
|
|
53
149
|
}
|
|
150
|
+
|
|
151
|
+
interface RoomProps<TLocation extends LocationBaseModel = LocationBaseModel> {
|
|
152
|
+
/**
|
|
153
|
+
* The name
|
|
154
|
+
* @default ""
|
|
155
|
+
*/
|
|
156
|
+
name?: string;
|
|
157
|
+
/**
|
|
158
|
+
* The image. It can be a string, an Element or a Pixi'VN Canvas Item.
|
|
159
|
+
* Or an object to manage multiple image types. For example to have a image based on time.
|
|
160
|
+
* @example
|
|
161
|
+
* ```ts
|
|
162
|
+
* {
|
|
163
|
+
* "morning": "morning-background.jpg",
|
|
164
|
+
* "afternoon": "afternoon-background.jpg",
|
|
165
|
+
* "evening": "evening-background.jpg",
|
|
166
|
+
* "night": "night-background.jpg"
|
|
167
|
+
* }
|
|
168
|
+
* ```
|
|
169
|
+
* @default undefined
|
|
170
|
+
*/
|
|
171
|
+
renderImage?: GraphicItemType | ((room: RoomBaseModel<TLocation>, props: OnRenderGraphicItemProps) => GraphicItemType);
|
|
172
|
+
/**
|
|
173
|
+
* The activities that are available in this room.
|
|
174
|
+
* @default []
|
|
175
|
+
*/
|
|
176
|
+
defaultActivities?: ActivityModel[];
|
|
177
|
+
/**
|
|
178
|
+
* Whether is disabled. You can also pass a Pixi'VN flag name.
|
|
179
|
+
* @default false
|
|
180
|
+
*/
|
|
181
|
+
disabled?: boolean | string;
|
|
182
|
+
/**
|
|
183
|
+
* Whether is hidden. You can also pass a Pixi'VN flag name.
|
|
184
|
+
* @default false
|
|
185
|
+
*/
|
|
186
|
+
hidden?: boolean | string;
|
|
187
|
+
/**
|
|
188
|
+
* The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
|
|
189
|
+
* @default undefined
|
|
190
|
+
*/
|
|
191
|
+
renderIcon?: GraphicItemType | ((room: RoomBaseModel<TLocation>, props: OnRenderGraphicItemProps) => GraphicItemType);
|
|
192
|
+
/**
|
|
193
|
+
* Whether is an entrance room, so when the player enters in the location, it will be the first room to be shown.
|
|
194
|
+
* @default false
|
|
195
|
+
*/
|
|
196
|
+
isEntrance?: boolean;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* The activity generated by the room.
|
|
201
|
+
*/
|
|
202
|
+
declare class ActivityRoom<TRoom extends RoomBaseModel = RoomBaseModel> extends ActivityStoredAbstract {
|
|
203
|
+
constructor(id: string, room: TRoom, onRun: OnRunActivityEvent<ActivityStoredAbstract>, props: ActivityProps);
|
|
204
|
+
setStorageProperty<T>(_: string, __: T | undefined): void;
|
|
205
|
+
getStorageProperty<T>(propertyName: string): T | undefined;
|
|
206
|
+
private _id;
|
|
207
|
+
get id(): string;
|
|
208
|
+
/**
|
|
209
|
+
* The room where the activity is.
|
|
210
|
+
*/
|
|
211
|
+
private _room;
|
|
212
|
+
get room(): TRoom;
|
|
213
|
+
export(): object;
|
|
214
|
+
}
|
|
215
|
+
|
|
54
216
|
/**
|
|
55
217
|
* The base model of a map. I suggest you extend this class to create your own map model.
|
|
56
218
|
* @example
|
|
@@ -72,7 +234,7 @@ declare class MapBaseModel extends StoredClassModel {
|
|
|
72
234
|
* @param id The id of the map, it must be unique.
|
|
73
235
|
* @param props The properties of the map.
|
|
74
236
|
*/
|
|
75
|
-
constructor(id: string, props?:
|
|
237
|
+
constructor(id: string, props?: MapProps);
|
|
76
238
|
private defaultName;
|
|
77
239
|
/**
|
|
78
240
|
* The name of the map.
|
|
@@ -84,7 +246,7 @@ declare class MapBaseModel extends StoredClassModel {
|
|
|
84
246
|
/**
|
|
85
247
|
* The function for rendering the image of the map.
|
|
86
248
|
*/
|
|
87
|
-
get renderImage(): ((props
|
|
249
|
+
get renderImage(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
88
250
|
private defaultDisabled;
|
|
89
251
|
/**
|
|
90
252
|
* Whether is disabled. If it is a string, it is a Pixi'VN flag name.
|
|
@@ -124,70 +286,74 @@ declare class MapBaseModel extends StoredClassModel {
|
|
|
124
286
|
}
|
|
125
287
|
|
|
126
288
|
/**
|
|
127
|
-
* The
|
|
289
|
+
* The base model of a location. I suggest you extend this class to create your own location model.
|
|
290
|
+
* @example
|
|
291
|
+
* ```typescript
|
|
292
|
+
* export const mcHome = new LocationBaseModel('mc_home', mainMap, {
|
|
293
|
+
* name: 'MC Home',
|
|
294
|
+
* icon: "https://icon.jpg",
|
|
295
|
+
* });
|
|
296
|
+
* ```
|
|
128
297
|
*/
|
|
129
|
-
declare class
|
|
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;
|
|
298
|
+
declare class LocationBaseModel<TMap extends MapBaseModel = MapBaseModel> extends StoredClassModel {
|
|
135
299
|
/**
|
|
136
|
-
* The
|
|
300
|
+
* @param id The id of the location, it must be unique.
|
|
301
|
+
* @param map The map where the location is.
|
|
302
|
+
* @param props The properties of the location.
|
|
137
303
|
*/
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
export(): object;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
declare const ROOM_CATEGORY = "__nqtr-room__";
|
|
144
|
-
interface RoomBaseModelProps<TLocation extends LocationBaseModel = LocationBaseModel> {
|
|
304
|
+
constructor(id: string, map: TMap, props?: LocationProps<TMap>);
|
|
305
|
+
private defaultName;
|
|
145
306
|
/**
|
|
146
|
-
* The name
|
|
147
|
-
*
|
|
307
|
+
* The name of the location.
|
|
308
|
+
* If you set undefined, it will return the initial value of name.
|
|
148
309
|
*/
|
|
149
|
-
name
|
|
310
|
+
get name(): string;
|
|
311
|
+
set name(value: string | undefined);
|
|
312
|
+
private defaultDisabled;
|
|
150
313
|
/**
|
|
151
|
-
*
|
|
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
|
|
314
|
+
* Whether is disabled. If it is a string, it is a Pixi'VN flag name.
|
|
163
315
|
*/
|
|
164
|
-
|
|
316
|
+
get disabled(): boolean;
|
|
317
|
+
set disabled(value: boolean | string);
|
|
318
|
+
private defaultHidden;
|
|
165
319
|
/**
|
|
166
|
-
*
|
|
167
|
-
* @default []
|
|
320
|
+
* Whether is hidden. If it is a string, it is a Pixi'VN flag name.
|
|
168
321
|
*/
|
|
169
|
-
|
|
322
|
+
get hidden(): boolean;
|
|
323
|
+
set hidden(value: boolean | string);
|
|
324
|
+
private _renderIcon?;
|
|
170
325
|
/**
|
|
171
|
-
*
|
|
172
|
-
* @default false
|
|
326
|
+
* The function for rendering the icon of the location.
|
|
173
327
|
*/
|
|
174
|
-
|
|
328
|
+
get renderIcon(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
329
|
+
private _map;
|
|
175
330
|
/**
|
|
176
|
-
*
|
|
177
|
-
* @default false
|
|
331
|
+
* The map where the location is.
|
|
178
332
|
*/
|
|
179
|
-
|
|
333
|
+
get map(): TMap;
|
|
180
334
|
/**
|
|
181
|
-
*
|
|
182
|
-
*
|
|
335
|
+
* Get the entrance room of the location.
|
|
336
|
+
* You can cast the room to a specific type that extends RoomBaseModel.
|
|
337
|
+
* @returns The entrance room or the first room if there is no entrance.
|
|
338
|
+
* @example
|
|
339
|
+
* ```typescript
|
|
340
|
+
* const entranceHome = new RoomBaseModel("entrance-home", home, { isEntrance: true })
|
|
341
|
+
* saveRoom(entranceHome)
|
|
342
|
+
* const home = new LocationBaseModel("home", map, { name: "Home" })
|
|
343
|
+
*
|
|
344
|
+
* const entrance = home.getEntrance() // entrance === entranceHome
|
|
345
|
+
* ```
|
|
183
346
|
*/
|
|
184
|
-
|
|
347
|
+
getEntrance<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom | undefined;
|
|
185
348
|
/**
|
|
186
|
-
*
|
|
187
|
-
*
|
|
349
|
+
* Get all rooms in the location.
|
|
350
|
+
* You can cast the rooms to a specific type that extends RoomBaseModel.
|
|
351
|
+
* @returns The rooms in the location.
|
|
188
352
|
*/
|
|
189
|
-
|
|
353
|
+
getRooms<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom[];
|
|
190
354
|
}
|
|
355
|
+
|
|
356
|
+
declare const ROOM_CATEGORY = "__nqtr-room__";
|
|
191
357
|
/**
|
|
192
358
|
* The base model of a room. I suggest you extend this class to create your own room model.
|
|
193
359
|
* You must use the saveRoom function to save the room in the registered rooms.
|
|
@@ -208,7 +374,7 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
|
|
|
208
374
|
* @param location The location where the room is.
|
|
209
375
|
* @param props The properties of the room.
|
|
210
376
|
*/
|
|
211
|
-
constructor(id: string, location: TLocation, props?:
|
|
377
|
+
constructor(id: string, location: TLocation, props?: RoomProps<TLocation>);
|
|
212
378
|
private _location;
|
|
213
379
|
/**
|
|
214
380
|
* The location where the room is.
|
|
@@ -230,7 +396,7 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
|
|
|
230
396
|
/**
|
|
231
397
|
* The function for rendering the image of the room.
|
|
232
398
|
*/
|
|
233
|
-
get renderImage(): ((props
|
|
399
|
+
get renderImage(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
234
400
|
private defaultActivityIds;
|
|
235
401
|
/**
|
|
236
402
|
* The activities that are available in this room.
|
|
@@ -289,7 +455,7 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
|
|
|
289
455
|
/**
|
|
290
456
|
* The function for rendering the icon of the room.
|
|
291
457
|
*/
|
|
292
|
-
get renderIcon(): ((props
|
|
458
|
+
get renderIcon(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
293
459
|
/**
|
|
294
460
|
* Get the character commitments of the room.
|
|
295
461
|
* @returns The character commitments of the room.
|
|
@@ -297,165 +463,6 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
|
|
|
297
463
|
getRoutine<TCommitment extends CommitmentBaseModel = CommitmentBaseModel>(): TCommitment[];
|
|
298
464
|
}
|
|
299
465
|
|
|
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
466
|
/**
|
|
460
467
|
* The base model of a commitment. I suggest you extend this class to create your own commitment model.
|
|
461
468
|
* You must use the saveRoom function to save the commitment in the registered commitments.
|
|
@@ -468,7 +475,7 @@ interface CommitmentBaseModelProps<TCharacter extends CharacterBaseModel = Chara
|
|
|
468
475
|
* onRun: (commitment) => {
|
|
469
476
|
* // Do something
|
|
470
477
|
* }
|
|
471
|
-
})
|
|
478
|
+
* })
|
|
472
479
|
* saveCommitment(mcRoom)
|
|
473
480
|
* ```
|
|
474
481
|
*/
|
|
@@ -479,7 +486,7 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
|
|
|
479
486
|
* @param room The room where the commitment is.
|
|
480
487
|
* @param props The properties of the commitment.
|
|
481
488
|
*/
|
|
482
|
-
constructor(id: string, character: TCharacter | TCharacter[] | undefined, room: TRoom, props:
|
|
489
|
+
constructor(id: string, character: TCharacter | TCharacter[] | undefined, room: TRoom, props: CommitmentProps<TCharacter, TRoom>);
|
|
483
490
|
private _characters;
|
|
484
491
|
/**
|
|
485
492
|
* The character or characters that are in the commitment and so in the room.
|
|
@@ -527,7 +534,7 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
|
|
|
527
534
|
/**
|
|
528
535
|
* The function for rendering the image of the room.
|
|
529
536
|
*/
|
|
530
|
-
get renderImage(): ((props
|
|
537
|
+
get renderImage(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
531
538
|
private _executionType;
|
|
532
539
|
/**
|
|
533
540
|
* 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.
|
|
@@ -537,7 +544,7 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
|
|
|
537
544
|
/**
|
|
538
545
|
* Is a function that is called when the player interacts with the character.
|
|
539
546
|
*/
|
|
540
|
-
onRun(): void;
|
|
547
|
+
onRun(): undefined | ((props: OnRunActivityProps) => void);
|
|
541
548
|
private defaultDisabled;
|
|
542
549
|
/**
|
|
543
550
|
* Whether is disabled. You can also pass a Pixi'VN flag name.
|
|
@@ -557,4 +564,4 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
|
|
|
557
564
|
isExpired(): boolean;
|
|
558
565
|
}
|
|
559
566
|
|
|
560
|
-
export { ActivityRoom as A, CommitmentBaseModel as C, LocationBaseModel as L, MapBaseModel as M, RoomBaseModel as R, type
|
|
567
|
+
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 };
|