@drincs/nqtr 0.5.4 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +29 -4
  2. package/dist/{RoomInterface-C_Dbpef2.d.ts → RoomInterface-COSoQndi.d.mts} +6 -2
  3. package/dist/{RoomInterface-B6ryEuU-.d.mts → RoomInterface-VyDG8FVX.d.ts} +6 -2
  4. package/dist/{StageInterface-C1Zfcpk3.d.mts → StageInterface-v96_K9Tg.d.mts} +21 -9
  5. package/dist/{StageInterface-C1Zfcpk3.d.ts → StageInterface-v96_K9Tg.d.ts} +21 -9
  6. package/dist/classes/index.cjs +1 -1
  7. package/dist/classes/index.cjs.map +1 -1
  8. package/dist/classes/index.d.mts +7 -3
  9. package/dist/classes/index.d.ts +7 -3
  10. package/dist/classes/index.mjs +1 -1
  11. package/dist/classes/index.mjs.map +1 -1
  12. package/dist/decorators/index.cjs +1 -1
  13. package/dist/decorators/index.cjs.map +1 -1
  14. package/dist/decorators/index.d.mts +2 -2
  15. package/dist/decorators/index.d.ts +2 -2
  16. package/dist/decorators/index.mjs +1 -1
  17. package/dist/decorators/index.mjs.map +1 -1
  18. package/dist/{index-DnY50udK.d.mts → index-BrR28W31.d.mts} +2 -2
  19. package/dist/{index-Q2x0LXsj.d.ts → index-CKbOHqkF.d.ts} +2 -2
  20. package/dist/{index-BDKsWLeX.d.ts → index-DQXOfV1Z.d.ts} +2 -2
  21. package/dist/{index-D1Z9gIAi.d.mts → index-jntH7-J_.d.mts} +2 -2
  22. package/dist/index.cjs +1 -1
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.mts +5 -5
  25. package/dist/index.d.ts +5 -5
  26. package/dist/index.mjs +1 -1
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/interface/index.d.mts +3 -3
  29. package/dist/interface/index.d.ts +3 -3
  30. package/dist/managers/index.cjs +1 -1
  31. package/dist/managers/index.cjs.map +1 -1
  32. package/dist/managers/index.d.mts +3 -3
  33. package/dist/managers/index.d.ts +3 -3
  34. package/dist/managers/index.mjs +1 -1
  35. package/dist/managers/index.mjs.map +1 -1
  36. package/dist/types/index.d.mts +1 -1
  37. package/dist/types/index.d.ts +1 -1
  38. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- 'use strict';var pixiVn=require('@drincs/pixi-vn');var o;(t=>(t.log=(e,...r)=>console.log(`[NQTR] ${e}`,...r),t.warn=(e,...r)=>console.warn(`[NQTR] ${e}`,...r),t.error=(e,...r)=>console.error(`[NQTR] ${e}`,...r),t.info=(e,...r)=>console.info(`[NQTR] ${e}`,...r)))(o||={});var c=new pixiVn.CachedMap({cacheSize:20}),y;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>t.add(r));return}c.set(e.id,e);}t.add=n;function a(e){try{let r=c.get(e);if(!r){console.warn(`[NQTR] Activity ${e} not found, you should register it first`);return}return r}catch(r){o.error(`Error while getting Activity ${e}`,r);return}}t.get=a;function i(){return Array.from(c.values())}t.values=i;function f(e){return c.has(e)}t.has=f;})(y||={});var M=y;var s=new pixiVn.CachedMap({cacheSize:20});new pixiVn.CachedMap({cacheSize:20});var I;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>t.add(r));return}console.warn(`[NQTR] Registering commitment ${e.id}`,e),s.set(e.id,e);}t.add=n;function a(e){try{let r=s.get(e);if(!r){console.warn(`[NQTR] Commitment ${e} not found, you should register it first`);return}return r}catch(r){o.error(`Error while getting Commitment ${e}`,r);return}}t.get=a;function i(){return Array.from(s.values())}t.values=i;function f(e){return s.has(e)}t.has=f;})(I||={});var $=I;var u=new pixiVn.CachedMap({cacheSize:20}),R;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>n(r));return}u.set(e.id,e);}t.add=n;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){o.error(`Error while getting Location ${e}`,r);return}}t.get=a;function i(){return Array.from(u.values())}t.values=i;function f(e){return u.has(e)}t.has=f;})(R||={});var g=R;var m=new pixiVn.CachedMap({cacheSize:20}),A;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>n(r));return}m.set(e.id,e);}t.add=n;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){o.error(`Error while getting Map ${e}`,r);return}}t.get=a;function i(){return Array.from(m.values())}t.values=i;function f(e){return m.has(e)}t.has=f;})(A||={});var l=A;var p=new pixiVn.CachedMap({cacheSize:5}),w;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>t.add(r));return}p.set(e.id,e);}t.add=n;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){o.error(`Error while getting Quest ${e}`,r);return}}t.get=a;function i(){return Array.from(p.values())}t.values=i;function f(e){return p.has(e)}t.has=f;})(w||={});var T=w;var d=new pixiVn.CachedMap({cacheSize:20}),Q;(t=>{function n(e){if(Array.isArray(e)){e.forEach(v=>n(v));return}d.set(e.id,e);let r=e.location;g.add(r);let h=r?.map;h&&l.add(h);}t.add=n;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){o.error(`Error while getting Room ${e}`,r);return}}t.get=a;function i(){return Array.from(d.values())}t.values=i;function f(e){return d.has(e)}t.has=f;})(Q||={});var S=Q;exports.RegisteredActivities=M;exports.RegisteredCommitments=$;exports.RegisteredLocations=g;exports.RegisteredMaps=l;exports.RegisteredQuests=T;exports.RegisteredRooms=S;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var pixiVn=require('@drincs/pixi-vn');var o;(t=>(t.log=(e,...r)=>console.log(`[NQTR] ${e}`,...r),t.warn=(e,...r)=>console.warn(`[NQTR] ${e}`,...r),t.error=(e,...r)=>console.error(`[NQTR] ${e}`,...r),t.info=(e,...r)=>console.info(`[NQTR] ${e}`,...r)))(o||={});var c=new pixiVn.CachedMap({cacheSize:20}),y;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>t.add(r));return}c.set(e.id,e);}t.add=n;function a(e){try{let r=c.get(e);if(!r){console.warn(`[NQTR] Activity ${e} not found, you should register it first`);return}return r}catch(r){o.error(`Error while getting Activity ${e}`,r);return}}t.get=a;function i(){return Array.from(c.values())}t.values=i;function f(e){return c.has(e)}t.has=f;})(y||={});var M=y;var s=new pixiVn.CachedMap({cacheSize:20});new pixiVn.CachedMap({cacheSize:20});var I;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>t.add(r));return}s.set(e.id,e);}t.add=n;function a(e){try{let r=s.get(e);if(!r){console.warn(`[NQTR] Commitment ${e} not found, you should register it first`);return}return r}catch(r){o.error(`Error while getting Commitment ${e}`,r);return}}t.get=a;function i(){return Array.from(s.values())}t.values=i;function f(e){return s.has(e)}t.has=f;})(I||={});var $=I;var u=new pixiVn.CachedMap({cacheSize:20}),A;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>n(r));return}u.set(e.id,e);}t.add=n;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){o.error(`Error while getting Location ${e}`,r);return}}t.get=a;function i(){return Array.from(u.values())}t.values=i;function f(e){return u.has(e)}t.has=f;})(A||={});var g=A;var m=new pixiVn.CachedMap({cacheSize:20}),R;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>n(r));return}m.set(e.id,e);}t.add=n;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){o.error(`Error while getting Map ${e}`,r);return}}t.get=a;function i(){return Array.from(m.values())}t.values=i;function f(e){return m.has(e)}t.has=f;})(R||={});var l=R;var p=new pixiVn.CachedMap({cacheSize:5}),w;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>t.add(r));return}p.set(e.id,e);}t.add=n;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){o.error(`Error while getting Quest ${e}`,r);return}}t.get=a;function i(){return Array.from(p.values())}t.values=i;function f(e){return p.has(e)}t.has=f;})(w||={});var T=w;var d=new pixiVn.CachedMap({cacheSize:20}),v;(t=>{function n(e){if(Array.isArray(e)){e.forEach(Q=>n(Q));return}d.set(e.id,e);let r=e.location;g.add(r);let h=r?.map;h&&l.add(h);}t.add=n;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){o.error(`Error while getting Room ${e}`,r);return}}t.get=a;function i(){return Array.from(d.values())}t.values=i;function f(e){return d.has(e)}t.has=f;})(v||={});var S=v;exports.RegisteredActivities=M;exports.RegisteredCommitments=$;exports.RegisteredLocations=g;exports.RegisteredMaps=l;exports.RegisteredQuests=T;exports.RegisteredRooms=S;//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/log-utility.ts","../../src/decorators/RegisteredActivities.ts","../../src/decorators/RegisteredCommitments.ts","../../src/decorators/RegisteredLocations.ts","../../src/decorators/RegisteredMaps.ts","../../src/decorators/RegisteredQuests.ts","../../src/decorators/RegisteredRooms.ts"],"names":["logger","message","optionalParams","registeredActivities","CachedMap","RegisteredActivities","add","activities","activity","get","id","e","values","has","RegisteredActivities_default","registeredCommitments","RegisteredCommitments","commitments","commitment","RegisteredCommitments_default","registeredLocations","RegisteredLocations","location","c","RegisteredLocations_default","registeredMaps","RegisteredMaps","map","RegisteredMaps_default","registeredQuests","RegisteredQuest","quests","quest","RegisteredQuests_default","registeredRooms","RegisteredRooms","room","RegisteredRooms_default"],"mappings":"mDAAO,IAAUA,OACAA,CAAAA,CAAA,GAAA,CAAM,CAACC,CAAAA,CAAAA,GAAkBC,CAAAA,GAA0B,QAAQ,GAAA,CAAI,CAAA,OAAA,EAAUD,CAAO,CAAA,CAAA,CAAI,GAAGC,CAAc,CAAA,CACrGF,CAAA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AAtB,EAAAA,CAAAA,EArDVsB,CAAAA,GAAA,EAAA,CAAA,CAyDV,IAAOE,CAAAA,CAAQF","file":"index.cjs","sourcesContent":["export namespace logger {\n export const log = (message?: any, ...optionalParams: any[]) => console.log(`[NQTR] ${message}`, ...optionalParams);\n export const warn = (message?: any, ...optionalParams: any[]) =>\n console.warn(`[NQTR] ${message}`, ...optionalParams);\n export const error = (message?: any, ...optionalParams: any[]) =>\n console.error(`[NQTR] ${message}`, ...optionalParams);\n export const info = (message?: any, ...optionalParams: any[]) =>\n console.info(`[NQTR] ${message}`, ...optionalParams);\n}\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { ActivityInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all activities registered and available to be used.\n * The key is the id of the activity and the value is the activity itself.\n */\nconst registeredActivities = new CachedMap<string, ActivityInterface>({ cacheSize: 20 });\n\nnamespace RegisteredActivities {\n /**\n * Save an activity in the registered activities. If the activity already exists, it will be overwritten.\n * @param activity The activity to save.\n * @returns\n */\n export function add(activities: ActivityInterface | ActivityInterface[]) {\n if (Array.isArray(activities)) {\n activities.forEach((activity) => RegisteredActivities.add(activity));\n return;\n }\n registeredActivities.set(activities.id, activities);\n }\n\n /**\n * Get an activity by its id.\n * @param id The id of the activity.\n * @returns The activity or undefined if not found.\n */\n export function get(id: string): ActivityInterface | undefined {\n try {\n let activity = registeredActivities.get(id);\n if (!activity) {\n console.warn(`[NQTR] Activity ${id} not found, you should register it first`);\n return;\n }\n return activity;\n } catch (e) {\n logger.error(`Error while getting Activity ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all activities registered.\n * @returns An array of activities.\n */\n export function values(): ActivityInterface[] {\n return Array.from(registeredActivities.values());\n }\n\n /**\n * Check if an activity is registered.\n * @param id The id of the activity.\n * @returns True if the activity is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredActivities.has(id);\n }\n}\nexport default RegisteredActivities;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { CommitmentInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all commitments registered and available to be used.\n * The key is the id of the commitment and the value is the commitment itself.\n */\nexport const registeredCommitments = new CachedMap<string, CommitmentInterface>({ cacheSize: 20 });\nexport const fixedCommitments = new CachedMap<string, CommitmentInterface>({ cacheSize: 20 });\n\nnamespace RegisteredCommitments {\n /**\n * Save a commitment in the registered commitments. If the commitment already exists, it will be overwritten.\n * @param commitment The commitment to save.\n * @returns\n */\n export function add(commitments: CommitmentInterface | CommitmentInterface[]) {\n if (Array.isArray(commitments)) {\n commitments.forEach((commitment) => RegisteredCommitments.add(commitment));\n return;\n }\n console.warn(`[NQTR] Registering commitment ${commitments.id}`, commitments);\n registeredCommitments.set(commitments.id, commitments);\n }\n /**\n * Get a commitment by its id.\n * @param id The id of the commitment.\n * @returns The commitment or undefined if not found.\n */\n export function get(id: string): CommitmentInterface | undefined {\n try {\n let commitment = registeredCommitments.get(id);\n if (!commitment) {\n console.warn(`[NQTR] Commitment ${id} not found, you should register it first`);\n return;\n }\n return commitment;\n } catch (e) {\n logger.error(`Error while getting Commitment ${id}`, e);\n return;\n }\n }\n /**\n * Get a list of all commitments registered.\n * @returns An array of commitments.\n */\n export function values(): CommitmentInterface[] {\n return Array.from(registeredCommitments.values());\n }\n /**\n * Check if a commitment is registered.\n * @param id The id of the commitment.\n * @returns True if the commitment is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredCommitments.has(id);\n }\n}\nexport default RegisteredCommitments;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { LocationInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all locations registered and available to be used.\n * The key is the id of the location and the value is the location itself.\n */\nconst registeredLocations = new CachedMap<string, LocationInterface>({ cacheSize: 20 });\n\nnamespace RegisteredLocations {\n /**\n * Save a location in the registered locations. If the location already exists, it will be overwritten.\n * @param location The location to save.\n * @returns\n */\n export function add(location: LocationInterface | LocationInterface[]) {\n if (Array.isArray(location)) {\n location.forEach((c) => add(c));\n return;\n }\n // if (registeredLocations.has(location.id)) {\n // console.warn(`[NQTR] Location id ${location.id} already exists, it will be overwritten`);\n // }\n registeredLocations.set(location.id, location);\n }\n\n /**\n * Get a location by its id.\n * @param id The id of the location.\n * @returns The location or undefined if not found.\n */\n export function get(id: string): LocationInterface | undefined {\n try {\n let location = registeredLocations.get(id);\n if (!location) {\n console.warn(`[NQTR] Location ${id} not found, you should register it first`);\n return;\n }\n return location;\n } catch (e) {\n logger.error(`Error while getting Location ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all locations registered.\n * @returns An array of locations.\n */\n export function values(): LocationInterface[] {\n return Array.from(registeredLocations.values());\n }\n\n /**\n * Check if a location is registered.\n * @param id The id of the location.\n * @returns True if the location is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredLocations.has(id);\n }\n}\nexport default RegisteredLocations;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { MapInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all maps registered and available to be used.\n * The key is the id of the map and the value is the map itself.\n */\nconst registeredMaps = new CachedMap<string, MapInterface>({ cacheSize: 20 });\n\nnamespace RegisteredMaps {\n /**\n * Save a map in the registered maps. If the map already exists, it will be overwritten.\n * @param map The map to save.\n * @returns\n */\n export function add(map: MapInterface | MapInterface[]) {\n if (Array.isArray(map)) {\n map.forEach((c) => add(c));\n return;\n }\n // if (registeredMaps.has(map.id)) {\n // console.warn(`[NQTR] Map id ${map.id} already exists, it will be overwritten`);\n // }\n registeredMaps.set(map.id, map);\n }\n\n /**\n * Get a map by its id.\n * @param id The id of the map.\n * @returns The map or undefined if not found.\n */\n export function get(id: string): MapInterface | undefined {\n try {\n let map = registeredMaps.get(id);\n if (!map) {\n console.warn(`[NQTR] Map ${id} not found, you should register it first`);\n return;\n }\n return map;\n } catch (e) {\n logger.error(`Error while getting Map ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all maps registered.\n * @returns An array of maps.\n */\n export function values(): MapInterface[] {\n return Array.from(registeredMaps.values());\n }\n\n /**\n * Check if a map is registered.\n * @param id The id of the map.\n * @returns True if the map is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredMaps.has(id);\n }\n}\nexport default RegisteredMaps;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { QuestInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all quests registered and available to be used.\n * The key is the id of the quest and the value is the quest itself.\n */\nconst registeredQuests = new CachedMap<string, QuestInterface>({ cacheSize: 5 });\n\nnamespace RegisteredQuest {\n /**\n * Save a quest in the registered quests. If the quest already exists, it will be overwritten.\n * @param quest The quest to save.\n * @returns\n */\n export function add(quests: QuestInterface | QuestInterface[]) {\n if (Array.isArray(quests)) {\n quests.forEach((quest) => RegisteredQuest.add(quest));\n return;\n }\n registeredQuests.set(quests.id, quests);\n }\n /**\n * Get a quest by its id.\n * @param id The id of the quest.\n * @returns The quest or undefined if not found.\n */\n export function get(id: string): QuestInterface | undefined {\n try {\n let quest = registeredQuests.get(id);\n if (!quest) {\n console.warn(`[NQTR] Quest ${id} not found, you should register it first`);\n return;\n }\n return quest;\n } catch (e) {\n logger.error(`Error while getting Quest ${id}`, e);\n return;\n }\n }\n /**\n * Get a list of all quests registered.\n * @returns An array of quests.\n */\n export function values(): QuestInterface[] {\n return Array.from(registeredQuests.values());\n }\n /**\n * Check if a quest is registered.\n * @param id The id of the quest.\n * @returns True if the quest is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredQuests.has(id);\n }\n}\nexport default RegisteredQuest;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { RoomInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\nimport RegisteredLocations from \"./RegisteredLocations\";\nimport RegisteredMaps from \"./RegisteredMaps\";\n\n/**\n * A Map that contains all rooms registered and available to be used.\n * The key is the id of the room and the value is the room itself.\n */\nconst registeredRooms = new CachedMap<string, RoomInterface>({ cacheSize: 20 });\n\nnamespace RegisteredRooms {\n /**\n * Save a room in the registered rooms, and their location and map if they are not already registered.\n * If the room already exists, it will be overwritten.\n * @param room The room to save.\n * @returns\n */\n export function add(room: RoomInterface | RoomInterface[]) {\n if (Array.isArray(room)) {\n room.forEach((c) => add(c));\n return;\n }\n registeredRooms.set(room.id, room);\n let location = room.location;\n RegisteredLocations.add(location);\n let map = location?.map;\n if (map) {\n RegisteredMaps.add(map);\n }\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 */\n export function get(id: string): RoomInterface | undefined {\n try {\n let room = registeredRooms.get(id);\n if (!room) {\n console.warn(`[NQTR] Room ${id} not found, you should register it first`);\n return;\n }\n return room;\n } catch (e) {\n logger.error(`Error while getting Room ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all rooms registered.\n * @returns An array of rooms.\n */\n export function values(): RoomInterface[] {\n return Array.from(registeredRooms.values());\n }\n\n /**\n * Check if a room is registered.\n * @param id The id of the room.\n * @returns True if the room is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredRooms.has(id);\n }\n}\nexport default RegisteredRooms;\n"]}
