@drincs/nqtr 0.2.11 → 0.2.13
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-BkHX8xkA.d.ts → ActivityProps-LWY7Zucl.d.ts} +2 -2
- package/dist/{ActivityProps-D45DQdcT.d.mts → ActivityProps-WgXDAYbc.d.mts} +2 -2
- package/dist/{Commitment-BHB-jYOi.d.mts → Commitment-BujJuTv8.d.mts} +11 -17
- package/dist/{Commitment-D-1lsnnU.d.ts → Commitment-DFYAApxl.d.ts} +11 -17
- package/dist/{StageProps-CuE_n1Wg.d.mts → StageProps-CqgBUi3e.d.mts} +1 -1
- package/dist/{StageProps-CCjGI625.d.ts → StageProps-DghO7WaT.d.ts} +1 -1
- package/dist/classes/Activity.d.mts +1 -1
- package/dist/classes/Activity.d.ts +1 -1
- package/dist/classes/Activity.js +1 -381
- package/dist/classes/Activity.js.map +1 -1
- package/dist/classes/Activity.mjs +1 -379
- package/dist/classes/Activity.mjs.map +1 -1
- package/dist/classes/ActivityStoredAbstract.d.mts +1 -1
- package/dist/classes/ActivityStoredAbstract.d.ts +1 -1
- package/dist/classes/ActivityStoredAbstract.js +1 -398
- package/dist/classes/ActivityStoredAbstract.js.map +1 -1
- package/dist/classes/ActivityStoredAbstract.mjs +1 -396
- package/dist/classes/ActivityStoredAbstract.mjs.map +1 -1
- package/dist/classes/Commitment.d.mts +2 -2
- package/dist/classes/Commitment.d.ts +2 -2
- package/dist/classes/Commitment.js +1 -438
- package/dist/classes/Commitment.js.map +1 -1
- package/dist/classes/Commitment.mjs +1 -436
- package/dist/classes/Commitment.mjs.map +1 -1
- package/dist/classes/index.d.mts +3 -3
- package/dist/classes/index.d.ts +3 -3
- package/dist/classes/index.js +1 -1699
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +1 -1690
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/navigation/ActivityRoom.d.mts +2 -2
- package/dist/classes/navigation/ActivityRoom.d.ts +2 -2
- package/dist/classes/navigation/ActivityRoom.js +1 -448
- package/dist/classes/navigation/ActivityRoom.js.map +1 -1
- package/dist/classes/navigation/ActivityRoom.mjs +1 -446
- package/dist/classes/navigation/ActivityRoom.mjs.map +1 -1
- package/dist/classes/navigation/Location.d.mts +2 -2
- package/dist/classes/navigation/Location.d.ts +2 -2
- package/dist/classes/navigation/Location.js +1 -118
- package/dist/classes/navigation/Location.js.map +1 -1
- package/dist/classes/navigation/Location.mjs +1 -116
- package/dist/classes/navigation/Location.mjs.map +1 -1
- package/dist/classes/navigation/Map.d.mts +2 -2
- package/dist/classes/navigation/Map.d.ts +2 -2
- package/dist/classes/navigation/Map.js +1 -113
- package/dist/classes/navigation/Map.js.map +1 -1
- package/dist/classes/navigation/Map.mjs +1 -111
- package/dist/classes/navigation/Map.mjs.map +1 -1
- package/dist/classes/navigation/Room.d.mts +2 -2
- package/dist/classes/navigation/Room.d.ts +2 -2
- package/dist/classes/navigation/Room.js +1 -778
- package/dist/classes/navigation/Room.js.map +1 -1
- package/dist/classes/navigation/Room.mjs +1 -773
- package/dist/classes/navigation/Room.mjs.map +1 -1
- package/dist/classes/quest/Goal.js +1 -85
- package/dist/classes/quest/Goal.js.map +1 -1
- package/dist/classes/quest/Goal.mjs +1 -80
- package/dist/classes/quest/Goal.mjs.map +1 -1
- package/dist/classes/quest/Quest.d.mts +1 -1
- package/dist/classes/quest/Quest.d.ts +1 -1
- package/dist/classes/quest/Quest.js +1 -769
- package/dist/classes/quest/Quest.js.map +1 -1
- package/dist/classes/quest/Quest.mjs +1 -767
- package/dist/classes/quest/Quest.mjs.map +1 -1
- package/dist/classes/quest/Stage.d.mts +1 -1
- package/dist/classes/quest/Stage.d.ts +1 -1
- package/dist/classes/quest/Stage.js +1 -536
- package/dist/classes/quest/Stage.js.map +1 -1
- package/dist/classes/quest/Stage.mjs +1 -531
- package/dist/classes/quest/Stage.mjs.map +1 -1
- package/dist/constants.d.mts +4 -0
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -0
- package/dist/constants.mjs +2 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/decorators/ActivityDecorator.d.mts +1 -1
- package/dist/decorators/ActivityDecorator.d.ts +1 -1
- package/dist/decorators/ActivityDecorator.js +1 -407
- package/dist/decorators/ActivityDecorator.js.map +1 -1
- package/dist/decorators/ActivityDecorator.mjs +1 -403
- package/dist/decorators/ActivityDecorator.mjs.map +1 -1
- package/dist/decorators/CommitmentDecorator.d.mts +2 -2
- package/dist/decorators/CommitmentDecorator.d.ts +2 -2
- package/dist/decorators/CommitmentDecorator.js +1 -91
- package/dist/decorators/CommitmentDecorator.js.map +1 -1
- package/dist/decorators/CommitmentDecorator.mjs +1 -81
- package/dist/decorators/CommitmentDecorator.mjs.map +1 -1
- package/dist/decorators/QuestDecorator.d.mts +1 -1
- package/dist/decorators/QuestDecorator.d.ts +1 -1
- package/dist/decorators/QuestDecorator.js +1 -799
- package/dist/decorators/QuestDecorator.js.map +1 -1
- package/dist/decorators/QuestDecorator.mjs +1 -794
- package/dist/decorators/QuestDecorator.mjs.map +1 -1
- package/dist/decorators/RoomDecorator.d.mts +2 -2
- package/dist/decorators/RoomDecorator.d.ts +2 -2
- package/dist/decorators/RoomDecorator.js +1 -56
- package/dist/decorators/RoomDecorator.js.map +1 -1
- package/dist/decorators/RoomDecorator.mjs +1 -48
- package/dist/decorators/RoomDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +3 -3
- package/dist/decorators/index.d.ts +3 -3
- package/dist/decorators/index.js +1 -1068
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +1 -1053
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/ActivityFunctions.d.mts +2 -2
- package/dist/functions/ActivityFunctions.d.ts +2 -2
- package/dist/functions/ActivityFunctions.js +1 -53
- package/dist/functions/ActivityFunctions.js.map +1 -1
- package/dist/functions/ActivityFunctions.mjs +1 -50
- package/dist/functions/ActivityFunctions.mjs.map +1 -1
- package/dist/functions/NavigationFunctions.d.mts +2 -2
- package/dist/functions/NavigationFunctions.d.ts +2 -2
- package/dist/functions/NavigationFunctions.js +1 -181
- package/dist/functions/NavigationFunctions.js.map +1 -1
- package/dist/functions/NavigationFunctions.mjs +1 -176
- package/dist/functions/NavigationFunctions.mjs.map +1 -1
- package/dist/functions/QuestFunctions.js +1 -20
- package/dist/functions/QuestFunctions.js.map +1 -1
- package/dist/functions/QuestFunctions.mjs +1 -18
- package/dist/functions/QuestFunctions.mjs.map +1 -1
- package/dist/functions/RoutineFunctions.d.mts +4 -4
- package/dist/functions/RoutineFunctions.d.ts +4 -4
- package/dist/functions/RoutineFunctions.js +1 -126
- package/dist/functions/RoutineFunctions.js.map +1 -1
- package/dist/functions/RoutineFunctions.mjs +1 -121
- package/dist/functions/RoutineFunctions.mjs.map +1 -1
- package/dist/functions/index.d.mts +2 -2
- package/dist/functions/index.d.ts +2 -2
- package/dist/functions/index.js +1 -293
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +1 -281
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +55 -13
- package/dist/index.d.ts +55 -13
- package/dist/index.js +1 -2057
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -2022
- package/dist/index.mjs.map +1 -1
- package/dist/interface/ActivityProps.d.mts +1 -1
- package/dist/interface/ActivityProps.d.ts +1 -1
- package/dist/interface/ActivityProps.js +1 -3
- package/dist/interface/ActivityProps.js.map +1 -1
- package/dist/interface/ActivityProps.mjs +1 -2
- package/dist/interface/ActivityProps.mjs.map +1 -1
- package/dist/interface/CommitmentProps.d.mts +2 -2
- package/dist/interface/CommitmentProps.d.ts +2 -2
- package/dist/interface/CommitmentProps.js +1 -3
- package/dist/interface/CommitmentProps.js.map +1 -1
- package/dist/interface/CommitmentProps.mjs +1 -2
- package/dist/interface/CommitmentProps.mjs.map +1 -1
- package/dist/interface/RoomActivityMemory.d.mts +1 -1
- package/dist/interface/RoomActivityMemory.d.ts +1 -1
- package/dist/interface/RoomActivityMemory.js +1 -3
- package/dist/interface/RoomActivityMemory.js.map +1 -1
- package/dist/interface/RoomActivityMemory.mjs +1 -2
- package/dist/interface/RoomActivityMemory.mjs.map +1 -1
- package/dist/interface/RoomProps.d.mts +2 -2
- package/dist/interface/RoomProps.d.ts +2 -2
- package/dist/interface/RoomProps.js +1 -3
- package/dist/interface/RoomProps.js.map +1 -1
- package/dist/interface/RoomProps.mjs +1 -2
- package/dist/interface/RoomProps.mjs.map +1 -1
- package/dist/interface/index.d.mts +3 -3
- package/dist/interface/index.d.ts +3 -3
- package/dist/interface/index.js +1 -3
- package/dist/interface/index.js.map +1 -1
- package/dist/interface/index.mjs +1 -2
- package/dist/interface/index.mjs.map +1 -1
- package/dist/interface/navigation/LocationProps.d.mts +2 -2
- package/dist/interface/navigation/LocationProps.d.ts +2 -2
- package/dist/interface/navigation/LocationProps.js +1 -3
- package/dist/interface/navigation/LocationProps.js.map +1 -1
- package/dist/interface/navigation/LocationProps.mjs +1 -2
- package/dist/interface/navigation/LocationProps.mjs.map +1 -1
- package/dist/interface/navigation/MapProps.d.mts +2 -2
- package/dist/interface/navigation/MapProps.d.ts +2 -2
- package/dist/interface/navigation/MapProps.js +1 -3
- package/dist/interface/navigation/MapProps.js.map +1 -1
- package/dist/interface/navigation/MapProps.mjs +1 -2
- package/dist/interface/navigation/MapProps.mjs.map +1 -1
- package/dist/interface/quest/GoalProps.js +1 -3
- package/dist/interface/quest/GoalProps.js.map +1 -1
- package/dist/interface/quest/GoalProps.mjs +1 -2
- package/dist/interface/quest/GoalProps.mjs.map +1 -1
- package/dist/interface/quest/QuestProps.d.mts +1 -1
- package/dist/interface/quest/QuestProps.d.ts +1 -1
- package/dist/interface/quest/QuestProps.js +1 -3
- package/dist/interface/quest/QuestProps.js.map +1 -1
- package/dist/interface/quest/QuestProps.mjs +1 -2
- package/dist/interface/quest/QuestProps.mjs.map +1 -1
- package/dist/interface/quest/StageFlags.js +1 -3
- package/dist/interface/quest/StageFlags.js.map +1 -1
- package/dist/interface/quest/StageFlags.mjs +1 -2
- package/dist/interface/quest/StageFlags.mjs.map +1 -1
- package/dist/interface/quest/StageProps.d.mts +1 -1
- package/dist/interface/quest/StageProps.d.ts +1 -1
- package/dist/interface/quest/StageProps.js +1 -3
- package/dist/interface/quest/StageProps.js.map +1 -1
- package/dist/interface/quest/StageProps.mjs +1 -2
- package/dist/interface/quest/StageProps.mjs.map +1 -1
- package/dist/managers/TimeManager.d.mts +30 -31
- package/dist/managers/TimeManager.d.ts +30 -31
- package/dist/managers/TimeManager.js +1 -250
- package/dist/managers/TimeManager.js.map +1 -1
- package/dist/managers/TimeManager.mjs +1 -248
- package/dist/managers/TimeManager.mjs.map +1 -1
- package/dist/managers/index.d.mts +5 -1
- package/dist/managers/index.d.ts +5 -1
- package/dist/managers/index.js +1 -250
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +1 -248
- package/dist/managers/index.mjs.map +1 -1
- package/dist/override/GraphicItemInterface.js +1 -3
- package/dist/override/GraphicItemInterface.js.map +1 -1
- package/dist/override/GraphicItemInterface.mjs +1 -2
- package/dist/override/GraphicItemInterface.mjs.map +1 -1
- package/dist/override/GraphicItemType.d.mts +2 -2
- package/dist/override/GraphicItemType.d.ts +2 -2
- package/dist/override/GraphicItemType.js +1 -3
- package/dist/override/GraphicItemType.js.map +1 -1
- package/dist/override/GraphicItemType.mjs +1 -2
- package/dist/override/GraphicItemType.mjs.map +1 -1
- package/dist/override/NeighboringMapsInterface.js +1 -3
- package/dist/override/NeighboringMapsInterface.js.map +1 -1
- package/dist/override/NeighboringMapsInterface.mjs +1 -2
- package/dist/override/NeighboringMapsInterface.mjs.map +1 -1
- package/dist/override/OnRenderGraphicItemProps.js +1 -3
- package/dist/override/OnRenderGraphicItemProps.js.map +1 -1
- package/dist/override/OnRenderGraphicItemProps.mjs +1 -2
- package/dist/override/OnRenderGraphicItemProps.mjs.map +1 -1
- package/dist/override/OnRunProps.js +1 -3
- package/dist/override/OnRunProps.js.map +1 -1
- package/dist/override/OnRunProps.mjs +1 -2
- package/dist/override/OnRunProps.mjs.map +1 -1
- package/dist/override/OnStartEndStageQuest.js +1 -3
- package/dist/override/OnStartEndStageQuest.js.map +1 -1
- package/dist/override/OnStartEndStageQuest.mjs +1 -2
- package/dist/override/OnStartEndStageQuest.mjs.map +1 -1
- package/dist/override/index.js +1 -3
- package/dist/override/index.js.map +1 -1
- package/dist/override/index.mjs +1 -2
- package/dist/override/index.mjs.map +1 -1
- package/dist/types/ExecutionType.js +1 -3
- package/dist/types/ExecutionType.js.map +1 -1
- package/dist/types/ExecutionType.mjs +1 -2
- package/dist/types/ExecutionType.mjs.map +1 -1
- package/dist/types/OnRunActivityEvent.js +1 -3
- package/dist/types/OnRunActivityEvent.js.map +1 -1
- package/dist/types/OnRunActivityEvent.mjs +1 -2
- package/dist/types/OnRunActivityEvent.mjs.map +1 -1
- package/dist/types/OnRunCommitmentEvent.js +1 -3
- package/dist/types/OnRunCommitmentEvent.js.map +1 -1
- package/dist/types/OnRunCommitmentEvent.mjs +1 -2
- package/dist/types/OnRunCommitmentEvent.mjs.map +1 -1
- package/dist/types/QuestsRequired.d.mts +1 -1
- package/dist/types/QuestsRequired.d.ts +1 -1
- package/dist/types/QuestsRequired.js +1 -3
- package/dist/types/QuestsRequired.js.map +1 -1
- package/dist/types/QuestsRequired.mjs +1 -2
- package/dist/types/QuestsRequired.mjs.map +1 -1
- package/dist/types/TimeDataType.d.mts +6 -0
- package/dist/types/TimeDataType.d.ts +6 -0
- package/dist/types/TimeDataType.js +2 -0
- package/dist/types/TimeDataType.js.map +1 -0
- package/dist/types/TimeDataType.mjs +2 -0
- package/dist/types/TimeDataType.mjs.map +1 -0
- package/dist/types/TimeSettings.d.mts +1 -1
- package/dist/types/TimeSettings.d.ts +1 -1
- package/dist/types/TimeSettings.js +1 -3
- package/dist/types/TimeSettings.js.map +1 -1
- package/dist/types/TimeSettings.mjs +1 -2
- package/dist/types/TimeSettings.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -3
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +1 -2
- package/dist/types/index.mjs.map +1 -1
- package/package.json +8 -7
|
@@ -1,112 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
// src/classes/navigation/Map.ts
|
|
4
|
-
|
|
5
|
-
// src/decorators/RoomDecorator.ts
|
|
6
|
-
var registeredRooms = {};
|
|
7
|
-
function getAllLocations() {
|
|
8
|
-
let result = {};
|
|
9
|
-
Object.values(registeredRooms).forEach((room) => {
|
|
10
|
-
result[room.location.id] = room.location;
|
|
11
|
-
});
|
|
12
|
-
return Object.values(result);
|
|
13
|
-
}
|
|
14
|
-
function getLocationsByMap(map) {
|
|
15
|
-
return getAllLocations().filter((location) => location.map.id === map.id);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// src/classes/navigation/Map.ts
|
|
19
|
-
var MAP_CATEGORY = "__nqtr-map__";
|
|
20
|
-
var MapBaseModel = class extends StoredClassModel {
|
|
21
|
-
/**
|
|
22
|
-
* @param id The id of the map, it must be unique.
|
|
23
|
-
* @param props The properties of the map.
|
|
24
|
-
*/
|
|
25
|
-
constructor(id, props = {}) {
|
|
26
|
-
super(MAP_CATEGORY, id);
|
|
27
|
-
this.defaultName = props.name || "";
|
|
28
|
-
this._renderImage = props.renderImage;
|
|
29
|
-
this.defaultDisabled = props.disabled || false;
|
|
30
|
-
this.defaultHidden = props.hidden || false;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* The name of the map.
|
|
34
|
-
* If you set undefined, it will return the initial value of name.
|
|
35
|
-
*/
|
|
36
|
-
get name() {
|
|
37
|
-
return this.getStorageProperty("name") || this.defaultName;
|
|
38
|
-
}
|
|
39
|
-
set name(value) {
|
|
40
|
-
this.setStorageProperty("name", value);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* The function for rendering the image of the map.
|
|
44
|
-
*/
|
|
45
|
-
get renderImage() {
|
|
46
|
-
let render = this._renderImage;
|
|
47
|
-
if (render === void 0) {
|
|
48
|
-
return void 0;
|
|
49
|
-
}
|
|
50
|
-
if (typeof render === "function") {
|
|
51
|
-
return (props) => {
|
|
52
|
-
return render(this, props);
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return (props) => render;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Whether is disabled. If it is a string, it is a Pixi'VN flag name.
|
|
59
|
-
*/
|
|
60
|
-
get disabled() {
|
|
61
|
-
let value = this.getStorageProperty("disabled") || this.defaultDisabled;
|
|
62
|
-
if (typeof value === "string") {
|
|
63
|
-
return getFlag(value);
|
|
64
|
-
}
|
|
65
|
-
return value;
|
|
66
|
-
}
|
|
67
|
-
set disabled(value) {
|
|
68
|
-
this.setStorageProperty("disabled", value);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Whether is hidden. If it is a string, it is a Pixi'VN flag name.
|
|
72
|
-
*/
|
|
73
|
-
get hidden() {
|
|
74
|
-
let value = this.getStorageProperty("hidden") || this.defaultHidden;
|
|
75
|
-
if (typeof value === "string") {
|
|
76
|
-
return getFlag(value);
|
|
77
|
-
}
|
|
78
|
-
return value;
|
|
79
|
-
}
|
|
80
|
-
set hidden(value) {
|
|
81
|
-
this.setStorageProperty("hidden", value);
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* The neighboring maps that are available in this map.
|
|
85
|
-
* @example
|
|
86
|
-
* ```ts
|
|
87
|
-
* {
|
|
88
|
-
* "north": "atlanta_map_id",
|
|
89
|
-
* "south": "miami_map_id",
|
|
90
|
-
* "east": "new_york_map_id",
|
|
91
|
-
* "west": "los_angeles_map_id"
|
|
92
|
-
* }
|
|
93
|
-
* ```
|
|
94
|
-
*/
|
|
95
|
-
get neighboringMaps() {
|
|
96
|
-
return this._neighboringMaps || {};
|
|
97
|
-
}
|
|
98
|
-
set neighboringMaps(value) {
|
|
99
|
-
this._neighboringMaps = value;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Get all locations in the map.
|
|
103
|
-
* @returns The locations in the map.
|
|
104
|
-
*/
|
|
105
|
-
getLocations() {
|
|
106
|
-
return getLocationsByMap(this);
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export { MapBaseModel as default };
|
|
111
|
-
//# sourceMappingURL=out.js.map
|
|
1
|
+
import {StoredClassModel,getFlag}from'@drincs/pixi-vn';var i={};function s(){let t={};return Object.values(i).forEach(e=>{t[e.location.id]=e.location;}),Object.values(t)}function n(t){return s().filter(e=>e.map.id===t.id)}var l="__nqtr-map__",a=class extends StoredClassModel{constructor(e,o={}){super(l,e),this.defaultName=o.name||"",this._renderImage=o.renderImage,this.defaultDisabled=o.disabled||false,this.defaultHidden=o.hidden||false,this._neighboringMaps=o.neighboringMaps;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}_renderImage;get renderImage(){let e=this._renderImage;if(e!==undefined)return typeof e=="function"?o=>e(this,o):o=>e}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}_neighboringMaps;get neighboringMaps(){return this._neighboringMaps||{}}set neighboringMaps(e){this._neighboringMaps=e;}getLocations(){return n(this)}};export{a as default};//# sourceMappingURL=Map.mjs.map
|
|
112
2
|
//# sourceMappingURL=Map.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/
|
|
1
|
+
{"version":3,"sources":["../../../src/decorators/RoomDecorator.ts","../../../src/classes/navigation/Map.ts"],"names":["registeredRooms","getAllLocations","result","room","getLocationsByMap","map","location","MAP_CATEGORY","MapBaseModel","StoredClassModel","id","props","value","render","getFlag"],"mappings":"uDAEO,IAAMA,CAAmD,CAAA,EAuDzD,CAAA,SAASC,CAAwF,EAAA,CACpG,IAAIC,CAAsC,CAAA,EAC1C,CAAA,OAAA,MAAA,CAAO,MAAOF,CAAAA,CAAe,EAAE,OAAQG,CAAAA,CAAAA,EAAQ,CAC3CD,CAAAA,CAAOC,CAAK,CAAA,QAAA,CAAS,EAAE,CAAIA,CAAAA,CAAAA,CAAK,SACpC,CAAC,CACM,CAAA,MAAA,CAAO,OAAOD,CAAM,CAC/B,CAOO,SAASE,CAA2EC,CAAAA,CAAAA,CAAgC,CACvH,OAAOJ,CAAAA,EAA6B,CAAA,MAAA,CAAOK,CAAYA,EAAAA,CAAAA,CAAS,GAAI,CAAA,EAAA,GAAOD,CAAI,CAAA,EAAE,CACrF,CClEME,IAAAA,CAAAA,CAAe,eAkBAC,CAArB,CAAA,cAA0CC,gBAAiB,CAKvD,WAAYC,CAAAA,CAAAA,CAAYC,EAAkB,EAAC,CAAG,CAC1C,KAAA,CAAMJ,CAAcG,CAAAA,CAAE,EACtB,IAAK,CAAA,WAAA,CAAcC,CAAM,CAAA,IAAA,EAAQ,EACjC,CAAA,IAAA,CAAK,aAAeA,CAAM,CAAA,WAAA,CAC1B,IAAK,CAAA,eAAA,CAAkBA,CAAM,CAAA,QAAA,EAAY,MACzC,IAAK,CAAA,aAAA,CAAgBA,CAAM,CAAA,MAAA,EAAU,KACrC,CAAA,IAAA,CAAK,iBAAmBA,CAAM,CAAA,gBAClC,CAEQ,WAAA,CAKR,IAAI,IAAA,EAAe,CACf,OAAO,IAAA,CAAK,kBAA2B,CAAA,MAAM,CAAK,EAAA,IAAA,CAAK,WAC3D,CACA,IAAI,IAAA,CAAKC,CAA2B,CAAA,CAChC,IAAK,CAAA,kBAAA,CAAmB,OAAQA,CAAK,EACzC,CAEQ,YAAA,CAIR,IAAI,WAAA,EAAkF,CAClF,IAAIC,CAAAA,CAAS,IAAK,CAAA,YAAA,CAClB,GAAIA,CAAAA,GAAW,UAGf,OAAI,OAAOA,CAAW,EAAA,UAAA,CACVF,CACGE,EAAAA,CAAAA,CAAO,KAAMF,CAAK,CAAA,CAGzBA,CAAoCE,EAAAA,CAChD,CAEQ,eAAA,CAIR,IAAI,QAAoB,EAAA,CACpB,IAAID,CAAAA,CAAQ,IAAK,CAAA,kBAAA,CAA4B,UAAU,CAAK,EAAA,IAAA,CAAK,eACjE,CAAA,OAAI,OAAOA,CAAAA,EAAU,SACVE,OAAQF,CAAAA,CAAK,CAEjBA,CAAAA,CACX,CACA,IAAI,QAASA,CAAAA,CAAAA,CAAyB,CAClC,IAAA,CAAK,kBAAmB,CAAA,UAAA,CAAYA,CAAK,EAC7C,CAEQ,aAIR,CAAA,IAAI,MAAkB,EAAA,CAClB,IAAIA,CAAAA,CAAQ,KAAK,kBAA4B,CAAA,QAAQ,CAAK,EAAA,IAAA,CAAK,aAC/D,CAAA,OAAI,OAAOA,CAAU,EAAA,QAAA,CACVE,OAAQF,CAAAA,CAAK,CAEjBA,CAAAA,CACX,CACA,IAAI,MAAOA,CAAAA,CAAAA,CAAyB,CAChC,IAAA,CAAK,kBAAmB,CAAA,QAAA,CAAUA,CAAK,EAC3C,CAEQ,gBAaR,CAAA,IAAI,eAA4C,EAAA,CAC5C,OAAO,IAAK,CAAA,gBAAA,EAAoB,EACpC,CACA,IAAI,gBAAgBA,CAA6C,CAAA,CAC7D,IAAK,CAAA,gBAAA,CAAmBA,EAC5B,CAMA,YAAqF,EAAA,CACjF,OAAOR,CAAAA,CAA6B,IAAI,CAC5C,CACJ","file":"Map.mjs","sourcesContent":["import { LocationBaseModel, MapBaseModel, RoomBaseModel } from \"../classes\"\n\nexport const registeredRooms: { [id: string]: RoomBaseModel } = {}\n\n/**\n * Save a room in the registered rooms. If the room already exists, it will be overwritten.\n * @param room The room to save.\n * @returns \n * @example\n * ```ts\n * saveRoom([mcRoom, aliceRoom, annRoom, bathroom, lounge, terrace, gymRoom]);\n * ```\n */\nexport function saveRoom<TRoom extends RoomBaseModel = RoomBaseModel>(room: TRoom | TRoom[]) {\n if (Array.isArray(room)) {\n room.forEach(c => saveRoom(c))\n return\n }\n if (registeredRooms[room.id]) {\n console.warn(`[NQTR] Room id ${room.id} already exists, it will be overwritten`)\n }\n registeredRooms[room.id] = room\n}\n\n/**\n * Get a room by its id.\n * @param id The id of the room.\n * @returns The room or undefined if not found.\n */\nexport function getRoomById<TRoom extends RoomBaseModel = RoomBaseModel>(id: string): TRoom | undefined {\n try {\n let room = registeredRooms[id]\n if (!room) {\n console.error(`[NQTR] Room ${id} not found`)\n return\n }\n return room as TRoom\n }\n catch (e) {\n console.error(`[NQTR] Error while getting Room ${id}`, e)\n return\n }\n}\n\n/**\n * Get all rooms in a location.\n * @param location The location where the rooms are.\n * @returns The rooms in the location.\n */\nexport function getRoomsByLocation<TRoom extends RoomBaseModel = RoomBaseModel>(location: LocationBaseModel): TRoom[] {\n return Object.values(registeredRooms).filter(room => room.location.id === location.id) as TRoom[]\n}\n\n/**\n * Get all locations in the registered rooms.\n * @returns All locations in the registered rooms.\n */\nexport function getAllLocations<TLocation extends LocationBaseModel = LocationBaseModel>(): TLocation[] {\n let result: { [id: string]: TLocation } = {}\n Object.values(registeredRooms).forEach(room => {\n result[room.location.id] = room.location as TLocation\n })\n return Object.values(result)\n}\n\n/**\n * Get all locations in a map.\n * @param map The map where the locations are.\n * @returns The locations in the map.\n */\nexport function getLocationsByMap<TLocation extends LocationBaseModel = LocationBaseModel>(map: MapBaseModel): TLocation[] {\n return getAllLocations<TLocation>().filter(location => location.map.id === map.id) as TLocation[]\n}\n\n/**\n * Get all maps in the registered rooms.\n * @returns All maps in the registered rooms.\n */\nexport function getAllMaps<TMap extends MapBaseModel = MapBaseModel>(): TMap[] {\n let result: { [id: string]: TMap } = {}\n Object.values(registeredRooms).forEach(room => {\n result[room.location.map.id] = room.location.map as TMap\n })\n return Object.values(result)\n}\n","import { GraphicItemType, NeighboringMapsInterface, OnRenderGraphicItemProps } from \"@drincs/nqtr/dist/override\"\nimport { getFlag, StoredClassModel } from \"@drincs/pixi-vn\"\nimport { getLocationsByMap } from \"../../decorators/RoomDecorator\"\nimport { MapProps } from \"../../interface\"\nimport LocationBaseModel from \"./Location\"\n\nconst MAP_CATEGORY = \"__nqtr-map__\"\n\n/**\n * The base model of a map. I suggest you extend this class to create your own map model.\n * @example\n * ```typescript\n * export const mainMap = new MapBaseModel('main_map', {\n * name: 'Main Map',\n * image: \"https://image.jpg\",\n * neighboringMaps: {\n * \"north\": \"atlanta_map_id\",\n * \"south\": \"miami_map_id\",\n * \"east\": \"new_york_map_id\",\n * \"west\": \"los_angeles_map_id\"\n * }\n * });\n * ```\n */\nexport default class MapBaseModel extends StoredClassModel {\n /**\n * @param id The id of the map, it must be unique.\n * @param props The properties of the map. \n */\n constructor(id: string, props: MapProps = {}) {\n super(MAP_CATEGORY, id)\n this.defaultName = props.name || \"\"\n this._renderImage = props.renderImage\n this.defaultDisabled = props.disabled || false\n this.defaultHidden = props.hidden || false\n this._neighboringMaps = props.neighboringMaps\n }\n\n private defaultName: string\n /**\n * The name of the map.\n * If you set undefined, it will return the initial value of name.\n */\n get name(): string {\n return this.getStorageProperty<string>(\"name\") || this.defaultName\n }\n set name(value: string | undefined) {\n this.setStorageProperty(\"name\", value)\n }\n\n private _renderImage?: GraphicItemType | ((map: MapBaseModel, props: OnRenderGraphicItemProps) => GraphicItemType)\n /**\n * The function for rendering the image of the map.\n */\n get renderImage(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined {\n let render = this._renderImage\n if (render === undefined) {\n return undefined\n }\n if (typeof render === \"function\") {\n return (props: OnRenderGraphicItemProps) => {\n return render(this, props)\n }\n }\n return (props: OnRenderGraphicItemProps) => render\n }\n\n private defaultDisabled: boolean | string\n /**\n * Whether is disabled. If it is a string, it is a Pixi'VN flag name.\n */\n get disabled(): boolean {\n let value = this.getStorageProperty<boolean>(\"disabled\") || this.defaultDisabled\n if (typeof value === \"string\") {\n return getFlag(value)\n }\n return value\n }\n set disabled(value: boolean | string) {\n this.setStorageProperty(\"disabled\", value)\n }\n\n private defaultHidden: boolean | string\n /**\n * Whether is hidden. If it is a string, it is a Pixi'VN flag name.\n */\n get hidden(): boolean {\n let value = this.getStorageProperty<boolean>(\"hidden\") || this.defaultHidden\n if (typeof value === \"string\") {\n return getFlag(value)\n }\n return value\n }\n set hidden(value: boolean | string) {\n this.setStorageProperty(\"hidden\", value)\n }\n\n private _neighboringMaps?: NeighboringMapsInterface\n /**\n * The neighboring maps that are available in this map.\n * @example\n * ```ts\n * {\n * \"north\": \"atlanta_map_id\",\n * \"south\": \"miami_map_id\",\n * \"east\": \"new_york_map_id\",\n * \"west\": \"los_angeles_map_id\"\n * }\n * ```\n */\n get neighboringMaps(): NeighboringMapsInterface {\n return this._neighboringMaps || {}\n }\n set neighboringMaps(value: NeighboringMapsInterface | undefined) {\n this._neighboringMaps = value\n }\n\n /**\n * Get all locations in the map.\n * @returns The locations in the map.\n */\n getLocations<TLocation extends LocationBaseModel = LocationBaseModel>(): TLocation[] {\n return getLocationsByMap<TLocation>(this)\n }\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '@drincs/nqtr/dist/override';
|
|
2
2
|
import '@drincs/pixi-vn';
|
|
3
|
-
export { e as ROOM_CATEGORY,
|
|
3
|
+
export { e as ROOM_CATEGORY, d as default } from '../../Commitment-BujJuTv8.mjs';
|
|
4
4
|
import '../Activity.mjs';
|
|
5
|
-
import '../../ActivityProps-
|
|
5
|
+
import '../../ActivityProps-WgXDAYbc.mjs';
|
|
6
6
|
import '../../types/OnRunActivityEvent.mjs';
|
|
7
7
|
import '../../types/ExecutionType.mjs';
|
|
8
8
|
import '../../types/OnRunCommitmentEvent.mjs';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '@drincs/nqtr/dist/override';
|
|
2
2
|
import '@drincs/pixi-vn';
|
|
3
|
-
export { e as ROOM_CATEGORY,
|
|
3
|
+
export { e as ROOM_CATEGORY, d as default } from '../../Commitment-DFYAApxl.js';
|
|
4
4
|
import '../Activity.js';
|
|
5
|
-
import '../../ActivityProps-
|
|
5
|
+
import '../../ActivityProps-LWY7Zucl.js';
|
|
6
6
|
import '../../types/OnRunActivityEvent.js';
|
|
7
7
|
import '../../types/ExecutionType.js';
|
|
8
8
|
import '../../types/OnRunCommitmentEvent.js';
|