@drincs/nqtr 0.7.1 → 0.8.0
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/README.md +10 -0
- package/dist/handlers.cjs +1 -1
- package/dist/handlers.d.mts +71 -64
- package/dist/handlers.d.ts +71 -64
- package/dist/handlers.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts +98 -90
- package/dist/index.d.ts +98 -90
- package/dist/index.mjs +1 -1
- package/dist/ink.cjs +1 -1
- package/dist/ink.mjs +1 -1
- package/dist/registries.cjs +1 -1
- package/dist/registries.d.mts +45 -41
- package/dist/registries.d.ts +45 -41
- package/dist/registries.mjs +1 -1
- package/package.json +10 -3
package/dist/registries.d.mts
CHANGED
|
@@ -2,20 +2,6 @@ import { OnRunProps as OnRunProps$1, ActivityInterface as ActivityInterface$1, C
|
|
|
2
2
|
import { CharacterInterface, CachedMap } from '@drincs/pixi-vn';
|
|
3
3
|
import { StoredClassModel } from '@drincs/pixi-vn/storage';
|
|
4
4
|
|
|
5
|
-
type ExecutionType = "automatic" | "interaction";
|
|
6
|
-
|
|
7
|
-
type OnRunProps = OnRunProps$1;
|
|
8
|
-
/**
|
|
9
|
-
* The function that is called when the class is runned.
|
|
10
|
-
*/
|
|
11
|
-
type OnRunEvent<T> = (item: T, props: OnRunProps) => any | Promise<any>;
|
|
12
|
-
type OnRunAsyncFunction = (props: OnRunProps) => Promise<any>;
|
|
13
|
-
|
|
14
|
-
type QuestsRequiredType = {
|
|
15
|
-
quest: QuestInterface;
|
|
16
|
-
stageNumber: number;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
5
|
interface DateSchedulingInterface {
|
|
20
6
|
/**
|
|
21
7
|
* The start date. If the item hasn't started yet, it will be hidden.
|
|
@@ -44,21 +30,38 @@ interface TimeSchedulingInterface {
|
|
|
44
30
|
to?: number;
|
|
45
31
|
}
|
|
46
32
|
|
|
47
|
-
interface
|
|
48
|
-
}
|
|
49
|
-
interface ActivityBaseInternalInterface {
|
|
50
|
-
/**
|
|
51
|
-
* The id of the activity/commitment.
|
|
52
|
-
*/
|
|
53
|
-
readonly id: string;
|
|
33
|
+
interface ActiveScheduling {
|
|
54
34
|
/**
|
|
55
35
|
* Time slot in which activity/commitment will be active.
|
|
56
36
|
*/
|
|
57
|
-
readonly timeSlot
|
|
37
|
+
readonly timeSlot?: TimeSchedulingInterface[] | TimeSchedulingInterface;
|
|
58
38
|
/**
|
|
59
39
|
* Used to schedule what date it will be added and removed.
|
|
60
40
|
*/
|
|
61
|
-
readonly dateScheduling
|
|
41
|
+
readonly dateScheduling?: DateSchedulingInterface;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
type ExecutionType = "automatic" | "interaction";
|
|
45
|
+
|
|
46
|
+
type OnRunProps = OnRunProps$1;
|
|
47
|
+
/**
|
|
48
|
+
* The function that is called when the class is runned.
|
|
49
|
+
*/
|
|
50
|
+
type OnRunEvent<T> = (item: T, props: OnRunProps) => any | Promise<any>;
|
|
51
|
+
type OnRunAsyncFunction = (props: OnRunProps) => Promise<any>;
|
|
52
|
+
|
|
53
|
+
type QuestsRequiredType = {
|
|
54
|
+
quest: QuestInterface;
|
|
55
|
+
stageNumber: number;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
interface ActivityInterface extends ActivityBaseInternalInterface, ActivityInterface$1 {
|
|
59
|
+
}
|
|
60
|
+
interface ActivityBaseInternalInterface extends ActiveScheduling {
|
|
61
|
+
/**
|
|
62
|
+
* The id of the activity/commitment.
|
|
63
|
+
*/
|
|
64
|
+
readonly id: string;
|
|
62
65
|
/**
|
|
63
66
|
* The function that is called when the activity/commitment is runned.
|
|
64
67
|
*/
|
|
@@ -70,9 +73,10 @@ interface ActivityBaseInternalInterface {
|
|
|
70
73
|
*/
|
|
71
74
|
readonly expired: boolean;
|
|
72
75
|
/**
|
|
73
|
-
* Whether the activity/commitment is active.
|
|
76
|
+
* Whether the activity/commitment is active, so it will be shown in the routine and can be runned.
|
|
77
|
+
* @param options The options to check if the activity/commitment is active.
|
|
74
78
|
*/
|
|
75
|
-
|
|
79
|
+
isActive(options?: ActiveScheduling): boolean;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
interface CommitmentInterface extends CommitmentBaseInternalInterface, CommitmentInterface$1 {
|
|
@@ -82,10 +86,6 @@ interface CommitmentBaseInternalInterface extends ActivityBaseInternalInterface
|
|
|
82
86
|
* The character or characters that are in the commitment and so in the room.
|
|
83
87
|
*/
|
|
84
88
|
readonly characters: CharacterInterface[];
|
|
85
|
-
/**
|
|
86
|
-
* The room where the commitment is.
|
|
87
|
-
*/
|
|
88
|
-
readonly room: RoomInterface;
|
|
89
89
|
/**
|
|
90
90
|
* 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.
|
|
91
91
|
* If you set "automatic" remember to remove the commitment when it is no longer needed, because otherwise it repeats itself every time.
|
|
@@ -105,22 +105,13 @@ interface NavigationAbstractInterface extends StoredClassModel {
|
|
|
105
105
|
* @param options
|
|
106
106
|
* @returns
|
|
107
107
|
*/
|
|
108
|
-
addActivity(activity: ActivityInterface, options?:
|
|
109
|
-
/**
|
|
110
|
-
* Time slot in which activity will be active.
|
|
111
|
-
*/
|
|
112
|
-
timeSlot?: TimeSchedulingInterface;
|
|
113
|
-
/**
|
|
114
|
-
* Used to schedule what date it will be added and removed.
|
|
115
|
-
*/
|
|
116
|
-
dateScheduling?: DateSchedulingInterface;
|
|
117
|
-
}): void;
|
|
108
|
+
addActivity(activity: ActivityInterface, options?: ActiveScheduling): void;
|
|
118
109
|
/**
|
|
119
110
|
* Disconnects the activity from the class.
|
|
120
111
|
* @param activity The activity to disconnect from the class.
|
|
121
112
|
* @param options
|
|
122
113
|
*/
|
|
123
|
-
removeActivity(activity: ActivityInterface | string
|
|
114
|
+
removeActivity(activity: ActivityInterface | string): void;
|
|
124
115
|
/**
|
|
125
116
|
* Removes the useless activities.
|
|
126
117
|
*/
|
|
@@ -178,6 +169,19 @@ interface RoomBaseInternalInterface extends NavigationAbstractInterface {
|
|
|
178
169
|
* The location where the room is.
|
|
179
170
|
*/
|
|
180
171
|
readonly location: LocationInterface;
|
|
172
|
+
/**
|
|
173
|
+
* Connects the commitment to the class.
|
|
174
|
+
* @param commitment The commitment to connect to the class.
|
|
175
|
+
* @param options
|
|
176
|
+
* @returns
|
|
177
|
+
*/
|
|
178
|
+
addCommitment(commitment: CommitmentInterface, options?: ActiveScheduling): void;
|
|
179
|
+
/**
|
|
180
|
+
* Disconnects the commitment from the class.
|
|
181
|
+
* @param commitment The commitment to disconnect from the class.
|
|
182
|
+
* @param options
|
|
183
|
+
*/
|
|
184
|
+
removeCommitment(commitment: CommitmentInterface | string): void;
|
|
181
185
|
/**
|
|
182
186
|
* Get the character commitments of the room.
|
|
183
187
|
*/
|
|
@@ -381,7 +385,7 @@ declare namespace RegisteredActivities {
|
|
|
381
385
|
* The key is the id of the commitment and the value is the commitment itself.
|
|
382
386
|
*/
|
|
383
387
|
declare const registeredCommitments: CachedMap<string, CommitmentInterface>;
|
|
384
|
-
declare const fixedCommitments: CachedMap<string, CommitmentInterface>;
|
|
388
|
+
declare const fixedCommitments: CachedMap<string, [CommitmentInterface, string]>;
|
|
385
389
|
declare namespace RegisteredCommitments {
|
|
386
390
|
/**
|
|
387
391
|
* Save a commitment in the registered commitments. If the commitment already exists, it will be overwritten.
|
package/dist/registries.d.ts
CHANGED
|
@@ -2,20 +2,6 @@ import { OnRunProps as OnRunProps$1, ActivityInterface as ActivityInterface$1, C
|
|
|
2
2
|
import { CharacterInterface, CachedMap } from '@drincs/pixi-vn';
|
|
3
3
|
import { StoredClassModel } from '@drincs/pixi-vn/storage';
|
|
4
4
|
|
|
5
|
-
type ExecutionType = "automatic" | "interaction";
|
|
6
|
-
|
|
7
|
-
type OnRunProps = OnRunProps$1;
|
|
8
|
-
/**
|
|
9
|
-
* The function that is called when the class is runned.
|
|
10
|
-
*/
|
|
11
|
-
type OnRunEvent<T> = (item: T, props: OnRunProps) => any | Promise<any>;
|
|
12
|
-
type OnRunAsyncFunction = (props: OnRunProps) => Promise<any>;
|
|
13
|
-
|
|
14
|
-
type QuestsRequiredType = {
|
|
15
|
-
quest: QuestInterface;
|
|
16
|
-
stageNumber: number;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
5
|
interface DateSchedulingInterface {
|
|
20
6
|
/**
|
|
21
7
|
* The start date. If the item hasn't started yet, it will be hidden.
|
|
@@ -44,21 +30,38 @@ interface TimeSchedulingInterface {
|
|
|
44
30
|
to?: number;
|
|
45
31
|
}
|
|
46
32
|
|
|
47
|
-
interface
|
|
48
|
-
}
|
|
49
|
-
interface ActivityBaseInternalInterface {
|
|
50
|
-
/**
|
|
51
|
-
* The id of the activity/commitment.
|
|
52
|
-
*/
|
|
53
|
-
readonly id: string;
|
|
33
|
+
interface ActiveScheduling {
|
|
54
34
|
/**
|
|
55
35
|
* Time slot in which activity/commitment will be active.
|
|
56
36
|
*/
|
|
57
|
-
readonly timeSlot
|
|
37
|
+
readonly timeSlot?: TimeSchedulingInterface[] | TimeSchedulingInterface;
|
|
58
38
|
/**
|
|
59
39
|
* Used to schedule what date it will be added and removed.
|
|
60
40
|
*/
|
|
61
|
-
readonly dateScheduling
|
|
41
|
+
readonly dateScheduling?: DateSchedulingInterface;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
type ExecutionType = "automatic" | "interaction";
|
|
45
|
+
|
|
46
|
+
type OnRunProps = OnRunProps$1;
|
|
47
|
+
/**
|
|
48
|
+
* The function that is called when the class is runned.
|
|
49
|
+
*/
|
|
50
|
+
type OnRunEvent<T> = (item: T, props: OnRunProps) => any | Promise<any>;
|
|
51
|
+
type OnRunAsyncFunction = (props: OnRunProps) => Promise<any>;
|
|
52
|
+
|
|
53
|
+
type QuestsRequiredType = {
|
|
54
|
+
quest: QuestInterface;
|
|
55
|
+
stageNumber: number;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
interface ActivityInterface extends ActivityBaseInternalInterface, ActivityInterface$1 {
|
|
59
|
+
}
|
|
60
|
+
interface ActivityBaseInternalInterface extends ActiveScheduling {
|
|
61
|
+
/**
|
|
62
|
+
* The id of the activity/commitment.
|
|
63
|
+
*/
|
|
64
|
+
readonly id: string;
|
|
62
65
|
/**
|
|
63
66
|
* The function that is called when the activity/commitment is runned.
|
|
64
67
|
*/
|
|
@@ -70,9 +73,10 @@ interface ActivityBaseInternalInterface {
|
|
|
70
73
|
*/
|
|
71
74
|
readonly expired: boolean;
|
|
72
75
|
/**
|
|
73
|
-
* Whether the activity/commitment is active.
|
|
76
|
+
* Whether the activity/commitment is active, so it will be shown in the routine and can be runned.
|
|
77
|
+
* @param options The options to check if the activity/commitment is active.
|
|
74
78
|
*/
|
|
75
|
-
|
|
79
|
+
isActive(options?: ActiveScheduling): boolean;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
interface CommitmentInterface extends CommitmentBaseInternalInterface, CommitmentInterface$1 {
|
|
@@ -82,10 +86,6 @@ interface CommitmentBaseInternalInterface extends ActivityBaseInternalInterface
|
|
|
82
86
|
* The character or characters that are in the commitment and so in the room.
|
|
83
87
|
*/
|
|
84
88
|
readonly characters: CharacterInterface[];
|
|
85
|
-
/**
|
|
86
|
-
* The room where the commitment is.
|
|
87
|
-
*/
|
|
88
|
-
readonly room: RoomInterface;
|
|
89
89
|
/**
|
|
90
90
|
* 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.
|
|
91
91
|
* If you set "automatic" remember to remove the commitment when it is no longer needed, because otherwise it repeats itself every time.
|
|
@@ -105,22 +105,13 @@ interface NavigationAbstractInterface extends StoredClassModel {
|
|
|
105
105
|
* @param options
|
|
106
106
|
* @returns
|
|
107
107
|
*/
|
|
108
|
-
addActivity(activity: ActivityInterface, options?:
|
|
109
|
-
/**
|
|
110
|
-
* Time slot in which activity will be active.
|
|
111
|
-
*/
|
|
112
|
-
timeSlot?: TimeSchedulingInterface;
|
|
113
|
-
/**
|
|
114
|
-
* Used to schedule what date it will be added and removed.
|
|
115
|
-
*/
|
|
116
|
-
dateScheduling?: DateSchedulingInterface;
|
|
117
|
-
}): void;
|
|
108
|
+
addActivity(activity: ActivityInterface, options?: ActiveScheduling): void;
|
|
118
109
|
/**
|
|
119
110
|
* Disconnects the activity from the class.
|
|
120
111
|
* @param activity The activity to disconnect from the class.
|
|
121
112
|
* @param options
|
|
122
113
|
*/
|
|
123
|
-
removeActivity(activity: ActivityInterface | string
|
|
114
|
+
removeActivity(activity: ActivityInterface | string): void;
|
|
124
115
|
/**
|
|
125
116
|
* Removes the useless activities.
|
|
126
117
|
*/
|
|
@@ -178,6 +169,19 @@ interface RoomBaseInternalInterface extends NavigationAbstractInterface {
|
|
|
178
169
|
* The location where the room is.
|
|
179
170
|
*/
|
|
180
171
|
readonly location: LocationInterface;
|
|
172
|
+
/**
|
|
173
|
+
* Connects the commitment to the class.
|
|
174
|
+
* @param commitment The commitment to connect to the class.
|
|
175
|
+
* @param options
|
|
176
|
+
* @returns
|
|
177
|
+
*/
|
|
178
|
+
addCommitment(commitment: CommitmentInterface, options?: ActiveScheduling): void;
|
|
179
|
+
/**
|
|
180
|
+
* Disconnects the commitment from the class.
|
|
181
|
+
* @param commitment The commitment to disconnect from the class.
|
|
182
|
+
* @param options
|
|
183
|
+
*/
|
|
184
|
+
removeCommitment(commitment: CommitmentInterface | string): void;
|
|
181
185
|
/**
|
|
182
186
|
* Get the character commitments of the room.
|
|
183
187
|
*/
|
|
@@ -381,7 +385,7 @@ declare namespace RegisteredActivities {
|
|
|
381
385
|
* The key is the id of the commitment and the value is the commitment itself.
|
|
382
386
|
*/
|
|
383
387
|
declare const registeredCommitments: CachedMap<string, CommitmentInterface>;
|
|
384
|
-
declare const fixedCommitments: CachedMap<string, CommitmentInterface>;
|
|
388
|
+
declare const fixedCommitments: CachedMap<string, [CommitmentInterface, string]>;
|
|
385
389
|
declare namespace RegisteredCommitments {
|
|
386
390
|
/**
|
|
387
391
|
* Save a commitment in the registered commitments. If the commitment already exists, it will be overwritten.
|
package/dist/registries.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {CachedMap}from'@drincs/pixi-vn';var t;(n=>(n.log=(e,...r)=>console.log(`[NQTR] ${e}`,...r),n.warn=(e,...r)=>console.warn(`[NQTR] ${e}`,...r),n.error=(e,...r)=>console.error(`[NQTR] ${e}`,...r),n.info=(e,...r)=>console.info(`[NQTR] ${e}`,...r)))(t||(t={}));var s=new CachedMap({cacheSize:20}),
|
|
1
|
+
import {CachedMap}from'@drincs/pixi-vn';var t;(n=>(n.log=(e,...r)=>console.log(`[NQTR] ${e}`,...r),n.warn=(e,...r)=>console.warn(`[NQTR] ${e}`,...r),n.error=(e,...r)=>console.error(`[NQTR] ${e}`,...r),n.info=(e,...r)=>console.info(`[NQTR] ${e}`,...r)))(t||(t={}));var s=new CachedMap({cacheSize:20}),g;(n=>{function o(e){if(Array.isArray(e)){e.forEach(r=>n.add(r));return}s.set(e.id,e);}n.add=o;function a(e){try{let r=s.get(e);if(!r){console.warn(`[NQTR] Activity ${e} not found, you should register it first`);return}return r}catch(r){t.error(`Error while getting Activity ${e}`,r);return}}n.get=a;function i(){return Array.from(s.values())}n.values=i;function f(e){return s.has(e)}n.has=f;})(g||(g={}));var M=g;var c=new CachedMap({cacheSize:20}),$=new CachedMap({cacheSize:20}),l;(n=>{function o(e){if(Array.isArray(e)){e.forEach(r=>n.add(r));return}c.set(e.id,e);}n.add=o;function a(e){try{let r=c.get(e);if(!r){console.warn(`[NQTR] Commitment ${e} not found, you should register it first`);return}return r}catch(r){t.error(`Error while getting Commitment ${e}`,r);return}}n.get=a;function i(){return Array.from(c.values())}n.values=i;function f(e){return c.has(e)}n.has=f;})(l||(l={}));var E=l;var u=new CachedMap({cacheSize:20}),y;(n=>{function o(e){if(Array.isArray(e)){e.forEach(r=>o(r));return}u.set(e.id,e);}n.add=o;function a(e){try{let r=u.get(e);if(!r){console.warn(`[NQTR] Location ${e} not found, you should register it first`);return}return r}catch(r){t.error(`Error while getting Location ${e}`,r);return}}n.get=a;function i(){return Array.from(u.values())}n.values=i;function f(e){return u.has(e)}n.has=f;})(y||(y={}));var h=y;var m=new CachedMap({cacheSize:20}),x;(n=>{function o(e){if(Array.isArray(e)){e.forEach(r=>o(r));return}m.set(e.id,e);}n.add=o;function a(e){try{let r=m.get(e);if(!r){console.warn(`[NQTR] Map ${e} not found, you should register it first`);return}return r}catch(r){t.error(`Error while getting Map ${e}`,r);return}}n.get=a;function i(){return Array.from(m.values())}n.values=i;function f(e){return m.has(e)}n.has=f;})(x||(x={}));var I=x;var p=new CachedMap({cacheSize:5}),A;(n=>{function o(e){if(Array.isArray(e)){e.forEach(r=>n.add(r));return}p.set(e.id,e);}n.add=o;function a(e){try{let r=p.get(e);if(!r){console.warn(`[NQTR] Quest ${e} not found, you should register it first`);return}return r}catch(r){t.error(`Error while getting Quest ${e}`,r);return}}n.get=a;function i(){return Array.from(p.values())}n.values=i;function f(e){return p.has(e)}n.has=f;})(A||(A={}));var z=A;var d=new CachedMap({cacheSize:20}),w;(n=>{function o(e){if(Array.isArray(e)){e.forEach(C=>o(C));return}d.set(e.id,e);let r=e.location;h.add(r);let R=r?.map;R&&I.add(R);}n.add=o;function a(e){try{let r=d.get(e);if(!r){console.warn(`[NQTR] Room ${e} not found, you should register it first`);return}return r}catch(r){t.error(`Error while getting Room ${e}`,r);return}}n.get=a;function i(){return Array.from(d.values())}n.values=i;function f(e){return d.has(e)}n.has=f;})(w||(w={}));var b=w;export{M as RegisteredActivities,E as RegisteredCommitments,h as RegisteredLocations,I as RegisteredMaps,z as RegisteredQuests,b as RegisteredRooms,$ as fixedCommitments,c as registeredCommitments};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drincs/nqtr",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "A complete system introducing the concepts of location, time and event, producing the framework of a not-quite-point-and-click adventure game.",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -62,7 +62,8 @@
|
|
|
62
62
|
},
|
|
63
63
|
"homepage": "https://pixi-vn.web.app/nqtr",
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@drincs/pixi-vn-ink": "^0.
|
|
65
|
+
"@drincs/pixi-vn-ink": "^0.12.2",
|
|
66
|
+
"@drincs/pixi-vn-json": "^1.10.1",
|
|
66
67
|
"jsdom": "^28.0.0",
|
|
67
68
|
"ts-node": "^10.9.2",
|
|
68
69
|
"tsup": "^8.5.1",
|
|
@@ -71,7 +72,13 @@
|
|
|
71
72
|
"vitest": "^4.0.18"
|
|
72
73
|
},
|
|
73
74
|
"peerDependencies": {
|
|
74
|
-
"@drincs/pixi-vn": ">=1.
|
|
75
|
+
"@drincs/pixi-vn": ">=1.5.17",
|
|
76
|
+
"@drincs/pixi-vn-ink": "^0.12.2"
|
|
77
|
+
},
|
|
78
|
+
"peerDependenciesMeta": {
|
|
79
|
+
"@drincs/pixi-vn-ink": {
|
|
80
|
+
"optional": true
|
|
81
|
+
}
|
|
75
82
|
},
|
|
76
83
|
"keywords": [
|
|
77
84
|
"game",
|