1
+ {"version":3,"sources":["../../src/utils/log-utility.ts","../../src/decorators/RegisteredActivities.ts","../../src/decorators/RegisteredCommitments.ts","../../src/decorators/RegisteredLocations.ts","../../src/decorators/RegisteredMaps.ts","../../src/decorators/RegisteredQuests.ts","../../src/decorators/RegisteredRooms.ts"],"names":["logger","message","optionalParams","registeredActivities","CachedMap","RegisteredActivities","add","activities","activity","get","id","e","values","has","RegisteredActivities_default","registeredCommitments","RegisteredCommitments","commitments","commitment","RegisteredCommitments_default","registeredLocations","RegisteredLocations","location","c","RegisteredLocations_default","registeredMaps","RegisteredMaps","map","RegisteredMaps_default","registeredQuests","RegisteredQuest","quests","quest","RegisteredQuests_default","registeredRooms","RegisteredRooms","room","RegisteredRooms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AA,CAEpE+B,MAAV,CAOW,SAAS7B,EAAI8B,CAAAA,CAAuC,CACvD,GAAI,KAAA,CAAM,OAAA,CAAQA,CAAI,CAAA,CAAG,CACrBA,EAAK,OAAA,CAASb,CAAAA,EAAMjB,EAAIiB,CAAC,CAAC,CAAA,CAC1B,MACJ,CACAW,CAAAA,CAAgB,IAAIE,CAAAA,CAAK,EAAA,CAAIA,CAAI,CAAA,CACjC,IAAId,EAAWc,CAAAA,CAAK,QAAA,CACpBZ,EAAoB,GAAA,CAAIF,CAAQ,EAChC,IAAIK,CAAAA,CAAML,GAAU,GAAA,CAChBK,CAAAA,EACAC,EAAe,GAAA,CAAID,CAAG,EAE9B,CAZOQ,CAAAA,CAAS,GAAA,CAAA7B,EAmBT,SAASG,CAAAA,CAAIC,EAAuC,CACvD,GAAI,CACA,IAAI0B,CAAAA,CAAOF,EAAgB,GAAA,CAAIxB,CAAE,EACjC,GAAI,CAAC0B,EAAM,CACP,OAAA,CAAQ,KAAK,CAAA,YAAA,EAAe1B,CAAE,CAAA,wCAAA,CAA0C,CAAA,CACxE,MACJ,CACA,OAAO0B,CACX,CAAA,MAASzB,EAAG,CACRX,CAAAA,CAAO,MAAM,CAAA,yBAAA,EAA4BU,CAAE,GAAIC,CAAC,CAAA,CAChD,MACJ,CACJ,CAZOwB,EAAS,GAAA,CAAA1B,CAAAA,CAkBT,SAASG,CAAAA,EAA0B,CACtC,OAAO,KAAA,CAAM,IAAA,CAAKsB,CAAAA,CAAgB,QAAQ,CAC9C,CAFOC,CAAAA,CAAS,MAAA,CAAAvB,EAST,SAASC,CAAAA,CAAIH,EAAqB,CACrC,OAAOwB,EAAgB,GAAA,CAAIxB,CAAE,CACjC,CAFOyB,CAAAA,CAAS,IAAAtB,EAAAA,CAAAA,EArDVsB,CAAAA,GAAA,EAAA,CAAA,CAyDV,IAAOE,CAAAA,CAAQF","file":"index.cjs","sourcesContent":["export namespace logger {\n export const log = (message?: any, ...optionalParams: any[]) => console.log(`[NQTR] ${message}`, ...optionalParams);\n export const warn = (message?: any, ...optionalParams: any[]) =>\n console.warn(`[NQTR] ${message}`, ...optionalParams);\n export const error = (message?: any, ...optionalParams: any[]) =>\n console.error(`[NQTR] ${message}`, ...optionalParams);\n export const info = (message?: any, ...optionalParams: any[]) =>\n console.info(`[NQTR] ${message}`, ...optionalParams);\n}\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { ActivityInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all activities registered and available to be used.\n * The key is the id of the activity and the value is the activity itself.\n */\nconst registeredActivities = new CachedMap<string, ActivityInterface>({ cacheSize: 20 });\n\nnamespace RegisteredActivities {\n /**\n * Save an activity in the registered activities. If the activity already exists, it will be overwritten.\n * @param activity The activity to save.\n * @returns\n */\n export function add(activities: ActivityInterface | ActivityInterface[]) {\n if (Array.isArray(activities)) {\n activities.forEach((activity) => RegisteredActivities.add(activity));\n return;\n }\n registeredActivities.set(activities.id, activities);\n }\n\n /**\n * Get an activity by its id.\n * @param id The id of the activity.\n * @returns The activity or undefined if not found.\n */\n export function get(id: string): ActivityInterface | undefined {\n try {\n let activity = registeredActivities.get(id);\n if (!activity) {\n console.warn(`[NQTR] Activity ${id} not found, you should register it first`);\n return;\n }\n return activity;\n } catch (e) {\n logger.error(`Error while getting Activity ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all activities registered.\n * @returns An array of activities.\n */\n export function values(): ActivityInterface[] {\n return Array.from(registeredActivities.values());\n }\n\n /**\n * Check if an activity is registered.\n * @param id The id of the activity.\n * @returns True if the activity is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredActivities.has(id);\n }\n}\nexport default RegisteredActivities;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { CommitmentInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all commitments registered and available to be used.\n * The key is the id of the commitment and the value is the commitment itself.\n */\nexport const registeredCommitments = new CachedMap<string, CommitmentInterface>({ cacheSize: 20 });\nexport const fixedCommitments = new CachedMap<string, CommitmentInterface>({ cacheSize: 20 });\n\nnamespace RegisteredCommitments {\n /**\n * Save a commitment in the registered commitments. If the commitment already exists, it will be overwritten.\n * @param commitment The commitment to save.\n * @returns\n */\n export function add(commitments: CommitmentInterface | CommitmentInterface[]) {\n if (Array.isArray(commitments)) {\n commitments.forEach((commitment) => RegisteredCommitments.add(commitment));\n return;\n }\n registeredCommitments.set(commitments.id, commitments);\n }\n /**\n * Get a commitment by its id.\n * @param id The id of the commitment.\n * @returns The commitment or undefined if not found.\n */\n export function get(id: string): CommitmentInterface | undefined {\n try {\n let commitment = registeredCommitments.get(id);\n if (!commitment) {\n console.warn(`[NQTR] Commitment ${id} not found, you should register it first`);\n return;\n }\n return commitment;\n } catch (e) {\n logger.error(`Error while getting Commitment ${id}`, e);\n return;\n }\n }\n /**\n * Get a list of all commitments registered.\n * @returns An array of commitments.\n */\n export function values(): CommitmentInterface[] {\n return Array.from(registeredCommitments.values());\n }\n /**\n * Check if a commitment is registered.\n * @param id The id of the commitment.\n * @returns True if the commitment is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredCommitments.has(id);\n }\n}\nexport default RegisteredCommitments;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { LocationInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all locations registered and available to be used.\n * The key is the id of the location and the value is the location itself.\n */\nconst registeredLocations = new CachedMap<string, LocationInterface>({ cacheSize: 20 });\n\nnamespace RegisteredLocations {\n /**\n * Save a location in the registered locations. If the location already exists, it will be overwritten.\n * @param location The location to save.\n * @returns\n */\n export function add(location: LocationInterface | LocationInterface[]) {\n if (Array.isArray(location)) {\n location.forEach((c) => add(c));\n return;\n }\n // if (registeredLocations.has(location.id)) {\n // console.warn(`[NQTR] Location id ${location.id} already exists, it will be overwritten`);\n // }\n registeredLocations.set(location.id, location);\n }\n\n /**\n * Get a location by its id.\n * @param id The id of the location.\n * @returns The location or undefined if not found.\n */\n export function get(id: string): LocationInterface | undefined {\n try {\n let location = registeredLocations.get(id);\n if (!location) {\n console.warn(`[NQTR] Location ${id} not found, you should register it first`);\n return;\n }\n return location;\n } catch (e) {\n logger.error(`Error while getting Location ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all locations registered.\n * @returns An array of locations.\n */\n export function values(): LocationInterface[] {\n return Array.from(registeredLocations.values());\n }\n\n /**\n * Check if a location is registered.\n * @param id The id of the location.\n * @returns True if the location is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredLocations.has(id);\n }\n}\nexport default RegisteredLocations;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { MapInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all maps registered and available to be used.\n * The key is the id of the map and the value is the map itself.\n */\nconst registeredMaps = new CachedMap<string, MapInterface>({ cacheSize: 20 });\n\nnamespace RegisteredMaps {\n /**\n * Save a map in the registered maps. If the map already exists, it will be overwritten.\n * @param map The map to save.\n * @returns\n */\n export function add(map: MapInterface | MapInterface[]) {\n if (Array.isArray(map)) {\n map.forEach((c) => add(c));\n return;\n }\n // if (registeredMaps.has(map.id)) {\n // console.warn(`[NQTR] Map id ${map.id} already exists, it will be overwritten`);\n // }\n registeredMaps.set(map.id, map);\n }\n\n /**\n * Get a map by its id.\n * @param id The id of the map.\n * @returns The map or undefined if not found.\n */\n export function get(id: string): MapInterface | undefined {\n try {\n let map = registeredMaps.get(id);\n if (!map) {\n console.warn(`[NQTR] Map ${id} not found, you should register it first`);\n return;\n }\n return map;\n } catch (e) {\n logger.error(`Error while getting Map ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all maps registered.\n * @returns An array of maps.\n */\n export function values(): MapInterface[] {\n return Array.from(registeredMaps.values());\n }\n\n /**\n * Check if a map is registered.\n * @param id The id of the map.\n * @returns True if the map is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredMaps.has(id);\n }\n}\nexport default RegisteredMaps;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { QuestInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all quests registered and available to be used.\n * The key is the id of the quest and the value is the quest itself.\n */\nconst registeredQuests = new CachedMap<string, QuestInterface>({ cacheSize: 5 });\n\nnamespace RegisteredQuest {\n /**\n * Save a quest in the registered quests. If the quest already exists, it will be overwritten.\n * @param quest The quest to save.\n * @returns\n */\n export function add(quests: QuestInterface | QuestInterface[]) {\n if (Array.isArray(quests)) {\n quests.forEach((quest) => RegisteredQuest.add(quest));\n return;\n }\n registeredQuests.set(quests.id, quests);\n }\n /**\n * Get a quest by its id.\n * @param id The id of the quest.\n * @returns The quest or undefined if not found.\n */\n export function get(id: string): QuestInterface | undefined {\n try {\n let quest = registeredQuests.get(id);\n if (!quest) {\n console.warn(`[NQTR] Quest ${id} not found, you should register it first`);\n return;\n }\n return quest;\n } catch (e) {\n logger.error(`Error while getting Quest ${id}`, e);\n return;\n }\n }\n /**\n * Get a list of all quests registered.\n * @returns An array of quests.\n */\n export function values(): QuestInterface[] {\n return Array.from(registeredQuests.values());\n }\n /**\n * Check if a quest is registered.\n * @param id The id of the quest.\n * @returns True if the quest is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredQuests.has(id);\n }\n}\nexport default RegisteredQuest;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { RoomInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\nimport RegisteredLocations from \"./RegisteredLocations\";\nimport RegisteredMaps from \"./RegisteredMaps\";\n\n/**\n * A Map that contains all rooms registered and available to be used.\n * The key is the id of the room and the value is the room itself.\n */\nconst registeredRooms = new CachedMap<string, RoomInterface>({ cacheSize: 20 });\n\nnamespace RegisteredRooms {\n /**\n * Save a room in the registered rooms, and their location and map if they are not already registered.\n * If the room already exists, it will be overwritten.\n * @param room The room to save.\n * @returns\n */\n export function add(room: RoomInterface | RoomInterface[]) {\n if (Array.isArray(room)) {\n room.forEach((c) => add(c));\n return;\n }\n registeredRooms.set(room.id, room);\n let location = room.location;\n RegisteredLocations.add(location);\n let map = location?.map;\n if (map) {\n RegisteredMaps.add(map);\n }\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 */\n export function get(id: string): RoomInterface | undefined {\n try {\n let room = registeredRooms.get(id);\n if (!room) {\n console.warn(`[NQTR] Room ${id} not found, you should register it first`);\n return;\n }\n return room;\n } catch (e) {\n logger.error(`Error while getting Room ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all rooms registered.\n * @returns An array of rooms.\n */\n export function values(): RoomInterface[] {\n return Array.from(registeredRooms.values());\n }\n\n /**\n * Check if a room is registered.\n * @param id The id of the room.\n * @returns True if the room is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredRooms.has(id);\n }\n}\nexport default RegisteredRooms;\n"]}
@@ -1,5 +1,5 @@
1
- import { A as ActivityInterface, C as CommitmentInterface, L as LocationInterface, M as MapInterface, R as RoomInterface } from '../RoomInterface-B6ryEuU-.mjs';
2
- import { Q as QuestInterface } from '../StageInterface-C1Zfcpk3.mjs';
1
+ import { A as ActivityInterface, C as CommitmentInterface, L as LocationInterface, M as MapInterface, R as RoomInterface } from '../RoomInterface-COSoQndi.mjs';
2
+ import { Q as QuestInterface } from '../StageInterface-v96_K9Tg.mjs';
3
3
  import '@drincs/nqtr';
4
4
  import '@drincs/pixi-vn';
5
5
 
@@ -1,5 +1,5 @@
1
- import { A as ActivityInterface, C as CommitmentInterface, L as LocationInterface, M as MapInterface, R as RoomInterface } from '../RoomInterface-C_Dbpef2.js';
2
- import { Q as QuestInterface } from '../StageInterface-C1Zfcpk3.js';
1
+ import { A as ActivityInterface, C as CommitmentInterface, L as LocationInterface, M as MapInterface, R as RoomInterface } from '../RoomInterface-VyDG8FVX.js';
2
+ import { Q as QuestInterface } from '../StageInterface-v96_K9Tg.js';
3
3
  import '@drincs/nqtr';
4
4
  import '@drincs/pixi-vn';
5
5
 
@@ -1,2 +1,2 @@
1
- import {CachedMap}from'@drincs/pixi-vn';var o;(t=>(t.log=(e,...r)=>console.log(`[NQTR] ${e}`,...r),t.warn=(e,...r)=>console.warn(`[NQTR] ${e}`,...r),t.error=(e,...r)=>console.error(`[NQTR] ${e}`,...r),t.info=(e,...r)=>console.info(`[NQTR] ${e}`,...r)))(o||={});var c=new CachedMap({cacheSize:20}),y;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>t.add(r));return}c.set(e.id,e);}t.add=n;function a(e){try{let r=c.get(e);if(!r){console.warn(`[NQTR] Activity ${e} not found, you should register it first`);return}return r}catch(r){o.error(`Error while getting Activity ${e}`,r);return}}t.get=a;function i(){return Array.from(c.values())}t.values=i;function f(e){return c.has(e)}t.has=f;})(y||={});var M=y;var s=new CachedMap({cacheSize:20});new CachedMap({cacheSize:20});var I;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>t.add(r));return}console.warn(`[NQTR] Registering commitment ${e.id}`,e),s.set(e.id,e);}t.add=n;function a(e){try{let r=s.get(e);if(!r){console.warn(`[NQTR] Commitment ${e} not found, you should register it first`);return}return r}catch(r){o.error(`Error while getting Commitment ${e}`,r);return}}t.get=a;function i(){return Array.from(s.values())}t.values=i;function f(e){return s.has(e)}t.has=f;})(I||={});var $=I;var u=new CachedMap({cacheSize:20}),R;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>n(r));return}u.set(e.id,e);}t.add=n;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){o.error(`Error while getting Location ${e}`,r);return}}t.get=a;function i(){return Array.from(u.values())}t.values=i;function f(e){return u.has(e)}t.has=f;})(R||={});var g=R;var m=new CachedMap({cacheSize:20}),A;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>n(r));return}m.set(e.id,e);}t.add=n;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){o.error(`Error while getting Map ${e}`,r);return}}t.get=a;function i(){return Array.from(m.values())}t.values=i;function f(e){return m.has(e)}t.has=f;})(A||={});var l=A;var p=new CachedMap({cacheSize:5}),w;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>t.add(r));return}p.set(e.id,e);}t.add=n;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){o.error(`Error while getting Quest ${e}`,r);return}}t.get=a;function i(){return Array.from(p.values())}t.values=i;function f(e){return p.has(e)}t.has=f;})(w||={});var T=w;var d=new CachedMap({cacheSize:20}),Q;(t=>{function n(e){if(Array.isArray(e)){e.forEach(v=>n(v));return}d.set(e.id,e);let r=e.location;g.add(r);let h=r?.map;h&&l.add(h);}t.add=n;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){o.error(`Error while getting Room ${e}`,r);return}}t.get=a;function i(){return Array.from(d.values())}t.values=i;function f(e){return d.has(e)}t.has=f;})(Q||={});var S=Q;export{M as RegisteredActivities,$ as RegisteredCommitments,g as RegisteredLocations,l as RegisteredMaps,T as RegisteredQuests,S as RegisteredRooms};//# sourceMappingURL=index.mjs.map
1
+ import {CachedMap}from'@drincs/pixi-vn';var o;(t=>(t.log=(e,...r)=>console.log(`[NQTR] ${e}`,...r),t.warn=(e,...r)=>console.warn(`[NQTR] ${e}`,...r),t.error=(e,...r)=>console.error(`[NQTR] ${e}`,...r),t.info=(e,...r)=>console.info(`[NQTR] ${e}`,...r)))(o||={});var c=new CachedMap({cacheSize:20}),y;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>t.add(r));return}c.set(e.id,e);}t.add=n;function a(e){try{let r=c.get(e);if(!r){console.warn(`[NQTR] Activity ${e} not found, you should register it first`);return}return r}catch(r){o.error(`Error while getting Activity ${e}`,r);return}}t.get=a;function i(){return Array.from(c.values())}t.values=i;function f(e){return c.has(e)}t.has=f;})(y||={});var M=y;var s=new CachedMap({cacheSize:20});new CachedMap({cacheSize:20});var I;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>t.add(r));return}s.set(e.id,e);}t.add=n;function a(e){try{let r=s.get(e);if(!r){console.warn(`[NQTR] Commitment ${e} not found, you should register it first`);return}return r}catch(r){o.error(`Error while getting Commitment ${e}`,r);return}}t.get=a;function i(){return Array.from(s.values())}t.values=i;function f(e){return s.has(e)}t.has=f;})(I||={});var $=I;var u=new CachedMap({cacheSize:20}),A;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>n(r));return}u.set(e.id,e);}t.add=n;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){o.error(`Error while getting Location ${e}`,r);return}}t.get=a;function i(){return Array.from(u.values())}t.values=i;function f(e){return u.has(e)}t.has=f;})(A||={});var g=A;var m=new CachedMap({cacheSize:20}),R;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>n(r));return}m.set(e.id,e);}t.add=n;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){o.error(`Error while getting Map ${e}`,r);return}}t.get=a;function i(){return Array.from(m.values())}t.values=i;function f(e){return m.has(e)}t.has=f;})(R||={});var l=R;var p=new CachedMap({cacheSize:5}),w;(t=>{function n(e){if(Array.isArray(e)){e.forEach(r=>t.add(r));return}p.set(e.id,e);}t.add=n;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){o.error(`Error while getting Quest ${e}`,r);return}}t.get=a;function i(){return Array.from(p.values())}t.values=i;function f(e){return p.has(e)}t.has=f;})(w||={});var T=w;var d=new CachedMap({cacheSize:20}),v;(t=>{function n(e){if(Array.isArray(e)){e.forEach(Q=>n(Q));return}d.set(e.id,e);let r=e.location;g.add(r);let h=r?.map;h&&l.add(h);}t.add=n;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){o.error(`Error while getting Room ${e}`,r);return}}t.get=a;function i(){return Array.from(d.values())}t.values=i;function f(e){return d.has(e)}t.has=f;})(v||={});var S=v;export{M as RegisteredActivities,$ as RegisteredCommitments,g as RegisteredLocations,l as RegisteredMaps,T as RegisteredQuests,S as RegisteredRooms};//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/log-utility.ts","../../src/decorators/RegisteredActivities.ts","../../src/decorators/RegisteredCommitments.ts","../../src/decorators/RegisteredLocations.ts","../../src/decorators/RegisteredMaps.ts","../../src/decorators/RegisteredQuests.ts","../../src/decorators/RegisteredRooms.ts"],"names":["logger","message","optionalParams","registeredActivities","CachedMap","RegisteredActivities","add","activities","activity","get","id","e","values","has","RegisteredActivities_default","registeredCommitments","RegisteredCommitments","commitments","commitment","RegisteredCommitments_default","registeredLocations","RegisteredLocations","location","c","RegisteredLocations_default","registeredMaps","RegisteredMaps","map","RegisteredMaps_default","registeredQuests","RegisteredQuest","quests","quest","RegisteredQuests_default","registeredRooms","RegisteredRooms","room","RegisteredRooms_default"],"mappings":"wCAAO,IAAUA,OACAA,CAAAA,CAAA,GAAA,CAAM,CAACC,CAAAA,CAAAA,GAAkBC,CAAAA,GAA0B,QAAQ,GAAA,CAAI,CAAA,OAAA,EAAUD,CAAO,CAAA,CAAA,CAAI,GAAGC,CAAc,CAAA,CACrGF,CAAAA,CAAA,IAAA,CAAO,CAACC,CAAAA,CAAAA,GAAkBC,CAAAA,GACnC,QAAQ,IAAA,CAAK,CAAA,OAAA,EAAUD,CAAO,CAAA,CAAA,CAAI,GAAGC,CAAc,CAAA,CAC1CF,CAAAA,CAAA,MAAQ,CAACC,CAAAA,CAAAA,GAAkBC,IACpC,OAAA,CAAQ,KAAA,CAAM,UAAUD,CAAO,CAAA,CAAA,CAAI,GAAGC,CAAc,CAAA,CAC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AAA,CAC1B,MACJ,CACAW,EAAgB,GAAA,CAAIE,CAAAA,CAAK,GAAIA,CAAI,CAAA,CACjC,IAAId,CAAAA,CAAWc,CAAAA,CAAK,SACpBZ,CAAAA,CAAoB,GAAA,CAAIF,CAAQ,CAAA,CAChC,IAAIK,EAAML,CAAAA,EAAU,GAAA,CAChBK,GACAC,CAAAA,CAAe,GAAA,CAAID,CAAG,EAE9B,CAZOQ,CAAAA,CAAS,IAAA7B,CAAAA,CAmBT,SAASG,EAAIC,CAAAA,CAAuC,CACvD,GAAI,CACA,IAAI0B,EAAOF,CAAAA,CAAgB,GAAA,CAAIxB,CAAE,CAAA,CACjC,GAAI,CAAC0B,CAAAA,CAAM,CACP,QAAQ,IAAA,CAAK,CAAA,YAAA,EAAe1B,CAAE,CAAA,wCAAA,CAA0C,CAAA,CACxE,MACJ,CACA,OAAO0B,CACX,OAASzB,CAAAA,CAAG,CACRX,EAAO,KAAA,CAAM,CAAA,yBAAA,EAA4BU,CAAE,CAAA,CAAA,CAAIC,CAAC,EAChD,MACJ,CACJ,CAZOwB,CAAAA,CAAS,GAAA,CAAA1B,EAkBT,SAASG,CAAAA,EAA0B,CACtC,OAAO,KAAA,CAAM,IAAA,CAAKsB,EAAgB,MAAA,EAAQ,CAC9C,CAFOC,CAAAA,CAAS,OAAAvB,CAAAA,CAST,SAASC,CAAAA,CAAIH,CAAAA,CAAqB,CACrC,OAAOwB,EAAgB,GAAA,CAAIxB,CAAE,CACjC,CAFOyB,CAAAA,CAAS,IAAAtB,EAAAA,CAAAA,EArDVsB,CAAAA,GAAA,EAAA,CAAA,CAyDV,IAAOE,CAAAA,CAAQF","file":"index.mjs","sourcesContent":["export namespace logger {\n export const log = (message?: any, ...optionalParams: any[]) => console.log(`[NQTR] ${message}`, ...optionalParams);\n export const warn = (message?: any, ...optionalParams: any[]) =>\n console.warn(`[NQTR] ${message}`, ...optionalParams);\n export const error = (message?: any, ...optionalParams: any[]) =>\n console.error(`[NQTR] ${message}`, ...optionalParams);\n export const info = (message?: any, ...optionalParams: any[]) =>\n console.info(`[NQTR] ${message}`, ...optionalParams);\n}\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { ActivityInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all activities registered and available to be used.\n * The key is the id of the activity and the value is the activity itself.\n */\nconst registeredActivities = new CachedMap<string, ActivityInterface>({ cacheSize: 20 });\n\nnamespace RegisteredActivities {\n /**\n * Save an activity in the registered activities. If the activity already exists, it will be overwritten.\n * @param activity The activity to save.\n * @returns\n */\n export function add(activities: ActivityInterface | ActivityInterface[]) {\n if (Array.isArray(activities)) {\n activities.forEach((activity) => RegisteredActivities.add(activity));\n return;\n }\n registeredActivities.set(activities.id, activities);\n }\n\n /**\n * Get an activity by its id.\n * @param id The id of the activity.\n * @returns The activity or undefined if not found.\n */\n export function get(id: string): ActivityInterface | undefined {\n try {\n let activity = registeredActivities.get(id);\n if (!activity) {\n console.warn(`[NQTR] Activity ${id} not found, you should register it first`);\n return;\n }\n return activity;\n } catch (e) {\n logger.error(`Error while getting Activity ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all activities registered.\n * @returns An array of activities.\n */\n export function values(): ActivityInterface[] {\n return Array.from(registeredActivities.values());\n }\n\n /**\n * Check if an activity is registered.\n * @param id The id of the activity.\n * @returns True if the activity is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredActivities.has(id);\n }\n}\nexport default RegisteredActivities;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { CommitmentInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all commitments registered and available to be used.\n * The key is the id of the commitment and the value is the commitment itself.\n */\nexport const registeredCommitments = new CachedMap<string, CommitmentInterface>({ cacheSize: 20 });\nexport const fixedCommitments = new CachedMap<string, CommitmentInterface>({ cacheSize: 20 });\n\nnamespace RegisteredCommitments {\n /**\n * Save a commitment in the registered commitments. If the commitment already exists, it will be overwritten.\n * @param commitment The commitment to save.\n * @returns\n */\n export function add(commitments: CommitmentInterface | CommitmentInterface[]) {\n if (Array.isArray(commitments)) {\n commitments.forEach((commitment) => RegisteredCommitments.add(commitment));\n return;\n }\n console.warn(`[NQTR] Registering commitment ${commitments.id}`, commitments);\n registeredCommitments.set(commitments.id, commitments);\n }\n /**\n * Get a commitment by its id.\n * @param id The id of the commitment.\n * @returns The commitment or undefined if not found.\n */\n export function get(id: string): CommitmentInterface | undefined {\n try {\n let commitment = registeredCommitments.get(id);\n if (!commitment) {\n console.warn(`[NQTR] Commitment ${id} not found, you should register it first`);\n return;\n }\n return commitment;\n } catch (e) {\n logger.error(`Error while getting Commitment ${id}`, e);\n return;\n }\n }\n /**\n * Get a list of all commitments registered.\n * @returns An array of commitments.\n */\n export function values(): CommitmentInterface[] {\n return Array.from(registeredCommitments.values());\n }\n /**\n * Check if a commitment is registered.\n * @param id The id of the commitment.\n * @returns True if the commitment is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredCommitments.has(id);\n }\n}\nexport default RegisteredCommitments;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { LocationInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all locations registered and available to be used.\n * The key is the id of the location and the value is the location itself.\n */\nconst registeredLocations = new CachedMap<string, LocationInterface>({ cacheSize: 20 });\n\nnamespace RegisteredLocations {\n /**\n * Save a location in the registered locations. If the location already exists, it will be overwritten.\n * @param location The location to save.\n * @returns\n */\n export function add(location: LocationInterface | LocationInterface[]) {\n if (Array.isArray(location)) {\n location.forEach((c) => add(c));\n return;\n }\n // if (registeredLocations.has(location.id)) {\n // console.warn(`[NQTR] Location id ${location.id} already exists, it will be overwritten`);\n // }\n registeredLocations.set(location.id, location);\n }\n\n /**\n * Get a location by its id.\n * @param id The id of the location.\n * @returns The location or undefined if not found.\n */\n export function get(id: string): LocationInterface | undefined {\n try {\n let location = registeredLocations.get(id);\n if (!location) {\n console.warn(`[NQTR] Location ${id} not found, you should register it first`);\n return;\n }\n return location;\n } catch (e) {\n logger.error(`Error while getting Location ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all locations registered.\n * @returns An array of locations.\n */\n export function values(): LocationInterface[] {\n return Array.from(registeredLocations.values());\n }\n\n /**\n * Check if a location is registered.\n * @param id The id of the location.\n * @returns True if the location is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredLocations.has(id);\n }\n}\nexport default RegisteredLocations;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { MapInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all maps registered and available to be used.\n * The key is the id of the map and the value is the map itself.\n */\nconst registeredMaps = new CachedMap<string, MapInterface>({ cacheSize: 20 });\n\nnamespace RegisteredMaps {\n /**\n * Save a map in the registered maps. If the map already exists, it will be overwritten.\n * @param map The map to save.\n * @returns\n */\n export function add(map: MapInterface | MapInterface[]) {\n if (Array.isArray(map)) {\n map.forEach((c) => add(c));\n return;\n }\n // if (registeredMaps.has(map.id)) {\n // console.warn(`[NQTR] Map id ${map.id} already exists, it will be overwritten`);\n // }\n registeredMaps.set(map.id, map);\n }\n\n /**\n * Get a map by its id.\n * @param id The id of the map.\n * @returns The map or undefined if not found.\n */\n export function get(id: string): MapInterface | undefined {\n try {\n let map = registeredMaps.get(id);\n if (!map) {\n console.warn(`[NQTR] Map ${id} not found, you should register it first`);\n return;\n }\n return map;\n } catch (e) {\n logger.error(`Error while getting Map ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all maps registered.\n * @returns An array of maps.\n */\n export function values(): MapInterface[] {\n return Array.from(registeredMaps.values());\n }\n\n /**\n * Check if a map is registered.\n * @param id The id of the map.\n * @returns True if the map is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredMaps.has(id);\n }\n}\nexport default RegisteredMaps;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { QuestInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all quests registered and available to be used.\n * The key is the id of the quest and the value is the quest itself.\n */\nconst registeredQuests = new CachedMap<string, QuestInterface>({ cacheSize: 5 });\n\nnamespace RegisteredQuest {\n /**\n * Save a quest in the registered quests. If the quest already exists, it will be overwritten.\n * @param quest The quest to save.\n * @returns\n */\n export function add(quests: QuestInterface | QuestInterface[]) {\n if (Array.isArray(quests)) {\n quests.forEach((quest) => RegisteredQuest.add(quest));\n return;\n }\n registeredQuests.set(quests.id, quests);\n }\n /**\n * Get a quest by its id.\n * @param id The id of the quest.\n * @returns The quest or undefined if not found.\n */\n export function get(id: string): QuestInterface | undefined {\n try {\n let quest = registeredQuests.get(id);\n if (!quest) {\n console.warn(`[NQTR] Quest ${id} not found, you should register it first`);\n return;\n }\n return quest;\n } catch (e) {\n logger.error(`Error while getting Quest ${id}`, e);\n return;\n }\n }\n /**\n * Get a list of all quests registered.\n * @returns An array of quests.\n */\n export function values(): QuestInterface[] {\n return Array.from(registeredQuests.values());\n }\n /**\n * Check if a quest is registered.\n * @param id The id of the quest.\n * @returns True if the quest is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredQuests.has(id);\n }\n}\nexport default RegisteredQuest;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { RoomInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\nimport RegisteredLocations from \"./RegisteredLocations\";\nimport RegisteredMaps from \"./RegisteredMaps\";\n\n/**\n * A Map that contains all rooms registered and available to be used.\n * The key is the id of the room and the value is the room itself.\n */\nconst registeredRooms = new CachedMap<string, RoomInterface>({ cacheSize: 20 });\n\nnamespace RegisteredRooms {\n /**\n * Save a room in the registered rooms, and their location and map if they are not already registered.\n * If the room already exists, it will be overwritten.\n * @param room The room to save.\n * @returns\n */\n export function add(room: RoomInterface | RoomInterface[]) {\n if (Array.isArray(room)) {\n room.forEach((c) => add(c));\n return;\n }\n registeredRooms.set(room.id, room);\n let location = room.location;\n RegisteredLocations.add(location);\n let map = location?.map;\n if (map) {\n RegisteredMaps.add(map);\n }\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 */\n export function get(id: string): RoomInterface | undefined {\n try {\n let room = registeredRooms.get(id);\n if (!room) {\n console.warn(`[NQTR] Room ${id} not found, you should register it first`);\n return;\n }\n return room;\n } catch (e) {\n logger.error(`Error while getting Room ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all rooms registered.\n * @returns An array of rooms.\n */\n export function values(): RoomInterface[] {\n return Array.from(registeredRooms.values());\n }\n\n /**\n * Check if a room is registered.\n * @param id The id of the room.\n * @returns True if the room is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredRooms.has(id);\n }\n}\nexport default RegisteredRooms;\n"]}
1
+ {"version":3,"sources":["../../src/utils/log-utility.ts","../../src/decorators/RegisteredActivities.ts","../../src/decorators/RegisteredCommitments.ts","../../src/decorators/RegisteredLocations.ts","../../src/decorators/RegisteredMaps.ts","../../src/decorators/RegisteredQuests.ts","../../src/decorators/RegisteredRooms.ts"],"names":["logger","message","optionalParams","registeredActivities","CachedMap","RegisteredActivities","add","activities","activity","get","id","e","values","has","RegisteredActivities_default","registeredCommitments","RegisteredCommitments","commitments","commitment","RegisteredCommitments_default","registeredLocations","RegisteredLocations","location","c","RegisteredLocations_default","registeredMaps","RegisteredMaps","map","RegisteredMaps_default","registeredQuests","RegisteredQuest","quests","quest","RegisteredQuests_default","registeredRooms","RegisteredRooms","room","RegisteredRooms_default"],"mappings":"wCAAO,IAAUA,OACAA,CAAAA,CAAA,GAAA,CAAM,CAACC,CAAAA,CAAAA,GAAkBC,CAAAA,GAA0B,QAAQ,GAAA,CAAI,CAAA,OAAA,EAAUD,CAAO,CAAA,CAAA,CAAI,GAAGC,CAAc,CAAA,CACrGF,CAAAA,CAAA,KAAO,CAACC,CAAAA,CAAAA,GAAkBC,IACnC,OAAA,CAAQ,IAAA,CAAK,UAAUD,CAAO,CAAA,CAAA,C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,EAAoB,GAAA,CAAIF,CAAQ,EAChC,IAAIK,CAAAA,CAAML,GAAU,GAAA,CAChBK,CAAAA,EACAC,EAAe,GAAA,CAAID,CAAG,EAE9B,CAZOQ,CAAAA,CAAS,GAAA,CAAA7B,EAmBT,SAASG,CAAAA,CAAIC,EAAuC,CACvD,GAAI,CACA,IAAI0B,CAAAA,CAAOF,EAAgB,GAAA,CAAIxB,CAAE,EACjC,GAAI,CAAC0B,EAAM,CACP,OAAA,CAAQ,KAAK,CAAA,YAAA,EAAe1B,CAAE,CAAA,wCAAA,CAA0C,CAAA,CACxE,MACJ,CACA,OAAO0B,CACX,CAAA,MAASzB,EAAG,CACRX,CAAAA,CAAO,MAAM,CAAA,yBAAA,EAA4BU,CAAE,GAAIC,CAAC,CAAA,CAChD,MACJ,CACJ,CAZOwB,EAAS,GAAA,CAAA1B,CAAAA,CAkBT,SAASG,CAAAA,EAA0B,CACtC,OAAO,KAAA,CAAM,IAAA,CAAKsB,CAAAA,CAAgB,QAAQ,CAC9C,CAFOC,CAAAA,CAAS,MAAA,CAAAvB,EAST,SAASC,CAAAA,CAAIH,EAAqB,CACrC,OAAOwB,EAAgB,GAAA,CAAIxB,CAAE,CACjC,CAFOyB,CAAAA,CAAS,IAAAtB,EAAAA,CAAAA,EArDVsB,CAAAA,GAAA,EAAA,CAAA,CAyDV,IAAOE,CAAAA,CAAQF","file":"index.mjs","sourcesContent":["export namespace logger {\n export const log = (message?: any, ...optionalParams: any[]) => console.log(`[NQTR] ${message}`, ...optionalParams);\n export const warn = (message?: any, ...optionalParams: any[]) =>\n console.warn(`[NQTR] ${message}`, ...optionalParams);\n export const error = (message?: any, ...optionalParams: any[]) =>\n console.error(`[NQTR] ${message}`, ...optionalParams);\n export const info = (message?: any, ...optionalParams: any[]) =>\n console.info(`[NQTR] ${message}`, ...optionalParams);\n}\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { ActivityInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all activities registered and available to be used.\n * The key is the id of the activity and the value is the activity itself.\n */\nconst registeredActivities = new CachedMap<string, ActivityInterface>({ cacheSize: 20 });\n\nnamespace RegisteredActivities {\n /**\n * Save an activity in the registered activities. If the activity already exists, it will be overwritten.\n * @param activity The activity to save.\n * @returns\n */\n export function add(activities: ActivityInterface | ActivityInterface[]) {\n if (Array.isArray(activities)) {\n activities.forEach((activity) => RegisteredActivities.add(activity));\n return;\n }\n registeredActivities.set(activities.id, activities);\n }\n\n /**\n * Get an activity by its id.\n * @param id The id of the activity.\n * @returns The activity or undefined if not found.\n */\n export function get(id: string): ActivityInterface | undefined {\n try {\n let activity = registeredActivities.get(id);\n if (!activity) {\n console.warn(`[NQTR] Activity ${id} not found, you should register it first`);\n return;\n }\n return activity;\n } catch (e) {\n logger.error(`Error while getting Activity ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all activities registered.\n * @returns An array of activities.\n */\n export function values(): ActivityInterface[] {\n return Array.from(registeredActivities.values());\n }\n\n /**\n * Check if an activity is registered.\n * @param id The id of the activity.\n * @returns True if the activity is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredActivities.has(id);\n }\n}\nexport default RegisteredActivities;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { CommitmentInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all commitments registered and available to be used.\n * The key is the id of the commitment and the value is the commitment itself.\n */\nexport const registeredCommitments = new CachedMap<string, CommitmentInterface>({ cacheSize: 20 });\nexport const fixedCommitments = new CachedMap<string, CommitmentInterface>({ cacheSize: 20 });\n\nnamespace RegisteredCommitments {\n /**\n * Save a commitment in the registered commitments. If the commitment already exists, it will be overwritten.\n * @param commitment The commitment to save.\n * @returns\n */\n export function add(commitments: CommitmentInterface | CommitmentInterface[]) {\n if (Array.isArray(commitments)) {\n commitments.forEach((commitment) => RegisteredCommitments.add(commitment));\n return;\n }\n registeredCommitments.set(commitments.id, commitments);\n }\n /**\n * Get a commitment by its id.\n * @param id The id of the commitment.\n * @returns The commitment or undefined if not found.\n */\n export function get(id: string): CommitmentInterface | undefined {\n try {\n let commitment = registeredCommitments.get(id);\n if (!commitment) {\n console.warn(`[NQTR] Commitment ${id} not found, you should register it first`);\n return;\n }\n return commitment;\n } catch (e) {\n logger.error(`Error while getting Commitment ${id}`, e);\n return;\n }\n }\n /**\n * Get a list of all commitments registered.\n * @returns An array of commitments.\n */\n export function values(): CommitmentInterface[] {\n return Array.from(registeredCommitments.values());\n }\n /**\n * Check if a commitment is registered.\n * @param id The id of the commitment.\n * @returns True if the commitment is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredCommitments.has(id);\n }\n}\nexport default RegisteredCommitments;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { LocationInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all locations registered and available to be used.\n * The key is the id of the location and the value is the location itself.\n */\nconst registeredLocations = new CachedMap<string, LocationInterface>({ cacheSize: 20 });\n\nnamespace RegisteredLocations {\n /**\n * Save a location in the registered locations. If the location already exists, it will be overwritten.\n * @param location The location to save.\n * @returns\n */\n export function add(location: LocationInterface | LocationInterface[]) {\n if (Array.isArray(location)) {\n location.forEach((c) => add(c));\n return;\n }\n // if (registeredLocations.has(location.id)) {\n // console.warn(`[NQTR] Location id ${location.id} already exists, it will be overwritten`);\n // }\n registeredLocations.set(location.id, location);\n }\n\n /**\n * Get a location by its id.\n * @param id The id of the location.\n * @returns The location or undefined if not found.\n */\n export function get(id: string): LocationInterface | undefined {\n try {\n let location = registeredLocations.get(id);\n if (!location) {\n console.warn(`[NQTR] Location ${id} not found, you should register it first`);\n return;\n }\n return location;\n } catch (e) {\n logger.error(`Error while getting Location ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all locations registered.\n * @returns An array of locations.\n */\n export function values(): LocationInterface[] {\n return Array.from(registeredLocations.values());\n }\n\n /**\n * Check if a location is registered.\n * @param id The id of the location.\n * @returns True if the location is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredLocations.has(id);\n }\n}\nexport default RegisteredLocations;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { MapInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all maps registered and available to be used.\n * The key is the id of the map and the value is the map itself.\n */\nconst registeredMaps = new CachedMap<string, MapInterface>({ cacheSize: 20 });\n\nnamespace RegisteredMaps {\n /**\n * Save a map in the registered maps. If the map already exists, it will be overwritten.\n * @param map The map to save.\n * @returns\n */\n export function add(map: MapInterface | MapInterface[]) {\n if (Array.isArray(map)) {\n map.forEach((c) => add(c));\n return;\n }\n // if (registeredMaps.has(map.id)) {\n // console.warn(`[NQTR] Map id ${map.id} already exists, it will be overwritten`);\n // }\n registeredMaps.set(map.id, map);\n }\n\n /**\n * Get a map by its id.\n * @param id The id of the map.\n * @returns The map or undefined if not found.\n */\n export function get(id: string): MapInterface | undefined {\n try {\n let map = registeredMaps.get(id);\n if (!map) {\n console.warn(`[NQTR] Map ${id} not found, you should register it first`);\n return;\n }\n return map;\n } catch (e) {\n logger.error(`Error while getting Map ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all maps registered.\n * @returns An array of maps.\n */\n export function values(): MapInterface[] {\n return Array.from(registeredMaps.values());\n }\n\n /**\n * Check if a map is registered.\n * @param id The id of the map.\n * @returns True if the map is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredMaps.has(id);\n }\n}\nexport default RegisteredMaps;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { QuestInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all quests registered and available to be used.\n * The key is the id of the quest and the value is the quest itself.\n */\nconst registeredQuests = new CachedMap<string, QuestInterface>({ cacheSize: 5 });\n\nnamespace RegisteredQuest {\n /**\n * Save a quest in the registered quests. If the quest already exists, it will be overwritten.\n * @param quest The quest to save.\n * @returns\n */\n export function add(quests: QuestInterface | QuestInterface[]) {\n if (Array.isArray(quests)) {\n quests.forEach((quest) => RegisteredQuest.add(quest));\n return;\n }\n registeredQuests.set(quests.id, quests);\n }\n /**\n * Get a quest by its id.\n * @param id The id of the quest.\n * @returns The quest or undefined if not found.\n */\n export function get(id: string): QuestInterface | undefined {\n try {\n let quest = registeredQuests.get(id);\n if (!quest) {\n console.warn(`[NQTR] Quest ${id} not found, you should register it first`);\n return;\n }\n return quest;\n } catch (e) {\n logger.error(`Error while getting Quest ${id}`, e);\n return;\n }\n }\n /**\n * Get a list of all quests registered.\n * @returns An array of quests.\n */\n export function values(): QuestInterface[] {\n return Array.from(registeredQuests.values());\n }\n /**\n * Check if a quest is registered.\n * @param id The id of the quest.\n * @returns True if the quest is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredQuests.has(id);\n }\n}\nexport default RegisteredQuest;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { RoomInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\nimport RegisteredLocations from \"./RegisteredLocations\";\nimport RegisteredMaps from \"./RegisteredMaps\";\n\n/**\n * A Map that contains all rooms registered and available to be used.\n * The key is the id of the room and the value is the room itself.\n */\nconst registeredRooms = new CachedMap<string, RoomInterface>({ cacheSize: 20 });\n\nnamespace RegisteredRooms {\n /**\n * Save a room in the registered rooms, and their location and map if they are not already registered.\n * If the room already exists, it will be overwritten.\n * @param room The room to save.\n * @returns\n */\n export function add(room: RoomInterface | RoomInterface[]) {\n if (Array.isArray(room)) {\n room.forEach((c) => add(c));\n return;\n }\n registeredRooms.set(room.id, room);\n let location = room.location;\n RegisteredLocations.add(location);\n let map = location?.map;\n if (map) {\n RegisteredMaps.add(map);\n }\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 */\n export function get(id: string): RoomInterface | undefined {\n try {\n let room = registeredRooms.get(id);\n if (!room) {\n console.warn(`[NQTR] Room ${id} not found, you should register it first`);\n return;\n }\n return room;\n } catch (e) {\n logger.error(`Error while getting Room ${id}`, e);\n return;\n }\n }\n\n /**\n * Get a list of all rooms registered.\n * @returns An array of rooms.\n */\n export function values(): RoomInterface[] {\n return Array.from(registeredRooms.values());\n }\n\n /**\n * Check if a room is registered.\n * @param id The id of the room.\n * @returns True if the room is registered, false otherwise.\n */\n export function has(id: string): boolean {\n return registeredRooms.has(id);\n }\n}\nexport default RegisteredRooms;\n"]}
@@ -1,5 +1,5 @@
1
- import { T as TimeSchedulingInterface, D as DateSchedulingInterface, C as CommitmentInterface, A as ActivityInterface } from './RoomInterface-B6ryEuU-.mjs';
2
- import { E as ExecutionType, a as OnRunEvent, Q as QuestInterface, d as QuestsRequiredType, S as StageInterface } from './StageInterface-C1Zfcpk3.mjs';
1
+ import { T as TimeSchedulingInterface, D as DateSchedulingInterface, C as CommitmentInterface, A as ActivityInterface } from './RoomInterface-COSoQndi.mjs';
2
+ import { E as ExecutionType, a as OnRunEvent, Q as QuestInterface, d as QuestsRequiredType, S as StageInterface } from './StageInterface-v96_K9Tg.mjs';
3
3
 
4
4
  interface ActivityProps {
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { T as TimeSchedulingInterface, D as DateSchedulingInterface, C as CommitmentInterface, A as ActivityInterface } from './RoomInterface-C_Dbpef2.js';
2
- import { E as ExecutionType, a as OnRunEvent, Q as QuestInterface, d as QuestsRequiredType, S as StageInterface } from './StageInterface-C1Zfcpk3.js';
1
+ import { T as TimeSchedulingInterface, D as DateSchedulingInterface, C as CommitmentInterface, A as ActivityInterface } from './RoomInterface-VyDG8FVX.js';
2
+ import { E as ExecutionType, a as OnRunEvent, Q as QuestInterface, d as QuestsRequiredType, S as StageInterface } from './StageInterface-v96_K9Tg.js';
3
3
 
4
4
  interface ActivityProps {
5
5
  /**
@@ -1,6 +1,6 @@
1
- import { C as CommitmentInterface, R as RoomInterface, L as LocationInterface, M as MapInterface } from './RoomInterface-C_Dbpef2.js';
1
+ import { C as CommitmentInterface, R as RoomInterface, L as LocationInterface, M as MapInterface } from './RoomInterface-VyDG8FVX.js';
2
2
  import { OnRunProps } from '@drincs/nqtr';
3
- import { Q as QuestInterface } from './StageInterface-C1Zfcpk3.js';
3
+ import { Q as QuestInterface } from './StageInterface-v96_K9Tg.js';
4
4
  import { CharacterInterface } from '@drincs/pixi-vn';
5
5
  import { TimeSettings, ITimeStlot as TimeSlotInterface } from './types/index.js';
6
6
 
@@ -1,6 +1,6 @@
1
- import { C as CommitmentInterface, R as RoomInterface, L as LocationInterface, M as MapInterface } from './RoomInterface-B6ryEuU-.mjs';
1
+ import { C as CommitmentInterface, R as RoomInterface, L as LocationInterface, M as MapInterface } from './RoomInterface-COSoQndi.mjs';
2
2
  import { OnRunProps } from '@drincs/nqtr';
3
- import { Q as QuestInterface } from './StageInterface-C1Zfcpk3.mjs';
3
+ import { Q as QuestInterface } from './StageInterface-v96_K9Tg.mjs';
4
4
  import { CharacterInterface } from '@drincs/pixi-vn';
5
5
  import { TimeSettings, ITimeStlot as TimeSlotInterface } from './types/index.mjs';
6
6
 
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var pixiVn=require('@drincs/pixi-vn');var Te=Object.defineProperty;var X=(o,e)=>{for(var t in e)Te(o,t,{get:e[t],enumerable:true});};var ne={};X(ne,{ActivityBaseModel:()=>O,ActivityStoredClass:()=>f,CommitmentBaseModel:()=>$,CommitmentStoredClass:()=>v,LocationBaseModel:()=>B,LocationStoredClass:()=>I,MapBaseModel:()=>k,MapStoredClass:()=>x,QuestBaseModel:()=>Y,QuestStoredClass:()=>_,RoomBaseModel:()=>z,RoomStoredClass:()=>R,StageBaseModel:()=>F,StageStoredClass:()=>T});var ie={};X(ie,{navigator:()=>y,questsNotebook:()=>Ce,routine:()=>re,timeTracker:()=>d});var l="___nqtr-time_manager_data___",p="___nqtr-current_room_memory___",Z="___nqtr-last_event_memory___";var ee={};X(ee,{RegisteredActivities:()=>D,RegisteredCommitments:()=>h,RegisteredLocations:()=>A,RegisteredMaps:()=>E,RegisteredQuests:()=>C,RegisteredRooms:()=>S});var s;(n=>(n.log=(i,...a)=>console.log(`[NQTR] ${i}`,...a),n.warn=(i,...a)=>console.warn(`[NQTR] ${i}`,...a),n.error=(i,...a)=>console.error(`[NQTR] ${i}`,...a),n.info=(i,...a)=>console.info(`[NQTR] ${i}`,...a)))(s||={});var V=new pixiVn.CachedMap({cacheSize:20}),oe;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>n.add(a));return}V.set(i.id,i);}n.add=o;function e(i){try{let a=V.get(i);if(!a){console.warn(`[NQTR] Activity ${i} not found, you should register it first`);return}return a}catch(a){s.error(`Error while getting Activity ${i}`,a);return}}n.get=e;function t(){return Array.from(V.values())}n.values=t;function r(i){return V.has(i)}n.has=r;})(oe||={});var D=oe;var b=new pixiVn.CachedMap({cacheSize:20}),H=new pixiVn.CachedMap({cacheSize:20}),ue;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>n.add(a));return}console.warn(`[NQTR] Registering commitment ${i.id}`,i),b.set(i.id,i);}n.add=o;function e(i){try{let a=b.get(i);if(!a){console.warn(`[NQTR] Commitment ${i} not found, you should register it first`);return}return a}catch(a){s.error(`Error while getting Commitment ${i}`,a);return}}n.get=e;function t(){return Array.from(b.values())}n.values=t;function r(i){return b.has(i)}n.has=r;})(ue||={});var h=ue;var G=new pixiVn.CachedMap({cacheSize:20}),de;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>o(a));return}G.set(i.id,i);}n.add=o;function e(i){try{let a=G.get(i);if(!a){console.warn(`[NQTR] Location ${i} not found, you should register it first`);return}return a}catch(a){s.error(`Error while getting Location ${i}`,a);return}}n.get=e;function t(){return Array.from(G.values())}n.values=t;function r(i){return G.has(i)}n.has=r;})(de||={});var A=de;var K=new pixiVn.CachedMap({cacheSize:20}),ce;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>o(a));return}K.set(i.id,i);}n.add=o;function e(i){try{let a=K.get(i);if(!a){console.warn(`[NQTR] Map ${i} not found, you should register it first`);return}return a}catch(a){s.error(`Error while getting Map ${i}`,a);return}}n.get=e;function t(){return Array.from(K.values())}n.values=t;function r(i){return K.has(i)}n.has=r;})(ce||={});var E=ce;var W=new pixiVn.CachedMap({cacheSize:5}),le;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>n.add(a));return}W.set(i.id,i);}n.add=o;function e(i){try{let a=W.get(i);if(!a){console.warn(`[NQTR] Quest ${i} not found, you should register it first`);return}return a}catch(a){s.error(`Error while getting Quest ${i}`,a);return}}n.get=e;function t(){return Array.from(W.values())}n.values=t;function r(i){return W.has(i)}n.has=r;})(le||={});var C=le;var U=new pixiVn.CachedMap({cacheSize:20}),me;(n=>{function o(i){if(Array.isArray(i)){i.forEach(m=>o(m));return}U.set(i.id,i);let a=i.location;A.add(a);let u=a?.map;u&&E.add(u);}n.add=o;function e(i){try{let a=U.get(i);if(!a){console.warn(`[NQTR] Room ${i} not found, you should register it first`);return}return a}catch(a){s.error(`Error while getting Room ${i}`,a);return}}n.get=e;function t(){return Array.from(U.values())}n.values=t;function r(i){return U.has(i)}n.has=r;})(me||={});var S=me;function w(o){pixiVn.storage.setVariable(Z,o);}function ge(){return pixiVn.storage.getVariable(Z)}var Q=class{get rooms(){return S.values()}get locations(){return A.values()}get maps(){return E.values()}get currentRoomId(){return pixiVn.storage.getVariable(p)}get currentRoom(){let e=this.currentRoomId;if(!e){s.error("The current room has not yet been set");return}let t=S.get(e);if(!t){s.error(`Current room ${e} not found`);return}return t}set currentRoom(e){if(typeof e!="string"&&(e=e.id),!S.get(e)){s.error(`The room ${e} is not registered, so it can't be set as current room`);return}let r=pixiVn.storage.getVariable(p);r!==e&&(w({type:"editroom",prev:r,value:e}),pixiVn.storage.setVariable(p,e));}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){S.values().forEach(e=>{e.clearExpiredActivities();});}};var M=class{get quests(){return C.values()}get startedQuests(){return this.quests.filter(e=>e.started)}get inProgressQuests(){return this.quests.filter(e=>e.inProgress)}get completedQuests(){return this.quests.filter(e=>e.completed)}get failedQuests(){return this.quests.filter(e=>e.failed)}get notStartedQuests(){return this.quests.filter(e=>!e.started)}find(e){return C.get(e)}async startsStageMustBeStarted(e){let t=this.quests.map(r=>r.currentStageMustStart?r.startCurrentStage(e):Promise.resolve());await Promise.all(t);}};var J="___nqtr-temporary_commitment___",N=class{get fixedRoutine(){return [...H.values()]}set fixedRoutine(e){e.forEach(t=>{H.has(t.id)&&console.warn(`[NQTR] Commitment id ${t.id} already exists, it will be overwritten`),H.set(t.id,t);});}get temporaryRoutine(){let e=pixiVn.storage.getVariable(J);return e?e.map(r=>h.get(r)).filter(r=>r!==void 0):[]}get allRoutine(){return [...this.fixedRoutine,...this.temporaryRoutine]}add(e){Array.isArray(e)||(e=[e]);let t=e.map(r=>{if(!h.get(r.id)){console.warn(`[NQTR] Commitment ${r.id} not found, it will be ignored`);return}return r.id}).filter(r=>r!==void 0);pixiVn.storage.setVariable(J,t);}find(e){return h.get(e)}remove(e){Array.isArray(e)||(e=[e]);let t=e.map(n=>n.id),r=pixiVn.storage.getVariable(J);r&&(r=r.filter(n=>!t.includes(n)),pixiVn.storage.setVariable(J,r));}clearExpiredRoutine(){h.values().forEach(e=>{e.expired&&b.delete(e.id);});}get currentRoutine(){let e={};return [...this.fixedRoutine,...this.temporaryRoutine].forEach(t=>{t.isActive&&(t.characters.length>0?t.characters.every(n=>!e[n.id]||t.priority>e[n.id].priority)&&t.characters.forEach(n=>{e[n.id]=t;}):s.error(`The commitment ${t.id} has no characters assigned`));}),Object.values(e)}getCommitmentByCharacter(e){this.currentRoutine.forEach(t=>{if(t.characters.map(r=>r.id).includes(e.id))return t});}};var c=class{static dayStartTime=0;static dayEndTime=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static getDayName};var q=class{initialize(e){let{dayStartTime:t=0,dayEndTime:r=24,defaultTimeSpent:n=1,timeSlots:i=[],weekLength:a=7,weekendStartDay:u=a-1,getDayName:m}=e;c.dayStartTime=t,c.dayEndTime=r,c.defaultTimeSpent=n,c.timeSlots=i,c.weekLength=a,u>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${a}, so will be ignored`):c.weekendStartDay=u,c.getDayName=m;}get dayStartTime(){return c.dayStartTime}get dayEndTime(){return c.dayEndTime}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get getDayName(){return c.getDayName}get currentTime(){let e=pixiVn.storage.getVariable(l)||{};return e.hasOwnProperty("currentTime")&&typeof e.currentTime=="number"?e.currentTime:this.dayStartTime}set currentTime(e){let t=pixiVn.storage.getVariable(l)||{},r={...t};typeof e=="number"?r.currentTime=e:delete r.currentTime,w({type:"edittime",prev:t,value:r}),pixiVn.storage.setVariable(l,r);}get currentDate(){let e=pixiVn.storage.getVariable(l)||{};return e.hasOwnProperty("currentDate")&&typeof e.currentDate=="number"?e.currentDate:0}set currentDate(e){let t=pixiVn.storage.getVariable(l)||{},r={...t};typeof e=="number"?r.currentDate=e:delete r.currentDate,w({type:"edittime",prev:t,value:r}),pixiVn.storage.setVariable(l,r);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDate%this.weekLength+1}get currentDayName(){return this.getDayName?this.getDayName(this.currentWeekDayNumber-1):(console.warn("[NQTR] Week days names are not defined, so currentDayName will be empty"),"")}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startTime,this.timeSlots[e+1].startTime))return e}return this.timeSlots.length-1}increaseTime(e=this.defaultTimeSpent){let t=this.currentTime+e;return t>=this.dayEndTime&&(this.increaseDate(),t=this.dayStartTime+(t-this.dayEndTime)),this.currentTime=t,this.currentTime}increaseDate(e=1,t=this.dayStartTime){let r=this.currentDate+e;return this.currentDate=r,this.currentTime=t,this.currentDate}nowIsBetween(e,t){e===void 0&&(e=this.dayStartTime-1),t===void 0&&(t=this.dayEndTime+1);let r=this.currentTime;return e<t?r>=e&&r<t:r>=e||r<t}};var d=new q,y=new Q,re=new N,Ce=new M;var Me="__nqtr-activity__",f=class extends pixiVn.StoredClassModel{constructor(t,r,n,i=Me){super(i,t);this._onRun=r;this._timeSlot=n.timeSlot,this._dateScheduling=n.dateScheduling;}_timeSlot;get timeSlot(){return this._timeSlot}_dateScheduling;get dateScheduling(){return this._dateScheduling}addTempHistoryItem(){pixiVn.narration.addCurrentStepToHistory();}get run(){return async t=>(this.addTempHistoryItem(),await this._onRun(this,t))}get expired(){return !!(this.dateScheduling?.to&&this.dateScheduling.to<=d.currentDate)}get isActive(){return !(this.dateScheduling?.from&&this.dateScheduling.from>d.currentDate||this.dateScheduling?.to&&this.dateScheduling.to<d.currentDate||!d.nowIsBetween(this.timeSlot?.from,this.timeSlot?.to))}};var O=class extends f{constructor(e,t,r){super(e,t,{dateScheduling:r.dateScheduling,timeSlot:r.timeSlot}),this.defaultName=r.name||"",this.defaultDisabled=r.disabled||false,this.defaultHidden=r.hidden||false,this._icon=r.renderIcon;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}_icon;get icon(){return this._icon}};var Ne="__nqtr-commitment__",v=class extends f{constructor(t,r,n,i,a){i=i||(()=>{});super(t,i,a,Ne);this._characters=r;this._room=n;this.defaultExecutionType=a.executionType||"interaction",this.defaultPriority=a.priority;}defaultExecutionType;defaultPriority;get characters(){return this._characters}get room(){return this._room}get executionType(){return this.getStorageProperty("executionType")||this.defaultExecutionType}set executionType(t){this.setStorageProperty("executionType",t);}get priority(){return this.getStorageProperty("priority")||this.defaultPriority||0}set priority(t){this.setStorageProperty("priority",t);}addTempHistoryItem(){let t=y.currentRoom;if(!t||this.executionType!=="automatic")return super.addTempHistoryItem();let r=ge();switch(r?.type){case "editroom":pixiVn.storage.setVariable(p,r.prev),super.addTempHistoryItem(),pixiVn.storage.setVariable(p,t.id);break;case "edittime":let n=pixiVn.storage.getVariable(l)||{};pixiVn.storage.setVariable(l,r.prev),super.addTempHistoryItem(),pixiVn.storage.setVariable(l,n);break}}};var $=class extends v{constructor(e,t,r,n){super(e,t?Array.isArray(t)?t:[t]:[],r,n.onRun,{executionType:n.executionType,priority:n.priority,timeSlot:n.timeSlot,dateScheduling:n.dateScheduling}),this._name=n.name||"",this._image=n.image,this.defaultDisabled=n.disabled||false,this.defaultHidden=n.hidden||false,this._icon=n.icon;}_name;get name(){return this._name}_image;get image(){return this._image}_icon;get icon(){return this._icon}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){if(this.dateScheduling?.from&&this.dateScheduling.from>d.currentDate||!d.nowIsBetween(this.timeSlot?.from,this.timeSlot?.to)||!this.expired)return true;let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}};var g=class extends pixiVn.StoredClassModel{constructor(t,r,n=[]){super(t,r);this.defaultActivities=n;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let n=this.excludedActivitiesScheduling;delete n[t],this.setStorageProperty("excludedActivitiesScheduling",n);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let n=this.activeActivityScheduling;n[t]=r,this.setStorageProperty("activeActivityScheduling",n);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let n=this.excludedActivitiesScheduling;n[t]=r,this.setStorageProperty("excludedActivitiesScheduling",n);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{timeSlot:n,dateScheduling:i}=r,{to:a=d.dayEndTime+1}=n||{};if(n&&n.from>=a)throw new Error("[NQTR] The from time must be less than the to time.");if(i?.from!==void 0&&i?.to!==void 0&&i?.from>=i?.to)throw new Error("[NQTR] The from day/date must be less than the to day/date.");if(this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;u.includes(t.id)?console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`):(u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u)),this.excludedActivitiesIds.includes(t.id)&&(this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`)),(n||i)&&this.editActivityScheduling(t.id,{timeSlot:n,dateScheduling:i});}removeActivity(t,r={}){let{to:n}=r,i=typeof t=="string"?t:t.id,a=this.additionalActivitiesIds;if(a.includes(i)){if(n!==void 0){this.editExcludedActivityScheduling(i,{dateScheduling:{to:n}});return}a=a.filter(u=>u!==i),this.setStorageProperty("additionalActivitiesIds",a),this.removeActivityScheduling(i);}else if(this.defaultActivitiesIds.includes(i)){if(n!==void 0){this.editExcludedActivityScheduling(i,{dateScheduling:{to:n}});return}let u=this.excludedActivitiesIds;u.push(i),this.setStorageProperty("excludedActivitiesIds",u);}else console.warn(`[NQTR] Activity with id ${i} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,n=this.additionalActivitiesIds,i=this.excludedActivitiesIds;n.forEach(a=>{if(a in t){let{to:u}=t[a].dateScheduling||{};u&&u<d.currentDate&&(this.removeActivityScheduling(a),n=n.filter(m=>m!==a));}}),i.forEach(a=>{if(a in r){let{to:u}=r[a].dateScheduling||{};u&&u<d.currentDate&&(this.removeActivityScheduling(a),i=i.filter(m=>m!==a));}});}get activities(){let t=[],r=this.activeActivityScheduling;return this.additionalActivitiesIds.concat(this.defaultActivitiesIds).forEach(n=>{let i=D.get(n),{dateScheduling:a,timeSlot:u}=r[n]||{},{from:m=i?.dateScheduling?.from,to:ae=i?.dateScheduling?.to}=a||{},{from:Re=i?.timeSlot?.from,to:_e=i?.timeSlot?.to}=u||{};i&&d.nowIsBetween(Re,_e)&&!(m&&m>d.currentDate)&&!(ae&&ae<d.currentDate)&&t.push(i);}),Object.entries(this.excludedActivitiesScheduling).forEach(([n,i])=>{let a=D.get(n);a&&a.isActive&&!(i.dateScheduling&&i.dateScheduling.to!==void 0&&i.dateScheduling.to>=d.currentDate)&&t.push(a);}),this.defaultActivities.forEach(n=>{n.isActive&&!t.find(i=>i.id===n.id)&&t.push(n);}),t}};var Oe="__nqtr-location__",I=class extends g{constructor(t,r,n=[]){super(Oe,t,n);this._map=r;}get map(){return this._map}get rooms(){return y.rooms.filter(t=>t.location.id===this.id)}};var B=class extends I{constructor(e,t,r={}){super(e,t,r.activities||[]),this.defaultName=r.name||"",this.defaultDisabled=r.disabled||false,this.defaultHidden=r.hidden||false,this._icon=r.icon;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}_icon;get icon(){return this._icon}};var Le="__nqtr-map__",x=class extends g{constructor(e,t=[]){super(Le,e,t);}get locations(){return y.locations.filter(e=>e.map.id===this.id)}};var k=class extends x{constructor(e,t={}){super(e,t.activities||[]),this.defaultName=t.name||"",this._image=t.image;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}_image;get image(){return this._image}};var $e="__nqtr-room__",R=class extends g{constructor(t,r,n=[]){super($e,t,n);this._location=r;}get routine(){return re.currentRoutine.filter(t=>t.room.id===this.id)}get location(){return this._location}get characters(){let t=[];return this.routine.forEach(r=>{t.push(...r.characters);}),t}get automaticFunctions(){return this.routine.filter(t=>t.executionType==="automatic"&&t.run).map(t=>async n=>{await t.run(n);})}};var z=class extends R{constructor(e,t,r={}){super(e,t,r.activities||[]),this.defaultName=r.name||"",this._image=r.image,this.defaultDisabled=r.disabled||false,this.defaultHidden=r.hidden||false,this._icon=r.icon;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}_image;get image(){return this._image}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}_icon;get icon(){return this._icon}};var ke="__nqtr-quest__",_=class extends pixiVn.StoredClassModel{constructor(t,r,n={}){super(ke,t);this._stages=r;this._onStart=n.onStart,this._onNextStage=n.onNextStage;}get stages(){return this._stages}get currentStageIndex(){return this.getStorageProperty("currentStageIndex")}set currentStageIndex(t){this.setStorageProperty("currentStageIndex",t);}get currentStage(){let t=this.currentStageIndex;if(!(t===void 0||t>=this.stages.length))return this.stages[t]}get started(){return this.currentStageIndex!==void 0}get completed(){return this.currentStageIndex===void 0?false:this.currentStageIndex>this.stages.length-1}get inProgress(){return this.completed||this.failed?false:this.started}get failed(){return this.getStorageProperty("failed")||false}set failed(t){this.setStorageProperty("failed",t);}_onStart;get onStart(){return this._onStart}_onNextStage;get onNextStage(){return this._onNextStage}async start(t){if(this.started){console.warn(`[NQTR] Quest ${this.id} is already started`);return}if(this.stages.length===0){s.error(`Quest ${this.id} has no stages`);return}this.currentStageIndex=0;let r=this.currentStage;if(r&&r.start)return this.onStart&&await this.onStart(this,t),await r.start(t);s.error(`Quest ${this.id} has no start stage`);}async tryToGoNextStage(t){if(!this.inProgress)return false;let r=this.currentStage;return r?r.completed?await this.goNextStage(t):false:(s.error(`Quest ${this.id} has no current stage`),false)}async completeCurrentStageAndGoNext(t){let r=this.currentStage;return r?(r.completed=true,await this.goNextStage(t)):(s.error(`Quest ${this.id} has no current stage`),false)}async goNextStage(t){if(!this.inProgress)return console.warn(`[NQTR] Quest ${this.id} is not in progress`),false;let r=this.currentStage,n=this.currentStageIndex;if(!r||n===void 0)return s.error(`Quest ${this.id} has no current stage`),false;this.currentStageIndex=n+1,this.onNextStage&&await this.onNextStage(this,t),r&&r.onEnd&&await r.onEnd(r,t);let i=this.currentStage;return i&&(i.inizialize(),this.currentStageMustStart&&await this.startCurrentStage(t)),true}get currentStageMustStart(){let t=this.currentStage;return t?!t.started&&t.canStart&&!t.completed:false}async startCurrentStage(t){let r=this.currentStage;r&&this.currentStageMustStart?await r.start(t):console.warn(`[NQTR] Quest ${this.id} can't start the current stage`);}};var Y=class extends _{constructor(e,t,r){super(e,t,{onStart:r.onStart,onNextStage:r.onNextStage}),this._name=r.name||"",this._description=r.description||"",this._icon=r.icon,this._image=r.image,this._inDevelopment=r.inDevelopment||false;}_name;get name(){return this._name}_description;get description(){return this._description}_icon;get icon(){return this._icon}_image;get image(){return this._image}_inDevelopment;get inDevelopment(){return this._inDevelopment}};var Ye="__nqtr-stage__",T=class extends pixiVn.StoredClassModel{constructor(e,t={}){super(Ye,e),this._onStart=t.onStart,this._onEnd=t.onEnd,this._deltaDateRequired=t.deltaDateRequired,this._questsRequired=t.questsRequired||[];}_onStart;get onStart(){return this._onStart}_onEnd;get onEnd(){return this._onEnd}get completed(){return this.getStorageProperty("completed")||false}set completed(e){this.setStorageProperty("completed",e);}get started(){return this.getStorageProperty("started")||false}set started(e){this.setStorageProperty("started",e);}get inizializeDate(){return this.getStorageProperty("inizializeDate")}set inizializeDate(e){this.setStorageProperty("inizializeDate",e);}get startDate(){let e=this.inizializeDate;if(e!==void 0)return e+this.deltaDateRequired}get canStart(){let e=this.deltaDateRequired;if(e>0){let t=this.inizializeDate;if(t===void 0||t+e>d.currentDate)return false}return !(this.questsRequired.length>0&&!this.questsRequired.every(t=>t.quest.currentStageIndex&&t.quest.currentStageIndex>=t.stageNumber))}inizialize(){this.deltaDateRequired>0&&(this.inizializeDate=d.currentDate,console.log(`[NQTR] Stage ${this.id} will start on date ${this.startDate}`));}async start(e){this.canStart?(this.started=true,this.onStart&&await this.onStart(this,e)):console.warn(`[NQTR] Stage ${this.id} can't start`);}_deltaDateRequired;get deltaDateRequired(){return this._deltaDateRequired||0}_questsRequired;get questsRequired(){return this._questsRequired||[]}};var F=class extends T{constructor(e,t){super(e,{onStart:t.onStart,onEnd:t.onEnd,deltaDateRequired:t.deltaDateRequired,questsRequired:t.questsRequired}),this._name=t.name||"",this._flags=t.flags||[],this._description=t.description||"",this._adviceDescription=t.adviceDescription||"",this._image=t.image,this._flagsRequired=t.flagsRequired||[],this._requestDescriptionToStart=t.requestDescriptionToStart||"";}_name;get name(){return this._name}_description;get description(){return this._description}_adviceDescription;get adviceDescription(){return this._adviceDescription}_image;get image(){return this._image}_flags;get flags(){return this._flags}_flagsRequired;get flagsRequired(){return this._flagsRequired}_requestDescriptionToStart;get requestDescriptionToStart(){return this._requestDescriptionToStart}get completed(){return super.completed?true:this.flags.length>0?!!this.flags.every(e=>pixiVn.storage.getFlag(e.flag)):false}set completed(e){super.completed=e;}get canStart(){return this.flagsRequired.length>0&&!this.flagsRequired.every(e=>pixiVn.storage.getFlag(e.flag))?false:super.canStart}};var Ie={};var xe={};var Fe={...ne,...ee,...Ie,...ie,...xe},ai=Fe;exports.ActivityBaseModel=O;exports.ActivityStoredClass=f;exports.CommitmentBaseModel=$;exports.CommitmentStoredClass=v;exports.LocationBaseModel=B;exports.LocationStoredClass=I;exports.MapBaseModel=k;exports.MapStoredClass=x;exports.QuestBaseModel=Y;exports.QuestStoredClass=_;exports.RegisteredActivities=D;exports.RegisteredCommitments=h;exports.RegisteredLocations=A;exports.RegisteredMaps=E;exports.RegisteredQuests=C;exports.RegisteredRooms=S;exports.RoomBaseModel=z;exports.RoomStoredClass=R;exports.StageBaseModel=F;exports.StageStoredClass=T;exports.default=ai;exports.navigator=y;exports.questsNotebook=Ce;exports.routine=re;exports.timeTracker=d;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var pixiVn=require('@drincs/pixi-vn');var Te=Object.defineProperty;var X=(o,e)=>{for(var t in e)Te(o,t,{get:e[t],enumerable:true});};var ne={};X(ne,{ActivityBaseModel:()=>q,ActivityStoredClass:()=>f,CommitmentBaseModel:()=>$,CommitmentStoredClass:()=>v,LocationBaseModel:()=>B,LocationStoredClass:()=>I,MapBaseModel:()=>k,MapStoredClass:()=>x,QuestBaseModel:()=>Y,QuestStoredClass:()=>_,RoomBaseModel:()=>z,RoomStoredClass:()=>R,StageBaseModel:()=>F,StageStoredClass:()=>T});var ie={};X(ie,{navigator:()=>y,questsNotebook:()=>Ce,routine:()=>re,timeTracker:()=>d});var l="___nqtr-time_manager_data___",p="___nqtr-current_room_memory___",Z="___nqtr-last_event_memory___";var ee={};X(ee,{RegisteredActivities:()=>D,RegisteredCommitments:()=>h,RegisteredLocations:()=>A,RegisteredMaps:()=>E,RegisteredQuests:()=>C,RegisteredRooms:()=>S});var s;(n=>(n.log=(i,...a)=>console.log(`[NQTR] ${i}`,...a),n.warn=(i,...a)=>console.warn(`[NQTR] ${i}`,...a),n.error=(i,...a)=>console.error(`[NQTR] ${i}`,...a),n.info=(i,...a)=>console.info(`[NQTR] ${i}`,...a)))(s||={});var V=new pixiVn.CachedMap({cacheSize:20}),oe;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>n.add(a));return}V.set(i.id,i);}n.add=o;function e(i){try{let a=V.get(i);if(!a){console.warn(`[NQTR] Activity ${i} not found, you should register it first`);return}return a}catch(a){s.error(`Error while getting Activity ${i}`,a);return}}n.get=e;function t(){return Array.from(V.values())}n.values=t;function r(i){return V.has(i)}n.has=r;})(oe||={});var D=oe;var b=new pixiVn.CachedMap({cacheSize:20}),H=new pixiVn.CachedMap({cacheSize:20}),ue;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>n.add(a));return}b.set(i.id,i);}n.add=o;function e(i){try{let a=b.get(i);if(!a){console.warn(`[NQTR] Commitment ${i} not found, you should register it first`);return}return a}catch(a){s.error(`Error while getting Commitment ${i}`,a);return}}n.get=e;function t(){return Array.from(b.values())}n.values=t;function r(i){return b.has(i)}n.has=r;})(ue||={});var h=ue;var G=new pixiVn.CachedMap({cacheSize:20}),de;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>o(a));return}G.set(i.id,i);}n.add=o;function e(i){try{let a=G.get(i);if(!a){console.warn(`[NQTR] Location ${i} not found, you should register it first`);return}return a}catch(a){s.error(`Error while getting Location ${i}`,a);return}}n.get=e;function t(){return Array.from(G.values())}n.values=t;function r(i){return G.has(i)}n.has=r;})(de||={});var A=de;var K=new pixiVn.CachedMap({cacheSize:20}),ce;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>o(a));return}K.set(i.id,i);}n.add=o;function e(i){try{let a=K.get(i);if(!a){console.warn(`[NQTR] Map ${i} not found, you should register it first`);return}return a}catch(a){s.error(`Error while getting Map ${i}`,a);return}}n.get=e;function t(){return Array.from(K.values())}n.values=t;function r(i){return K.has(i)}n.has=r;})(ce||={});var E=ce;var W=new pixiVn.CachedMap({cacheSize:5}),le;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>n.add(a));return}W.set(i.id,i);}n.add=o;function e(i){try{let a=W.get(i);if(!a){console.warn(`[NQTR] Quest ${i} not found, you should register it first`);return}return a}catch(a){s.error(`Error while getting Quest ${i}`,a);return}}n.get=e;function t(){return Array.from(W.values())}n.values=t;function r(i){return W.has(i)}n.has=r;})(le||={});var C=le;var U=new pixiVn.CachedMap({cacheSize:20}),me;(n=>{function o(i){if(Array.isArray(i)){i.forEach(m=>o(m));return}U.set(i.id,i);let a=i.location;A.add(a);let u=a?.map;u&&E.add(u);}n.add=o;function e(i){try{let a=U.get(i);if(!a){console.warn(`[NQTR] Room ${i} not found, you should register it first`);return}return a}catch(a){s.error(`Error while getting Room ${i}`,a);return}}n.get=e;function t(){return Array.from(U.values())}n.values=t;function r(i){return U.has(i)}n.has=r;})(me||={});var S=me;function w(o){pixiVn.storage.setVariable(Z,o);}function ge(){return pixiVn.storage.getVariable(Z)}var N=class{get rooms(){return S.values()}get locations(){return A.values()}get maps(){return E.values()}get currentRoomId(){return pixiVn.storage.getVariable(p)}get currentRoom(){let e=this.currentRoomId;if(!e){s.error("The current room has not yet been set");return}let t=S.get(e);if(!t){s.error(`Current room ${e} not found`);return}return t}set currentRoom(e){if(typeof e!="string"&&(e=e.id),!S.get(e)){s.error(`The room ${e} is not registered, so it can't be set as current room`);return}let r=pixiVn.storage.getVariable(p);r!==e&&(w({type:"editroom",prev:r,value:e}),pixiVn.storage.setVariable(p,e));}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){S.values().forEach(e=>{e.clearExpiredActivities();});}};var M=class{get quests(){return C.values()}get startedQuests(){return this.quests.filter(e=>e.started)}get inProgressQuests(){return this.quests.filter(e=>e.inProgress)}get completedQuests(){return this.quests.filter(e=>e.completed)}get failedQuests(){return this.quests.filter(e=>e.failed)}get notStartedQuests(){return this.quests.filter(e=>!e.started)}find(e){return C.get(e)}async startsStageMustBeStarted(e){let t=this.quests.map(r=>r.currentStageMustStart?r.startCurrentStage(e):Promise.resolve());await Promise.all(t);}};var J="___nqtr-temporary_commitment___",Q=class{get fixedRoutine(){return [...H.values()]}set fixedRoutine(e){e.forEach(t=>{H.has(t.id)&&console.warn(`[NQTR] Commitment id ${t.id} already exists, it will be overwritten`),H.set(t.id,t);});}get temporaryRoutine(){let e=pixiVn.storage.getVariable(J);return e?e.map(r=>h.get(r)).filter(r=>r!==void 0):[]}get allRoutine(){return [...this.fixedRoutine,...this.temporaryRoutine]}add(e){Array.isArray(e)||(e=[e]);let t=e.map(r=>{if(!h.get(r.id)){console.warn(`[NQTR] Commitment ${r.id} not found, it will be ignored`);return}return r.id}).filter(r=>r!==void 0);pixiVn.storage.setVariable(J,t);}find(e){return h.get(e)}remove(e){Array.isArray(e)||(e=[e]);let t=e.map(n=>n.id),r=pixiVn.storage.getVariable(J);r&&(r=r.filter(n=>!t.includes(n)),pixiVn.storage.setVariable(J,r));}clearExpiredRoutine(){h.values().forEach(e=>{e.expired&&b.delete(e.id);});}get currentRoutine(){let e={};return [...this.fixedRoutine,...this.temporaryRoutine].forEach(t=>{t.isActive&&(t.characters.length>0?t.characters.every(n=>!e[n.id]||t.priority>e[n.id].priority)&&t.characters.forEach(n=>{e[n.id]=t;}):s.error(`The commitment ${t.id} has no characters assigned`));}),Object.values(e)}getCommitmentByCharacter(e){this.currentRoutine.forEach(t=>{if(t.characters.map(r=>r.id).includes(e.id))return t});}};var c=class{static dayStartTime=0;static dayEndTime=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static getDayName};var O=class{initialize(e){let{dayStartTime:t=0,dayEndTime:r=24,defaultTimeSpent:n=1,timeSlots:i=[],weekLength:a=7,weekendStartDay:u=a-1,getDayName:m}=e;c.dayStartTime=t,c.dayEndTime=r,c.defaultTimeSpent=n,c.timeSlots=i,c.weekLength=a,u>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${a}, so will be ignored`):c.weekendStartDay=u,c.getDayName=m;}get dayStartTime(){return c.dayStartTime}get dayEndTime(){return c.dayEndTime}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get getDayName(){return c.getDayName}get currentTime(){let e=pixiVn.storage.getVariable(l)||{};return e.hasOwnProperty("currentTime")&&typeof e.currentTime=="number"?e.currentTime:this.dayStartTime}set currentTime(e){let t=pixiVn.storage.getVariable(l)||{},r={...t};typeof e=="number"?r.currentTime=e:delete r.currentTime,w({type:"edittime",prev:t,value:r}),pixiVn.storage.setVariable(l,r);}get currentDate(){let e=pixiVn.storage.getVariable(l)||{};return e.hasOwnProperty("currentDate")&&typeof e.currentDate=="number"?e.currentDate:0}set currentDate(e){let t=pixiVn.storage.getVariable(l)||{},r={...t};typeof e=="number"?r.currentDate=e:delete r.currentDate,w({type:"edittime",prev:t,value:r}),pixiVn.storage.setVariable(l,r);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDate%this.weekLength+1}get currentDayName(){return this.getDayName?this.getDayName(this.currentWeekDayNumber-1):(console.warn("[NQTR] Week days names are not defined, so currentDayName will be empty"),"")}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startTime,this.timeSlots[e+1].startTime))return e}return this.timeSlots.length-1}increaseTime(e=this.defaultTimeSpent){let t=this.currentTime+e;return t>=this.dayEndTime&&(this.increaseDate(),t=this.dayStartTime+(t-this.dayEndTime)),this.currentTime=t,this.currentTime}increaseDate(e=1,t=this.dayStartTime){let r=this.currentDate+e;return this.currentDate=r,this.currentTime=t,this.currentDate}nowIsBetween(e,t){e===void 0&&(e=this.dayStartTime-1),t===void 0&&(t=this.dayEndTime+1);let r=this.currentTime;return e<t?r>=e&&r<t:r>=e||r<t}};var d=new O,y=new N,re=new Q,Ce=new M;var Me="__nqtr-activity__",f=class extends pixiVn.StoredClassModel{constructor(t,r,n,i=Me){super(i,t);this._onRun=r;this._timeSlot=n.timeSlot,this._dateScheduling=n.dateScheduling;}_timeSlot;get timeSlot(){return this._timeSlot}_dateScheduling;get dateScheduling(){return this._dateScheduling}addTempHistoryItem(){pixiVn.narration.addCurrentStepToHistory();}get run(){return async t=>(this.addTempHistoryItem(),await this._onRun(this,t))}get expired(){return !!(this.dateScheduling?.to&&this.dateScheduling.to<=d.currentDate)}get isActive(){return !(this.dateScheduling?.from&&this.dateScheduling.from>d.currentDate||this.dateScheduling?.to&&this.dateScheduling.to<d.currentDate||!d.nowIsBetween(this.timeSlot?.from,this.timeSlot?.to))}};var q=class extends f{constructor(e,t,r){super(e,t,{dateScheduling:r.dateScheduling,timeSlot:r.timeSlot}),this.defaultName=r.name||"",this.defaultDisabled=r.disabled||false,this.defaultHidden=r.hidden||false,this._icon=r.renderIcon;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}_icon;get icon(){return this._icon}};var Qe="__nqtr-commitment__",v=class extends f{constructor(t,r,n,i,a){i=i||(()=>{});super(t,i,a,Qe);this._characters=r;this._room=n;this.defaultExecutionType=a.executionType||"interaction",this.defaultPriority=a.priority;}defaultExecutionType;defaultPriority;get characters(){return this._characters}get room(){return this._room}get executionType(){return this.getStorageProperty("executionType")||this.defaultExecutionType}set executionType(t){this.setStorageProperty("executionType",t);}get priority(){return this.getStorageProperty("priority")||this.defaultPriority||0}set priority(t){this.setStorageProperty("priority",t);}addTempHistoryItem(){let t=y.currentRoom;if(!t||this.executionType!=="automatic")return super.addTempHistoryItem();let r=ge();switch(r?.type){case "editroom":pixiVn.storage.setVariable(p,r.prev),super.addTempHistoryItem(),pixiVn.storage.setVariable(p,t.id);break;case "edittime":let n=pixiVn.storage.getVariable(l)||{};pixiVn.storage.setVariable(l,r.prev),super.addTempHistoryItem(),pixiVn.storage.setVariable(l,n);break}}};var $=class extends v{constructor(e,t,r,n){super(e,t?Array.isArray(t)?t:[t]:[],r,n.onRun,{executionType:n.executionType,priority:n.priority,timeSlot:n.timeSlot,dateScheduling:n.dateScheduling}),this._name=n.name||"",this._image=n.image,this.defaultDisabled=n.disabled||false,this.defaultHidden=n.hidden||false,this._icon=n.icon;}_name;get name(){return this._name}_image;get image(){return this._image}_icon;get icon(){return this._icon}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){if(this.dateScheduling?.from&&this.dateScheduling.from>d.currentDate||!d.nowIsBetween(this.timeSlot?.from,this.timeSlot?.to)||!this.expired)return true;let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}};var g=class extends pixiVn.StoredClassModel{constructor(t,r,n=[]){super(t,r);this.defaultActivities=n;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let n=this.excludedActivitiesScheduling;delete n[t],this.setStorageProperty("excludedActivitiesScheduling",n);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let n=this.activeActivityScheduling;n[t]=r,this.setStorageProperty("activeActivityScheduling",n);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let n=this.excludedActivitiesScheduling;n[t]=r,this.setStorageProperty("excludedActivitiesScheduling",n);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}get activitiesIds(){return this.additionalActivitiesIds.concat(this.defaultActivitiesIds)}addActivity(t,r={}){let{timeSlot:n,dateScheduling:i}=r,{to:a=d.dayEndTime+1}=n||{};if(n&&n.from>=a)throw new Error("[NQTR] The from time must be less than the to time.");if(i?.from!==void 0&&i?.to!==void 0&&i?.from>=i?.to)throw new Error("[NQTR] The from day/date must be less than the to day/date.");if(this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;u.includes(t.id)?console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`):(u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u)),this.excludedActivitiesIds.includes(t.id)&&(this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`)),(n||i)&&this.editActivityScheduling(t.id,{timeSlot:n,dateScheduling:i});}removeActivity(t,r={}){let{to:n}=r,i=typeof t=="string"?t:t.id,a=this.additionalActivitiesIds;if(a.includes(i)){if(n!==void 0){this.editExcludedActivityScheduling(i,{dateScheduling:{to:n}});return}a=a.filter(u=>u!==i),this.setStorageProperty("additionalActivitiesIds",a),this.removeActivityScheduling(i);}else if(this.defaultActivitiesIds.includes(i)){if(n!==void 0){this.editExcludedActivityScheduling(i,{dateScheduling:{to:n}});return}let u=this.excludedActivitiesIds;u.push(i),this.setStorageProperty("excludedActivitiesIds",u);}else console.warn(`[NQTR] Activity with id ${i} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,n=this.additionalActivitiesIds,i=this.excludedActivitiesIds;n.forEach(a=>{if(a in t){let{to:u}=t[a].dateScheduling||{};u&&u<d.currentDate&&(this.removeActivityScheduling(a),n=n.filter(m=>m!==a));}}),i.forEach(a=>{if(a in r){let{to:u}=r[a].dateScheduling||{};u&&u<d.currentDate&&(this.removeActivityScheduling(a),i=i.filter(m=>m!==a));}});}get activities(){let t=[],r=this.activeActivityScheduling;return this.additionalActivitiesIds.concat(this.defaultActivitiesIds).forEach(n=>{let i=D.get(n),{dateScheduling:a,timeSlot:u}=r[n]||{},{from:m=i?.dateScheduling?.from,to:ae=i?.dateScheduling?.to}=a||{},{from:Re=i?.timeSlot?.from,to:_e=i?.timeSlot?.to}=u||{};i&&d.nowIsBetween(Re,_e)&&!(m&&m>d.currentDate)&&!(ae&&ae<d.currentDate)&&t.push(i);}),Object.entries(this.excludedActivitiesScheduling).forEach(([n,i])=>{let a=D.get(n);a&&a.isActive&&!(i.dateScheduling&&i.dateScheduling.to!==void 0&&i.dateScheduling.to>=d.currentDate)&&t.push(a);}),this.defaultActivities.forEach(n=>{n.isActive&&!t.find(i=>i.id===n.id)&&t.push(n);}),t}};var qe="__nqtr-location__",I=class extends g{constructor(t,r,n=[]){super(qe,t,n);this._map=r;}get map(){return this._map}get rooms(){return y.rooms.filter(t=>t.location.id===this.id)}};var B=class extends I{constructor(e,t,r={}){super(e,t,r.activities||[]),this.defaultName=r.name||"",this.defaultDisabled=r.disabled||false,this.defaultHidden=r.hidden||false,this._icon=r.icon;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}_icon;get icon(){return this._icon}};var Le="__nqtr-map__",x=class extends g{constructor(e,t=[]){super(Le,e,t);}get locations(){return y.locations.filter(e=>e.map.id===this.id)}};var k=class extends x{constructor(e,t={}){super(e,t.activities||[]),this.defaultName=t.name||"",this._image=t.image;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}_image;get image(){return this._image}};var $e="__nqtr-room__",R=class extends g{constructor(t,r,n=[]){super($e,t,n);this._location=r;}get routine(){return re.currentRoutine.filter(t=>t.room.id===this.id)}get location(){return this._location}get characters(){let t=[];return this.routine.forEach(r=>{t.push(...r.characters);}),t}get automaticFunctions(){return this.routine.filter(t=>t.executionType==="automatic"&&t.run).map(t=>async n=>{await t.run(n);})}};var z=class extends R{constructor(e,t,r={}){super(e,t,r.activities||[]),this.defaultName=r.name||"",this._image=r.image,this.defaultDisabled=r.disabled||false,this.defaultHidden=r.hidden||false,this._icon=r.icon;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}_image;get image(){return this._image}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}_icon;get icon(){return this._icon}};var ke="__nqtr-quest__",_=class extends pixiVn.StoredClassModel{constructor(t,r,n={}){super(ke,t);this._stages=r;this._onStart=n.onStart,this._onNextStage=n.onNextStage;}get stages(){return this._stages}get currentStageIndex(){return this.getStorageProperty("currentStageIndex")}set currentStageIndex(t){this.setStorageProperty("currentStageIndex",t);}get currentStage(){let t=this.currentStageIndex;if(!(t===void 0||t>=this.stages.length))return this.stages[t]}get started(){return this.currentStageIndex!==void 0}get completed(){return this.currentStageIndex===void 0?false:this.currentStageIndex>this.stages.length-1}get inProgress(){return this.completed||this.failed?false:this.started}get failed(){return this.getStorageProperty("failed")||false}set failed(t){this.setStorageProperty("failed",t);}_onStart;get onStart(){return this._onStart}_onNextStage;get onNextStage(){return this._onNextStage}async start(t){if(this.started){console.warn(`[NQTR] Quest ${this.id} is already started`);return}if(this.stages.length===0){s.error(`Quest ${this.id} has no stages`);return}this.currentStageIndex=0;let r=this.currentStage;if(r&&r.start)return this.onStart&&await this.onStart(this,t),await r.start(t);s.error(`Quest ${this.id} has no start stage`);}tryToGoNextStage(t){return this.goNextIfCompleted(t)}async goNextIfCompleted(t){if(!this.inProgress)return false;let r=this.currentStage;return r?r.completed?await this.forceGoNext(t):false:(s.error(`Quest ${this.id} has no current stage`),false)}completeCurrentStageAndGoNext(t){return this.goNext(t)}async goNext(t){let r=this.currentStage;return r?(r.completed=true,await this.forceGoNext(t)):(s.error(`Quest ${this.id} has no current stage`),false)}goNextStage(t){return this.forceGoNext(t)}async forceGoNext(t){if(!this.inProgress)return console.warn(`[NQTR] Quest ${this.id} is not in progress`),false;let r=this.currentStage,n=this.currentStageIndex;if(!r||n===void 0)return s.error(`Quest ${this.id} has no current stage`),false;this.currentStageIndex=n+1,this.onNextStage&&await this.onNextStage(this,t),r&&r.onEnd&&await r.onEnd(r,t);let i=this.currentStage;return i&&(i.inizialize(),this.currentStageMustStart&&await this.startCurrentStage(t)),true}get currentStageMustStart(){let t=this.currentStage;return t?!t.started&&t.canStart&&!t.completed:false}async startCurrentStage(t){let r=this.currentStage;r&&this.currentStageMustStart?await r.start(t):console.warn(`[NQTR] Quest ${this.id} can't start the current stage`);}};var Y=class extends _{constructor(e,t,r){super(e,t,{onStart:r.onStart,onNextStage:r.onNextStage}),this._name=r.name||"",this._description=r.description||"",this._icon=r.icon,this._image=r.image,this._inDevelopment=r.inDevelopment||false;}_name;get name(){return this._name}_description;get description(){return this._description}_icon;get icon(){return this._icon}_image;get image(){return this._image}_inDevelopment;get inDevelopment(){return this._inDevelopment}};var Ye="__nqtr-stage__",T=class extends pixiVn.StoredClassModel{constructor(e,t={}){super(Ye,e),this._onStart=t.onStart,this._onEnd=t.onEnd,this._deltaDateRequired=t.deltaDateRequired,this._questsRequired=t.questsRequired||[];}_onStart;get onStart(){return this._onStart}_onEnd;get onEnd(){return this._onEnd}get completed(){return this.getStorageProperty("completed")||false}set completed(e){this.setStorageProperty("completed",e);}get started(){return this.getStorageProperty("started")||false}set started(e){this.setStorageProperty("started",e);}get inizializeDate(){return this.getStorageProperty("inizializeDate")}set inizializeDate(e){this.setStorageProperty("inizializeDate",e);}get startDate(){let e=this.inizializeDate;if(e!==void 0)return e+this.deltaDateRequired}get canStart(){let e=this.deltaDateRequired;if(e>0){let t=this.inizializeDate;if(t===void 0||t+e>d.currentDate)return false}return !(this.questsRequired.length>0&&!this.questsRequired.every(t=>t.quest.currentStageIndex&&t.quest.currentStageIndex>=t.stageNumber))}inizialize(){this.deltaDateRequired>0&&(this.inizializeDate=d.currentDate,console.log(`[NQTR] Stage ${this.id} will start on date ${this.startDate}`));}async start(e){this.canStart?(this.started=true,this.onStart&&await this.onStart(this,e)):console.warn(`[NQTR] Stage ${this.id} can't start`);}_deltaDateRequired;get deltaDateRequired(){return this._deltaDateRequired||0}_questsRequired;get questsRequired(){return this._questsRequired||[]}};var F=class extends T{constructor(e,t){super(e,{onStart:t.onStart,onEnd:t.onEnd,deltaDateRequired:t.deltaDateRequired,questsRequired:t.questsRequired}),this._name=t.name||"",this._flags=t.flags||[],this._description=t.description||"",this._adviceDescription=t.adviceDescription||"",this._image=t.image,this._flagsRequired=t.flagsRequired||[],this._requestDescriptionToStart=t.requestDescriptionToStart||"";}_name;get name(){return this._name}_description;get description(){return this._description}_adviceDescription;get adviceDescription(){return this._adviceDescription}_image;get image(){return this._image}_flags;get flags(){return this._flags}_flagsRequired;get flagsRequired(){return this._flagsRequired}_requestDescriptionToStart;get requestDescriptionToStart(){return this._requestDescriptionToStart}get completed(){return super.completed?true:this.flags.length>0?!!this.flags.every(e=>pixiVn.storage.getFlag(e.flag)):false}set completed(e){super.completed=e;}get canStart(){return this.flagsRequired.length>0&&!this.flagsRequired.every(e=>pixiVn.storage.getFlag(e.flag))?false:super.canStart}};var Ie={};var xe={};var Fe={...ne,...ee,...Ie,...ie,...xe},ai=Fe;exports.ActivityBaseModel=q;exports.ActivityStoredClass=f;exports.CommitmentBaseModel=$;exports.CommitmentStoredClass=v;exports.LocationBaseModel=B;exports.LocationStoredClass=I;exports.MapBaseModel=k;exports.MapStoredClass=x;exports.QuestBaseModel=Y;exports.QuestStoredClass=_;exports.RegisteredActivities=D;exports.RegisteredCommitments=h;exports.RegisteredLocations=A;exports.RegisteredMaps=E;exports.RegisteredQuests=C;exports.RegisteredRooms=S;exports.RoomBaseModel=z;exports.RoomStoredClass=R;exports.StageBaseModel=F;exports.StageStoredClass=T;exports.default=ai;exports.navigator=y;exports.questsNotebook=Ce;exports.routine=re;exports.timeTracker=d;//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map