@drincs/nqtr 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/{RoomInterface-BglEhkQT.d.ts → RoomInterface-CdAM_q7P.d.ts} +4 -0
  2. package/dist/{RoomInterface-DsZAp6Pv.d.mts → RoomInterface-DURfkQ7u.d.mts} +4 -0
  3. package/dist/{StageInterface-DJ7l0ubG.d.mts → StageInterface-DX74DUxG.d.mts} +1 -1
  4. package/dist/{StageInterface-DJ7l0ubG.d.ts → StageInterface-DX74DUxG.d.ts} +1 -1
  5. package/dist/classes/ActivityBaseModel.js +1 -1
  6. package/dist/classes/ActivityBaseModel.js.map +1 -1
  7. package/dist/classes/ActivityBaseModel.mjs +1 -1
  8. package/dist/classes/ActivityBaseModel.mjs.map +1 -1
  9. package/dist/classes/ActivityStoredClass.js +1 -1
  10. package/dist/classes/ActivityStoredClass.js.map +1 -1
  11. package/dist/classes/ActivityStoredClass.mjs +1 -1
  12. package/dist/classes/ActivityStoredClass.mjs.map +1 -1
  13. package/dist/classes/CommitmentBaseModel.d.mts +1 -1
  14. package/dist/classes/CommitmentBaseModel.d.ts +1 -1
  15. package/dist/classes/CommitmentBaseModel.js +1 -1
  16. package/dist/classes/CommitmentBaseModel.js.map +1 -1
  17. package/dist/classes/CommitmentBaseModel.mjs +1 -1
  18. package/dist/classes/CommitmentBaseModel.mjs.map +1 -1
  19. package/dist/classes/CommitmentStoredClass.d.mts +1 -1
  20. package/dist/classes/CommitmentStoredClass.d.ts +1 -1
  21. package/dist/classes/CommitmentStoredClass.js +1 -1
  22. package/dist/classes/CommitmentStoredClass.js.map +1 -1
  23. package/dist/classes/CommitmentStoredClass.mjs +1 -1
  24. package/dist/classes/CommitmentStoredClass.mjs.map +1 -1
  25. package/dist/classes/index.d.mts +2 -2
  26. package/dist/classes/index.d.ts +2 -2
  27. package/dist/classes/index.js +1 -1
  28. package/dist/classes/index.js.map +1 -1
  29. package/dist/classes/index.mjs +1 -1
  30. package/dist/classes/index.mjs.map +1 -1
  31. package/dist/classes/navigation/LocationBaseModel.d.mts +1 -1
  32. package/dist/classes/navigation/LocationBaseModel.d.ts +1 -1
  33. package/dist/classes/navigation/LocationBaseModel.js +1 -1
  34. package/dist/classes/navigation/LocationBaseModel.js.map +1 -1
  35. package/dist/classes/navigation/LocationBaseModel.mjs +1 -1
  36. package/dist/classes/navigation/LocationBaseModel.mjs.map +1 -1
  37. package/dist/classes/navigation/LocationStoredClass.d.mts +1 -1
  38. package/dist/classes/navigation/LocationStoredClass.d.ts +1 -1
  39. package/dist/classes/navigation/LocationStoredClass.js +1 -1
  40. package/dist/classes/navigation/LocationStoredClass.js.map +1 -1
  41. package/dist/classes/navigation/LocationStoredClass.mjs +1 -1
  42. package/dist/classes/navigation/LocationStoredClass.mjs.map +1 -1
  43. package/dist/classes/navigation/MapBaseModel.d.mts +1 -1
  44. package/dist/classes/navigation/MapBaseModel.d.ts +1 -1
  45. package/dist/classes/navigation/MapBaseModel.js +1 -1
  46. package/dist/classes/navigation/MapBaseModel.js.map +1 -1
  47. package/dist/classes/navigation/MapBaseModel.mjs +1 -1
  48. package/dist/classes/navigation/MapBaseModel.mjs.map +1 -1
  49. package/dist/classes/navigation/MapStoredClass.d.mts +1 -1
  50. package/dist/classes/navigation/MapStoredClass.d.ts +1 -1
  51. package/dist/classes/navigation/MapStoredClass.js +1 -1
  52. package/dist/classes/navigation/MapStoredClass.js.map +1 -1
  53. package/dist/classes/navigation/MapStoredClass.mjs +1 -1
  54. package/dist/classes/navigation/MapStoredClass.mjs.map +1 -1
  55. package/dist/classes/navigation/NavigationAbstractClass.js +1 -1
  56. package/dist/classes/navigation/NavigationAbstractClass.js.map +1 -1
  57. package/dist/classes/navigation/NavigationAbstractClass.mjs +1 -1
  58. package/dist/classes/navigation/NavigationAbstractClass.mjs.map +1 -1
  59. package/dist/classes/navigation/RoomBaseModel.d.mts +1 -1
  60. package/dist/classes/navigation/RoomBaseModel.d.ts +1 -1
  61. package/dist/classes/navigation/RoomBaseModel.js +1 -1
  62. package/dist/classes/navigation/RoomBaseModel.js.map +1 -1
  63. package/dist/classes/navigation/RoomBaseModel.mjs +1 -1
  64. package/dist/classes/navigation/RoomBaseModel.mjs.map +1 -1
  65. package/dist/classes/navigation/RoomStoredClass.d.mts +3 -2
  66. package/dist/classes/navigation/RoomStoredClass.d.ts +3 -2
  67. package/dist/classes/navigation/RoomStoredClass.js +1 -1
  68. package/dist/classes/navigation/RoomStoredClass.js.map +1 -1
  69. package/dist/classes/navigation/RoomStoredClass.mjs +1 -1
  70. package/dist/classes/navigation/RoomStoredClass.mjs.map +1 -1
  71. package/dist/classes/quest/QuestBaseModel.d.mts +1 -1
  72. package/dist/classes/quest/QuestBaseModel.d.ts +1 -1
  73. package/dist/classes/quest/QuestStoredClass.d.mts +1 -1
  74. package/dist/classes/quest/QuestStoredClass.d.ts +1 -1
  75. package/dist/classes/quest/StageBaseModel.d.mts +1 -1
  76. package/dist/classes/quest/StageBaseModel.d.ts +1 -1
  77. package/dist/classes/quest/StageBaseModel.js +1 -1
  78. package/dist/classes/quest/StageBaseModel.js.map +1 -1
  79. package/dist/classes/quest/StageBaseModel.mjs +1 -1
  80. package/dist/classes/quest/StageBaseModel.mjs.map +1 -1
  81. package/dist/classes/quest/StageStoredClass.d.mts +1 -1
  82. package/dist/classes/quest/StageStoredClass.d.ts +1 -1
  83. package/dist/classes/quest/StageStoredClass.js +1 -1
  84. package/dist/classes/quest/StageStoredClass.js.map +1 -1
  85. package/dist/classes/quest/StageStoredClass.mjs +1 -1
  86. package/dist/classes/quest/StageStoredClass.mjs.map +1 -1
  87. package/dist/decorators/CommitmentDecorator.d.mts +1 -1
  88. package/dist/decorators/CommitmentDecorator.d.ts +1 -1
  89. package/dist/decorators/QuestDecorator.d.mts +1 -1
  90. package/dist/decorators/QuestDecorator.d.ts +1 -1
  91. package/dist/decorators/RoomDecorator.d.mts +1 -1
  92. package/dist/decorators/RoomDecorator.d.ts +1 -1
  93. package/dist/decorators/index.d.mts +2 -2
  94. package/dist/decorators/index.d.ts +2 -2
  95. package/dist/index.d.mts +2 -2
  96. package/dist/index.d.ts +2 -2
  97. package/dist/index.js +1 -1
  98. package/dist/index.js.map +1 -1
  99. package/dist/index.mjs +1 -1
  100. package/dist/index.mjs.map +1 -1
  101. package/dist/interface/ActivityInterface.d.mts +1 -1
  102. package/dist/interface/ActivityInterface.d.ts +1 -1
  103. package/dist/interface/CommitmentInterface.d.mts +1 -1
  104. package/dist/interface/CommitmentInterface.d.ts +1 -1
  105. package/dist/interface/CommitmentProps.d.mts +1 -1
  106. package/dist/interface/CommitmentProps.d.ts +1 -1
  107. package/dist/interface/index.d.mts +2 -2
  108. package/dist/interface/index.d.ts +2 -2
  109. package/dist/interface/navigation/LocationInterface.d.mts +1 -1
  110. package/dist/interface/navigation/LocationInterface.d.ts +1 -1
  111. package/dist/interface/navigation/MapInterface.d.mts +1 -1
  112. package/dist/interface/navigation/MapInterface.d.ts +1 -1
  113. package/dist/interface/navigation/RoomInterface.d.mts +2 -2
  114. package/dist/interface/navigation/RoomInterface.d.ts +2 -2
  115. package/dist/interface/quest/QuestInterface.d.mts +1 -1
  116. package/dist/interface/quest/QuestInterface.d.ts +1 -1
  117. package/dist/interface/quest/QuestProps.d.mts +1 -1
  118. package/dist/interface/quest/QuestProps.d.ts +1 -1
  119. package/dist/interface/quest/StageInterface.d.mts +1 -1
  120. package/dist/interface/quest/StageInterface.d.ts +1 -1
  121. package/dist/interface/quest/StageProps.d.mts +1 -1
  122. package/dist/interface/quest/StageProps.d.ts +1 -1
  123. package/dist/managers/NavigatorManager.d.mts +2 -2
  124. package/dist/managers/NavigatorManager.d.ts +2 -2
  125. package/dist/managers/NavigatorManager.js +1 -1
  126. package/dist/managers/NavigatorManager.js.map +1 -1
  127. package/dist/managers/NavigatorManager.mjs +1 -1
  128. package/dist/managers/NavigatorManager.mjs.map +1 -1
  129. package/dist/managers/QuestManager.d.mts +1 -1
  130. package/dist/managers/QuestManager.d.ts +1 -1
  131. package/dist/managers/RoutineManager.d.mts +1 -1
  132. package/dist/managers/RoutineManager.d.ts +1 -1
  133. package/dist/managers/RoutineManager.js +1 -1
  134. package/dist/managers/RoutineManager.js.map +1 -1
  135. package/dist/managers/RoutineManager.mjs +1 -1
  136. package/dist/managers/RoutineManager.mjs.map +1 -1
  137. package/dist/managers/TimeManager.js +1 -1
  138. package/dist/managers/TimeManager.js.map +1 -1
  139. package/dist/managers/TimeManager.mjs +1 -1
  140. package/dist/managers/TimeManager.mjs.map +1 -1
  141. package/dist/managers/index.d.mts +2 -2
  142. package/dist/managers/index.d.ts +2 -2
  143. package/dist/managers/index.js +1 -1
  144. package/dist/managers/index.js.map +1 -1
  145. package/dist/managers/index.mjs +1 -1
  146. package/dist/managers/index.mjs.map +1 -1
  147. package/dist/types/QuestsRequired.d.mts +1 -1
  148. package/dist/types/QuestsRequired.d.ts +1 -1
  149. package/dist/types/index.d.mts +1 -1
  150. package/dist/types/index.d.ts +1 -1
  151. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/decorators/RoomDecorator.ts","../../../src/managers/NavigatorManager.ts","../../../src/decorators/CommitmentDecorator.ts","../../../src/managers/RoutineManager.ts","../../../src/constants.ts","../../../src/managers/TimeManagerSettings.ts","../../../src/managers/TimeManager.ts","../../../src/managers/index.ts","../../../src/decorators/ActivityDecorator.ts","../../../src/classes/navigation/NavigationAbstractClass.ts","../../../src/classes/navigation/RoomStoredClass.ts"],"names":["registeredRooms","getRoomById","id","room","CURRENT_ROOM_MEMORY_KEY","NavigatorManager","result","roomId","storage","_","registeredCommitments","fixedCommitments","getCommitmentById","commitment","TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY","RoutineManager","commitments","c","commitmentsIds","currentCommitments","character_commitments","ch","navigator","character","TIME_DATA_KEY","TimeManagerSettings","TimeManager","settings","minDayHours","maxDayHours","defaultTimeSpent","timeSlots","weekLength","weekendStartDay","weekDaysNames","data","value","weekDayNumber","index","slot","timeSpent","newHour","newDayHour","days","newDay","fromHour","toHour","currentHour","timeTracker","routine","registeredActivities","getActivityById","activity","NavigationAbstractClass","StoredClassModel","categoryId","defaultActivities","activityId","activeActivityScheduling","excludedActivitiesScheduling","scheduling","options","hours","fromDay","toDay","additionalActivitiesIds","excludedActivitiesIds","res","ROOM_CATEGORY","RoomStoredClass","_location","activities"],"mappings":"uDAEO,IAAMA,CAAAA,CAAmD,EA2BzD,CAAA,SAASC,CAAYC,CAAAA,CAAAA,CAAuC,CAClE,GAAI,CACH,IAAIC,CAAAA,CAAOH,CAAgBE,CAAAA,CAAE,CAC7B,CAAA,GAAI,CAACC,CAAAA,CAAM,CACV,OAAA,CAAQ,KAAM,CAAA,CAAA,YAAA,EAAeD,CAAE,CAAA,UAAA,CAAY,EAC3C,MACD,CACA,OAAOC,CACR,CAAS,MAAA,CAAA,CAAG,CACX,OAAQ,CAAA,KAAA,CAAM,CAAmCD,gCAAAA,EAAAA,CAAE,CAAI,CAAA,CAAA,CAAC,EACxD,MACD,CACD,CCrCA,IAAME,CAA0B,CAAA,gCAAA,CACXC,CAArB,CAAA,KAAsC,CACrC,IAAI,KAAQ,EAAA,CACX,OAAO,MAAA,CAAO,OAAOL,CAAe,CACrC,CACA,IAAI,SAAY,EAAA,CACf,IAAIM,CAA8C,CAAA,EAClD,CAAA,OAAA,MAAA,CAAO,MAAON,CAAAA,CAAe,EAAE,OAASG,CAAAA,CAAAA,EAAS,CAChDG,CAAAA,CAAOH,CAAK,CAAA,QAAA,CAAS,EAAE,CAAA,CAAIA,CAAK,CAAA,SACjC,CAAC,CAAA,CACM,MAAO,CAAA,MAAA,CAAOG,CAAM,CAC5B,CACA,IAAI,IAAA,EAAO,CACV,IAAIA,EAAyC,EAAC,CAC9C,OAAO,MAAA,CAAA,MAAA,CAAON,CAAe,CAAA,CAAE,QAASG,CAAS,EAAA,CAChDG,CAAOH,CAAAA,CAAAA,CAAK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AAC,CAACK,CAAYG,CAAAA,CAAU,CAAM,GAAA,CACpF,IAAIR,CAAAA,CAAWD,CAAgBM,CAAAA,CAAU,CACrCL,CAAAA,CAAAA,EAAYA,CAAS,CAAA,QAAA,EAAY,EAAEQ,CAAAA,CAAW,OAASA,CAAW,CAAA,KAAA,EAASZ,CAAY,CAAA,UAAA,CAAA,EACvFmB,CAAI,CAAA,IAAA,CAAKf,CAAQ,EAEzB,CAAC,CACMe,CAAAA,CACX,CACJ,CAAA,KCxNMC,CAAgB,CAAA,eAAA,CACDC,CAArB,CAAA,cAA6ChB,CAA6D,CACzG,WACCnD,CAAAA,CAAAA,CAIiBoE,CACjBC,CAAAA,CAAAA,CAAkC,EAAC,CAClC,CACD,KAAA,CAAMH,EAAelE,CAAIqE,CAAAA,CAAU,CAHlB,CAAA,IAAA,CAAA,SAAA,CAAAD,EAIlB,CACA,IAAI,OAAA,EAAiC,CACpC,OAAOrB,CAAQ,CAAA,cAAA,CAAe,MAAQhC,CAAAA,CAAAA,EAAMA,EAAE,IAAK,CAAA,EAAA,GAAO,IAAK,CAAA,EAAE,CAClE,CAEA,IAAI,QAAA,EAA8B,CACjC,OAAO,IAAK,CAAA,SACb,CACD","file":"RoomStoredClass.mjs","sourcesContent":["import { RoomInterface } from \"../interface\";\n\nexport const registeredRooms: { [id: string]: RoomInterface } = {};\n\n/**\n * Save a room in the registered rooms. If the room already exists, it will be overwritten.\n * @param room The room to save.\n * @returns\n * @example\n * ```ts\n * saveRoom([mcRoom, aliceRoom, annRoom, bathroom, lounge, terrace, gymRoom]);\n * ```\n */\nexport function saveRoom(room: RoomInterface | RoomInterface[]) {\n\tif (Array.isArray(room)) {\n\t\troom.forEach((c) => saveRoom(c));\n\t\treturn;\n\t}\n\tif (registeredRooms[room.id]) {\n\t\tconsole.warn(`[NQTR] Room id ${room.id} already exists, it will be overwritten`);\n\t}\n\tregisteredRooms[room.id] = room;\n}\n\n/**\n * Get a room by its id.\n * @param id The id of the room.\n * @returns The room or undefined if not found.\n */\nexport function getRoomById(id: string): RoomInterface | undefined {\n\ttry {\n\t\tlet room = registeredRooms[id];\n\t\tif (!room) {\n\t\t\tconsole.error(`[NQTR] Room ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn room;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Room ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { getRoomById, registeredRooms } from \"../decorators/RoomDecorator\";\nimport { LocationInterface, MapInterface, RoomInterface } from \"../interface\";\n\nconst CURRENT_ROOM_MEMORY_KEY = \"___nqtr-current_room_memory___\";\nexport default class NavigatorManager {\n\tget rooms() {\n\t\treturn Object.values(registeredRooms);\n\t}\n\tget locations() {\n\t\tlet result: { [id: string]: LocationInterface } = {};\n\t\tObject.values(registeredRooms).forEach((room) => {\n\t\t\tresult[room.location.id] = room.location;\n\t\t});\n\t\treturn Object.values(result);\n\t}\n\tget maps() {\n\t\tlet result: { [id: string]: MapInterface } = {};\n\t\tObject.values(registeredRooms).forEach((room) => {\n\t\t\tresult[room.location.map.id] = room.location.map;\n\t\t});\n\t\treturn Object.values(result);\n\t}\n\tget currentRoom(): RoomInterface | undefined {\n\t\tlet roomId = storage.getVariable<string>(CURRENT_ROOM_MEMORY_KEY);\n\t\tif (!roomId) {\n\t\t\tconsole.error(`[NQTR] The current room has not yet been set`);\n\t\t\treturn;\n\t\t}\n\t\tlet room = getRoomById(roomId);\n\t\tif (!room) {\n\t\t\tconsole.error(`[NQTR] Current room ${roomId} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn room;\n\t}\n\tset currentRoom(room: RoomInterface) {\n\t\tlet roomRegistrated = getRoomById(room.id);\n\t\tif (!roomRegistrated) {\n\t\t\tconsole.error(`[NQTR] The room ${room.id} is not registered, so it can't be set as current room`);\n\t\t\treturn;\n\t\t}\n\t\tstorage.setVariable(CURRENT_ROOM_MEMORY_KEY, room.id);\n\t}\n\tget currentLocation(): LocationInterface | undefined {\n\t\treturn this.currentRoom?.location;\n\t}\n\tget currentMap(): MapInterface | undefined {\n\t\treturn this.currentRoom?.location.map;\n\t}\n\t/**\n\t * Clear all the expired activities.\n\t */\n\tclearExpiredActivities() {\n\t\tObject.entries(registeredRooms).forEach(([_, room]) => {\n\t\t\troom.clearExpiredActivities();\n\t\t});\n\t}\n}\n","import { CommitmentInterface } from \"../interface\";\n\nexport const registeredCommitments: { [id: string]: CommitmentInterface } = {};\nexport const fixedCommitments: { [id: string]: CommitmentInterface } = {};\n\n/**\n * Save a commitment in the registered commitments. If the commitment already exists, it will be overwritten.\n * @param commitment The commitment or commitments to save.\n * @returns\n */\nexport function saveCommitment(commitment: CommitmentInterface | CommitmentInterface[]) {\n\tif (Array.isArray(commitment)) {\n\t\tcommitment.forEach((c) => saveCommitment(c));\n\t\treturn;\n\t}\n\tif (registeredCommitments[commitment.id]) {\n\t\tconsole.warn(`[NQTR] Commitment id ${commitment.id} already exists, it will be overwritten`);\n\t}\n\tregisteredCommitments[commitment.id] = commitment;\n}\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 */\nexport function getCommitmentById(id: string): CommitmentInterface | undefined {\n\ttry {\n\t\tlet commitment = registeredCommitments[id];\n\t\tif (!commitment) {\n\t\t\tconsole.error(`[NQTR] Commitment ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn commitment;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Commitment ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { CharacterInterface, storage } from \"@drincs/pixi-vn\";\nimport { navigator } from \".\";\nimport { fixedCommitments, getCommitmentById, registeredCommitments } from \"../decorators/CommitmentDecorator\";\nimport { CommitmentInterface } from \"../interface\";\n\nconst TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY = \"___nqtr-temporary_commitment___\";\nexport default class RoutineManager {\n\tget fixedRoutine(): CommitmentInterface[] {\n\t\treturn Object.values(fixedCommitments);\n\t}\n\t/**\n\t * Set a commitment as fixed, it will be always available. They cannot be deleted or edit during the game session.\n\t */\n\tset fixedRoutine(commitments: CommitmentInterface[]) {\n\t\tcommitments.forEach((c) => {\n\t\t\tif (fixedCommitments[c.id]) {\n\t\t\t\tconsole.warn(`[NQTR] Commitment id ${c.id} already exists, it will be overwritten`);\n\t\t\t}\n\t\t\tfixedCommitments[c.id] = c;\n\t\t});\n\t}\n\n\t/**\n\t * Get the temporary commitments by its id.\n\t * @returns The temporary commitments.\n\t */\n\tget temporaryRoutine(): CommitmentInterface[] {\n\t\tlet commitmentsIds = storage.getVariable<string[]>(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY);\n\t\tif (!commitmentsIds) {\n\t\t\treturn [];\n\t\t}\n\t\tlet commitments = commitmentsIds\n\t\t\t.map((id) => getCommitmentById(id))\n\t\t\t.filter((commitment) => commitment !== undefined);\n\t\treturn commitments;\n\t}\n\n\tget allRoutine(): CommitmentInterface[] {\n\t\treturn [...this.fixedRoutine, ...this.temporaryRoutine];\n\t}\n\n\t/**\n\t * This feature adds the commitments during the game session.\n\t * @param commitment The commitment or commitments to add.\n\t */\n\tadd(commitment: CommitmentInterface[] | CommitmentInterface) {\n\t\tif (!Array.isArray(commitment)) {\n\t\t\tcommitment = [commitment];\n\t\t}\n\t\tlet commitmentsIds = commitment\n\t\t\t.map((commitment) => {\n\t\t\t\tlet commitmentTest = getCommitmentById(commitment.id);\n\t\t\t\tif (!commitmentTest) {\n\t\t\t\t\tconsole.warn(`[NQTR] Commitment ${commitment.id} not found, it will be ignored`);\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn commitment.id;\n\t\t\t})\n\t\t\t.filter((id) => id !== undefined);\n\n\t\tstorage.setVariable(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY, commitmentsIds);\n\t}\n\n\t/**\n\t * Get the commitments added during the game session.\n\t * @param id The id of the commitment.\n\t * @returns The commitment or undefined if not found.\n\t */\n\tfind(id: string): CommitmentInterface | undefined {\n\t\treturn getCommitmentById(id);\n\t}\n\n\t/**\n\t * Remove the commitments added during the game session.\n\t * @param commitment The commitment or commitments to remove.\n\t */\n\tremove(commitment: CommitmentInterface[] | CommitmentInterface) {\n\t\tif (!Array.isArray(commitment)) {\n\t\t\tcommitment = [commitment];\n\t\t}\n\t\tlet commitmentsIds = commitment.map((commitment) => {\n\t\t\treturn commitment.id;\n\t\t});\n\n\t\tlet currentCommitments = storage.getVariable<string[]>(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY);\n\t\tif (!currentCommitments) {\n\t\t\treturn;\n\t\t}\n\t\tcurrentCommitments = currentCommitments.filter((id) => !commitmentsIds.includes(id));\n\t\tstorage.setVariable(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY, currentCommitments);\n\t}\n\n\t/**\n\t * Clear all the expired commitments.\n\t */\n\tclearExpiredRoutine() {\n\t\tObject.values(registeredCommitments).forEach((commitment) => {\n\t\t\tif (commitment.expired) {\n\t\t\t\tdelete registeredCommitments[commitment.id];\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Get the current commitments. The hidden commitments are not included.\n\t * In case there is a character who has two or more commitments at the same time, will be selected the commitment with the highest priority.\n\t * Higher priority commitments are calculated using the following steps:\n\t * 1. The commitments that have Commitments BaseModel.priority set to a higher value will be selected first.\n\t * 2. If there are commitments with the same priority, the commitments that are not fixed will be selected first.\n\t * 3. If there are commitments with the same priority and the same fixed status, priority will be given to the commitment with a lower index.\n\t * @returns The current commitments.\n\t */\n\tget currentRoutine(): CommitmentInterface[] {\n\t\tlet character_commitments: { [character: string]: CommitmentInterface } = {};\n\t\t[...this.temporaryRoutine, ...this.fixedRoutine].reverse().forEach((c) => {\n\t\t\tif (c.isActive) {\n\t\t\t\tif (c.characters.length > 0) {\n\t\t\t\t\t// all the characters don't already have commitments or the commitment has a higher priority\n\t\t\t\t\tlet allAvailable = c.characters.every(\n\t\t\t\t\t\t(ch) => !character_commitments[ch.id] || c.priority > character_commitments[ch.id].priority\n\t\t\t\t\t);\n\t\t\t\t\tif (allAvailable) {\n\t\t\t\t\t\tc.characters.forEach((ch) => {\n\t\t\t\t\t\t\tcharacter_commitments[ch.id] = c;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(`[NQTR] The commitment ${c.id} has no characters assigned`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn Object.values(character_commitments);\n\t}\n\n\tget currentRoomRoutine(): CommitmentInterface[] {\n\t\treturn navigator.currentRoom?.routine || [];\n\t}\n\n\t/**\n\t * Get the character commitment.\n\t * @param character The character.\n\t * @returns The commitment or undefined if not found.\n\t */\n\tgetCommitmentByCharacter(character: CharacterInterface): CommitmentInterface | undefined {\n\t\tthis.currentRoutine.forEach((c) => {\n\t\t\tif (c.characters.map((ch) => ch.id).includes(character.id)) {\n\t\t\t\treturn c;\n\t\t\t}\n\t\t});\n\t\treturn undefined;\n\t}\n}\n","export const TIME_SETTINGS_KEY = '___nqtr-time_manager_settings___';\nexport const TIME_DATA_KEY = '___nqtr-time_manager_data___';\n\n","import { ITimeStlot, TimeSettings } from \"../types/TimeSettings\";\n\nexport default class TimeManagerSettings implements TimeSettings {\n static minDayHours: number = 0\n static maxDayHours: number = 24\n static defaultTimeSpent: number = 1\n static timeSlots: ITimeStlot[] = []\n static weekLength: number = 7\n static weekendStartDay: number = this.weekLength - 1\n static weekDaysNames: string[] = []\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { TIME_DATA_KEY } from \"../constants\";\nimport TimeDataType from \"../types/TimeDataType\";\nimport { ITimeStlot, TimeSettings } from \"../types/TimeSettings\";\nimport TimeManagerSettings from \"./TimeManagerSettings\";\n\nexport default class TimeManager {\n initialize(settings: TimeSettings) {\n const {\n minDayHours = 0,\n maxDayHours = 24,\n defaultTimeSpent = 1,\n timeSlots = [],\n weekLength = 7,\n weekendStartDay = weekLength - 1,\n weekDaysNames = [],\n } = settings\n TimeManagerSettings.minDayHours = minDayHours\n TimeManagerSettings.maxDayHours = maxDayHours\n TimeManagerSettings.defaultTimeSpent = defaultTimeSpent\n TimeManagerSettings.timeSlots = timeSlots\n TimeManagerSettings.weekLength = weekLength\n if (weekendStartDay >= TimeManagerSettings.weekLength) {\n console.warn(`[NQTR] Weekend start day should be less than week length ${weekLength}, so will be ignored`)\n }\n else {\n TimeManagerSettings.weekendStartDay = weekendStartDay\n }\n if (weekDaysNames.length !== weekLength) {\n console.warn(`[NQTR] Week days names should be equal to week length ${weekLength}, so will be ignored`)\n }\n else {\n TimeManagerSettings.weekDaysNames = weekDaysNames\n }\n }\n get minDayHours(): number {\n return TimeManagerSettings.minDayHours\n }\n get maxDayHours(): number {\n return TimeManagerSettings.maxDayHours\n }\n get defaultTimeSpent(): number {\n return TimeManagerSettings.defaultTimeSpent\n }\n get timeSlots(): ITimeStlot[] {\n return TimeManagerSettings.timeSlots\n }\n get weekLength(): number {\n return TimeManagerSettings.weekLength\n }\n get weekendStartDay(): number {\n return TimeManagerSettings.weekendStartDay\n }\n get weekDaysNames(): string[] {\n return TimeManagerSettings.weekDaysNames\n }\n\n /**\n * Get the current hour\n */\n get currentHour(): number {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {}\n if (data.hasOwnProperty('currentHour') && typeof data.currentHour === 'number') {\n return data.currentHour\n }\n return this.minDayHours\n }\n set currentHour(value: number | undefined) {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {}\n if (typeof value === 'number') {\n data.currentHour = value\n } else {\n delete data.currentHour\n }\n storage.setVariable(TIME_DATA_KEY, data)\n }\n /**\n * Get the current day\n */\n get currentDay(): number {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {}\n if (data.hasOwnProperty('currentDay') && typeof data.currentDay === 'number') {\n return data.currentDay\n }\n return 0\n }\n set currentDay(value: number | undefined) {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {}\n if (typeof value === 'number') {\n data.currentDay = value\n }\n else {\n delete data.currentDay\n }\n storage.setVariable(TIME_DATA_KEY, data)\n }\n /**\n * If the current day is greater than or equal to the weekend start day, then it will return true.\n */\n get isWeekend(): boolean {\n return this.currentWeekDayNumber >= this.weekendStartDay\n }\n /**\n * Get the current week day number (1 - {@link weekLength}).\n * For example, if the week length is 7 and the current day is 10, then the result will be 4.\n */\n get currentWeekDayNumber(): number {\n let result = this.currentDay % this.weekLength\n return result + 1\n }\n /**\n * Get the current week day name. If the week days names are not defined, then it will return undefined.\n * For example, if the week days names are ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] and the current day is 10, then the result will be 'Thursday'.\n * @default \"\"\n */\n get currentDayName(): string {\n let weekDayNumber = this.currentWeekDayNumber - 1\n if (weekDayNumber >= this.weekDaysNames.length) {\n console.warn(`[NQTR] Week day name is not defined for day ${weekDayNumber}`, this.weekDaysNames)\n return \"\"\n }\n return this.weekDaysNames[weekDayNumber]\n }\n /**\n * Get the current {@link timeSlots} index.\n * You can use this property to create \"Image that changes based on the time period\":\n * @example\n * ```tsx\n * import { weekLength } from '@drincs/nqtr';\n * \n * function changeBackground() {\n * return (\n * <img src={`background-currentTimeSlot.currentTimeSlot.png`} />\n * )\n * }\n */\n get currentTimeSlot(): number {\n if (this.timeSlots.length === 0) {\n console.warn('[NQTR] Time slots are not defined')\n return 0\n }\n for (let index = 0; index < this.timeSlots.length; index++) {\n let slot = this.timeSlots[index]\n if (this.timeSlots.length > index + 1) {\n if (this.nowIsBetween(slot.startHour, this.timeSlots[index + 1].startHour)) {\n return index\n }\n }\n }\n return this.timeSlots.length - 1\n }\n\n /**\n * This function will increase the current hour by the given time spent.\n * If the new hour is greater than or equal to the max day hours, then it will increase the day and set the new hour.\n * @param timeSpent is the time spent in hours (default: {@link defaultTimeSpent})\n * @returns currentTimeSlot.currentHour\n */\n increaseHour(timeSpent: number = this.defaultTimeSpent): number {\n let newHour = this.currentHour + timeSpent\n if (newHour >= this.maxDayHours) {\n this.increaseDay()\n newHour = this.minDayHours + (newHour - this.maxDayHours)\n }\n this.currentHour = newHour\n return this.currentHour\n }\n\n /**\n * This function will increase the current day by the given days.\n * @param newDayHour is the hour of the new day (default: {@link minDayHours})\n * @param days is the number of days to increase (default: 1)\n * @returns timeTracker.currentDay\n */\n increaseDay(newDayHour: number = this.minDayHours, days: number = 1): number {\n let newDay = this.currentDay + days\n this.currentDay = newDay\n this.currentHour = newDayHour\n return this.currentDay\n }\n\n /**\n * This function will check if the current hour is between the given hours.\n * @param fromHour the starting hour. If the {@link currentHour} is equal to this hour, the function will return true.\n * @param toHour the ending hour.\n * @returns true if the current hour is between the given hours, otherwise false.\n */\n nowIsBetween(fromHour: number | undefined, toHour: number | undefined): boolean {\n if (fromHour === undefined) {\n fromHour = this.minDayHours\n }\n if (toHour === undefined) {\n toHour = this.maxDayHours\n }\n let currentHour = this.currentHour\n if (fromHour < toHour) {\n return currentHour >= fromHour && currentHour < toHour\n }\n return currentHour >= fromHour || currentHour < toHour\n }\n}\n","import NavigatorManager from \"./NavigatorManager\";\nimport QuestManager from \"./QuestManager\";\nimport RoutineManager from \"./RoutineManager\";\nimport { default as TimeManager } from \"./TimeManager\";\n\nconst timeTracker = new TimeManager();\nconst navigator = new NavigatorManager();\nconst routine = new RoutineManager();\nconst questsNotebook = new QuestManager();\n\nexport { navigator, questsNotebook, routine, timeTracker };\n","import { ActivityInterface } from \"../interface\"\n\nexport const registeredActivities: { [id: string]: ActivityInterface } = {}\n\nexport function saveActivity(activities: ActivityInterface | ActivityInterface[]) {\n if (Array.isArray(activities)) {\n activities.forEach(activity => {\n registeredActivities[activity.id] = activity\n })\n return\n }\n registeredActivities[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 */\nexport function getActivityById(id: string): ActivityInterface | undefined {\n try {\n let activity = registeredActivities[id]\n if (!activity) {\n console.error(`[NQTR] Activity ${id} not found`)\n return\n }\n return activity\n }\n catch (e) {\n console.error(`[NQTR] Error while getting Activity ${id}`, e)\n return\n }\n}\n","import { StoredClassModel } from \"@drincs/pixi-vn\";\nimport { getActivityById } from \"../../decorators\";\nimport { ActivityInterface } from \"../../interface\";\nimport NavigationAbstractInterface from \"../../interface/navigation/NavigationAbstractClass\";\nimport { timeTracker } from \"../../managers\";\n\ntype ActiveScheduling = {\n fromHour?: number;\n toHour?: number;\n fromDay?: number;\n toDay?: number;\n};\ntype ExcludedScheduling = {\n toDay?: number;\n};\n\nexport default abstract class NavigationAbstractClass extends StoredClassModel implements NavigationAbstractInterface {\n constructor(categoryId: string, id: string, private defaultActivities: ActivityInterface[] = []) {\n super(categoryId, id);\n }\n private get defaultActivitiesIds(): string[] {\n return this.defaultActivities.map((activity) => activity.id);\n }\n private get activeActivityScheduling(): { [activityId: string]: ActiveScheduling } {\n return this.getStorageProperty<{ [activityId: string]: ActiveScheduling }>(`activeActivityScheduling`) || {};\n }\n private get excludedActivitiesScheduling(): { [activityId: string]: ExcludedScheduling } {\n return (\n this.getStorageProperty<{ [activityId: string]: ExcludedScheduling }>(`excludedActivitiesScheduling`) || {}\n );\n }\n private removeActivityScheduling(activityId: string) {\n let activeActivityScheduling = this.activeActivityScheduling;\n delete activeActivityScheduling[activityId];\n this.setStorageProperty(`activeActivityScheduling`, activeActivityScheduling);\n let excludedActivitiesScheduling = this.excludedActivitiesScheduling;\n delete excludedActivitiesScheduling[activityId];\n this.setStorageProperty(`excludedActivitiesScheduling`, excludedActivitiesScheduling);\n }\n private editActivityScheduling(activityId: string, scheduling: ActiveScheduling) {\n this.removeActivityScheduling(activityId);\n let activeActivityScheduling = this.activeActivityScheduling;\n activeActivityScheduling[activityId] = scheduling;\n this.setStorageProperty(`activeActivityScheduling`, activeActivityScheduling);\n }\n private editExcludedActivityScheduling(activityId: string, scheduling: ExcludedScheduling) {\n this.removeActivityScheduling(activityId);\n let excludedActivitiesScheduling = this.excludedActivitiesScheduling;\n excludedActivitiesScheduling[activityId] = scheduling;\n this.setStorageProperty(`excludedActivitiesScheduling`, excludedActivitiesScheduling);\n }\n private get additionalActivitiesIds(): string[] {\n return this.getStorageProperty<string[]>(`additionalActivitiesIds`) || [];\n }\n private get excludedActivitiesIds(): string[] {\n return this.getStorageProperty<string[]>(`excludedActivitiesIds`) || [];\n }\n addActivity(\n activity: ActivityInterface,\n options: {\n /**\n * the activity will be associated with this class only for the specified hours.\n * If you set from 3 and to 5, the activity will be associated with this class only for hours 3, 4 and 5. soSo at 2 or 6 it will not be associated with this class.\n */\n hours?: {\n from: number;\n to: number;\n };\n /**\n * the activity will be associated with this class from the specified day.\n * If you set 3, the activity will be associated with this class from day 3. So at day 2 it will not be associated with this class.\n */\n fromDay?: number;\n /**\n * the activity will be associated with this class to the specified day.\n * If you set 3, the activity will be associated with this class until day 3. So at day 4 it will not be associated with this class.\n */\n toDay?: number;\n } = {}\n ) {\n const { hours, fromDay, toDay } = options;\n let scheduling: ActiveScheduling = {};\n if (hours) {\n if (hours.from >= hours.to) {\n throw new Error(`[NQTR] The from hour must be less than the to hour.`);\n }\n scheduling.fromHour = hours.from;\n }\n if (fromDay === 0) {\n console.warn(`[NQTR] The from day must be greater than 0, so it will be ignored.`);\n }\n if (toDay === 0) {\n console.warn(`[NQTR] The to day must be greater than 0, so it will be ignored.`);\n }\n if (fromDay && toDay && fromDay >= toDay) {\n throw new Error(`[NQTR] The from day must be less than the to day.`);\n }\n if (fromDay) {\n scheduling.fromDay = fromDay;\n }\n if (toDay) {\n scheduling.toDay = toDay;\n }\n\n if (this.defaultActivitiesIds.includes(activity.id)) {\n console.warn(`[NQTR] Activity with id ${activity.id} already exists, so it will be ignored.`);\n return;\n }\n let additionalActivitiesIds = this.additionalActivitiesIds;\n if (additionalActivitiesIds.includes(activity.id)) {\n if (Object.keys(scheduling).length) {\n this.editActivityScheduling(activity.id, scheduling);\n return;\n } else if (this.excludedActivitiesIds.includes(activity.id)) {\n this.removeActivityScheduling(activity.id);\n console.log(\n `[NQTR] Activity with id ${activity.id} was excluded, so it will be associated with this class again.`\n );\n return;\n }\n console.warn(`[NQTR] Activity with id ${activity.id} already exists, so it will be ignored.`);\n return;\n }\n additionalActivitiesIds.push(activity.id);\n this.setStorageProperty(`additionalActivitiesIds`, additionalActivitiesIds);\n if (Object.keys(scheduling).length) {\n this.editActivityScheduling(activity.id, scheduling);\n }\n }\n removeActivity(\n activity: ActivityInterface,\n options: {\n /**\n * The activity will be excluded from this class only for the specified days.\n * If to 3, the activity will be excluded from this class only for days 1, 2 and 3. So at day 4 it will be associated with this class.\n */\n toDay?: number;\n } = {}\n ) {\n const { toDay } = options;\n let scheduling: ExcludedScheduling = {};\n if (toDay === 0) {\n console.warn(`[NQTR] The to day must be greater than 0, so it will be ignored.`);\n }\n if (toDay) {\n scheduling.toDay = toDay;\n }\n\n let additionalActivitiesIds = this.additionalActivitiesIds;\n if (additionalActivitiesIds.includes(activity.id)) {\n if (Object.keys(scheduling).length) {\n this.editExcludedActivityScheduling(activity.id, scheduling);\n return;\n }\n additionalActivitiesIds = additionalActivitiesIds.filter((id) => id !== activity.id);\n this.setStorageProperty(`additionalActivitiesIds`, additionalActivitiesIds);\n } else if (this.defaultActivitiesIds.includes(activity.id)) {\n if (Object.keys(scheduling).length) {\n this.editExcludedActivityScheduling(activity.id, scheduling);\n return;\n }\n let excludedActivitiesIds = this.excludedActivitiesIds;\n excludedActivitiesIds.push(activity.id);\n this.setStorageProperty(`excludedActivitiesIds`, excludedActivitiesIds);\n } else {\n console.warn(`[NQTR] Activity with id ${activity.id} not found, so it will be ignored.`);\n }\n }\n clearExpiredActivities() {\n let activeActivityScheduling = this.activeActivityScheduling;\n let excludedActivitiesScheduling = this.excludedActivitiesScheduling;\n let additionalActivitiesIds = this.additionalActivitiesIds;\n let excludedActivitiesIds = this.excludedActivitiesIds;\n\n additionalActivitiesIds.forEach((activityId) => {\n if (activityId in activeActivityScheduling) {\n let { toDay } = activeActivityScheduling[activityId];\n if (toDay && toDay < timeTracker.currentDay) {\n this.removeActivityScheduling(activityId);\n additionalActivitiesIds = additionalActivitiesIds.filter((id) => id !== activityId);\n }\n }\n });\n excludedActivitiesIds.forEach((activityId) => {\n if (activityId in excludedActivitiesScheduling) {\n let { toDay } = excludedActivitiesScheduling[activityId];\n if (toDay && toDay < timeTracker.currentDay) {\n this.removeActivityScheduling(activityId);\n excludedActivitiesIds = excludedActivitiesIds.filter((id) => id !== activityId);\n }\n }\n });\n }\n\n get activities(): ActivityInterface[] {\n let res: ActivityInterface[] = [];\n Object.entries(this.activeActivityScheduling).forEach(([activityId, scheduling]) => {\n let activity = getActivityById(activityId);\n const {\n fromDay = activity?.fromDay,\n fromHour = activity?.fromHour,\n toDay = activity?.toDay,\n toHour = activity?.toHour,\n } = scheduling;\n if (\n activity &&\n !(fromHour && toHour && !timeTracker.nowIsBetween(fromHour, toHour)) &&\n !(fromDay && fromDay > timeTracker.currentDay) &&\n !(toDay && toDay < timeTracker.currentDay)\n ) {\n res.push(activity);\n }\n });\n Object.entries(this.excludedActivitiesScheduling).forEach(([activityId, scheduling]) => {\n let activity = getActivityById(activityId);\n if (activity && activity.isActive && !(scheduling.toDay && scheduling.toDay >= timeTracker.currentDay)) {\n res.push(activity);\n }\n });\n return res;\n }\n}\n","import { ActivityInterface, CommitmentInterface, LocationInterface } from \"../../interface\";\nimport { RoomBaseInternalInterface } from \"../../interface/navigation/RoomInterface\";\nimport { routine } from \"../../managers\";\nimport NavigationAbstractClass from \"./NavigationAbstractClass\";\n\nconst ROOM_CATEGORY = \"__nqtr-room__\";\nexport default class RoomStoredClass extends NavigationAbstractClass implements RoomBaseInternalInterface {\n\tconstructor(\n\t\tid: string,\n\t\t/**\n\t\t * The location where the room is.\n\t\t */\n\t\tprivate readonly _location: LocationInterface,\n\t\tactivities: ActivityInterface[] = []\n\t) {\n\t\tsuper(ROOM_CATEGORY, id, activities);\n\t}\n\tget routine(): CommitmentInterface[] {\n\t\treturn routine.currentRoutine.filter((c) => c.room.id === this.id);\n\t}\n\n\tget location(): LocationInterface {\n\t\treturn this._location;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/decorators/RoomDecorator.ts","../../../src/managers/NavigatorManager.ts","../../../src/decorators/CommitmentDecorator.ts","../../../src/managers/RoutineManager.ts","../../../src/constants.ts","../../../src/managers/TimeManagerSettings.ts","../../../src/managers/TimeManager.ts","../../../src/managers/index.ts","../../../src/decorators/ActivityDecorator.ts","../../../src/classes/navigation/NavigationAbstractClass.ts","../../../src/classes/navigation/RoomStoredClass.ts"],"names":["registeredRooms","getRoomById","id","room","CURRENT_ROOM_MEMORY_KEY","NavigatorManager","result","roomId","storage","_","registeredCommitments","fixedCommitments","getCommitmentById","commitment","TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY","RoutineManager","commitments","c","commitmentsIds","currentCommitments","character_commitments","ch","navigator","character","TIME_DATA_KEY","TimeManagerSettings","TimeManager","settings","minDayHours","maxDayHours","defaultTimeSpent","timeSlots","weekLength","weekendStartDay","weekDaysNames","data","value","weekDayNumber","index","slot","timeSpent","newHour","newDayHour","days","newDay","fromHour","toHour","currentHour","timeTracker","routine","registeredActivities","getActivityById","activity","NavigationAbstractClass","StoredClassModel","categoryId","defaultActivities","activityId","activeActivityScheduling","excludedActivitiesScheduling","scheduling","options","hours","fromDay","toDay","additionalActivitiesIds","excludedActivitiesIds","res","a","ROOM_CATEGORY","RoomStoredClass","_location","activities","characters"],"mappings":"uDAEO,IAAMA,CAAAA,CAAmD,EA2BzD,CAAA,SAASC,CAAYC,CAAAA,CAAAA,CAAuC,CAClE,GAAI,CACH,IAAIC,CAAAA,CAAOH,CAAgBE,CAAAA,CAAE,CAC7B,CAAA,GAAI,CAACC,CAAAA,CAAM,CACV,OAAA,CAAQ,KAAM,CAAA,CAAA,YAAA,EAAeD,CAAE,CAAA,UAAA,CAAY,EAC3C,MACD,CACA,OAAOC,CACR,CAAS,MAAA,CAAA,CAAG,CACX,OAAA,CAAQ,KAAM,CAAA,CAAA,gCAA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AOhB,CAAS,CAAA,EAAE,CAC1De,EAAAA,CAAAA,CAAI,KAAKf,CAAQ,EAEzB,CAAC,CAAA,CACMe,CACX,CACJ,CC5NA,CAAA,IAAME,CAAgB,CAAA,eAAA,CACDC,CAArB,CAAA,cAA6CjB,CAA6D,CACtG,YACInD,CAIiBqE,CAAAA,CAAAA,CACjBC,CAAkC,CAAA,EACpC,CAAA,CACE,KAAMH,CAAAA,CAAAA,CAAenE,CAAIsE,CAAAA,CAAU,CAHlB,CAAA,IAAA,CAAA,SAAA,CAAAD,EAIrB,CACA,IAAI,OAAiC,EAAA,CACjC,OAAOtB,CAAAA,CAAQ,cAAe,CAAA,MAAA,CAAQhC,CAAMA,EAAAA,CAAAA,CAAE,IAAK,CAAA,EAAA,GAAO,IAAK,CAAA,EAAE,CACrE,CAEA,IAAI,QAA8B,EAAA,CAC9B,OAAO,IAAA,CAAK,SAChB,CAEA,IAAI,UAAA,EAAmC,CACnC,IAAIwD,CAAmC,CAAA,EACvC,CAAA,OAAA,IAAA,CAAK,QAAQ,OAAS5D,CAAAA,CAAAA,EAAe,CACjC4D,CAAAA,CAAW,IAAK,CAAA,GAAG5D,CAAW,CAAA,UAAU,EAC5C,CAAC,CACM4D,CAAAA,CACX,CACJ","file":"RoomStoredClass.mjs","sourcesContent":["import { RoomInterface } from \"../interface\";\n\nexport const registeredRooms: { [id: string]: RoomInterface } = {};\n\n/**\n * Save a room in the registered rooms. If the room already exists, it will be overwritten.\n * @param room The room to save.\n * @returns\n * @example\n * ```ts\n * saveRoom([mcRoom, aliceRoom, annRoom, bathroom, lounge, terrace, gymRoom]);\n * ```\n */\nexport function saveRoom(room: RoomInterface | RoomInterface[]) {\n\tif (Array.isArray(room)) {\n\t\troom.forEach((c) => saveRoom(c));\n\t\treturn;\n\t}\n\tif (registeredRooms[room.id]) {\n\t\tconsole.warn(`[NQTR] Room id ${room.id} already exists, it will be overwritten`);\n\t}\n\tregisteredRooms[room.id] = room;\n}\n\n/**\n * Get a room by its id.\n * @param id The id of the room.\n * @returns The room or undefined if not found.\n */\nexport function getRoomById(id: string): RoomInterface | undefined {\n\ttry {\n\t\tlet room = registeredRooms[id];\n\t\tif (!room) {\n\t\t\tconsole.error(`[NQTR] Room ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn room;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Room ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { getRoomById, registeredRooms } from \"../decorators/RoomDecorator\";\nimport { LocationInterface, MapInterface, RoomInterface } from \"../interface\";\n\nconst CURRENT_ROOM_MEMORY_KEY = \"___nqtr-current_room_memory___\";\nexport default class NavigatorManager {\n get rooms() {\n return Object.values(registeredRooms);\n }\n get locations() {\n let result: { [id: string]: LocationInterface } = {};\n Object.values(registeredRooms).forEach((room) => {\n result[room.location.id] = room.location;\n });\n return Object.values(result);\n }\n get maps() {\n let result: { [id: string]: MapInterface } = {};\n Object.values(registeredRooms).forEach((room) => {\n result[room.location.map.id] = room.location.map;\n });\n return Object.values(result);\n }\n get currentRoom(): RoomInterface | undefined {\n let roomId = storage.getVariable<string>(CURRENT_ROOM_MEMORY_KEY);\n if (!roomId) {\n console.error(`[NQTR] The current room has not yet been set`);\n return;\n }\n let room = getRoomById(roomId);\n if (!room) {\n console.error(`[NQTR] Current room ${roomId} not found`);\n return;\n }\n return room;\n }\n set currentRoom(room: RoomInterface | string) {\n if (typeof room !== \"string\") {\n room = room.id;\n }\n let roomRegistrated = getRoomById(room);\n if (!roomRegistrated) {\n console.error(`[NQTR] The room ${room} is not registered, so it can't be set as current room`);\n return;\n }\n storage.setVariable(CURRENT_ROOM_MEMORY_KEY, room);\n }\n get currentLocation(): LocationInterface | undefined {\n return this.currentRoom?.location;\n }\n get currentMap(): MapInterface | undefined {\n return this.currentRoom?.location.map;\n }\n /**\n * Clear all the expired activities.\n */\n clearExpiredActivities() {\n Object.entries(registeredRooms).forEach(([_, room]) => {\n room.clearExpiredActivities();\n });\n }\n}\n","import { CommitmentInterface } from \"../interface\";\n\nexport const registeredCommitments: { [id: string]: CommitmentInterface } = {};\nexport const fixedCommitments: { [id: string]: CommitmentInterface } = {};\n\n/**\n * Save a commitment in the registered commitments. If the commitment already exists, it will be overwritten.\n * @param commitment The commitment or commitments to save.\n * @returns\n */\nexport function saveCommitment(commitment: CommitmentInterface | CommitmentInterface[]) {\n\tif (Array.isArray(commitment)) {\n\t\tcommitment.forEach((c) => saveCommitment(c));\n\t\treturn;\n\t}\n\tif (registeredCommitments[commitment.id]) {\n\t\tconsole.warn(`[NQTR] Commitment id ${commitment.id} already exists, it will be overwritten`);\n\t}\n\tregisteredCommitments[commitment.id] = commitment;\n}\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 */\nexport function getCommitmentById(id: string): CommitmentInterface | undefined {\n\ttry {\n\t\tlet commitment = registeredCommitments[id];\n\t\tif (!commitment) {\n\t\t\tconsole.error(`[NQTR] Commitment ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn commitment;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Commitment ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { CharacterInterface, storage } from \"@drincs/pixi-vn\";\nimport { navigator } from \".\";\nimport { fixedCommitments, getCommitmentById, registeredCommitments } from \"../decorators/CommitmentDecorator\";\nimport { CommitmentInterface } from \"../interface\";\n\nconst TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY = \"___nqtr-temporary_commitment___\";\nexport default class RoutineManager {\n\tget fixedRoutine(): CommitmentInterface[] {\n\t\treturn Object.values(fixedCommitments);\n\t}\n\t/**\n\t * Set a commitment as fixed, it will be always available. They cannot be deleted or edit during the game session.\n\t */\n\tset fixedRoutine(commitments: CommitmentInterface[]) {\n\t\tcommitments.forEach((c) => {\n\t\t\tif (fixedCommitments[c.id]) {\n\t\t\t\tconsole.warn(`[NQTR] Commitment id ${c.id} already exists, it will be overwritten`);\n\t\t\t}\n\t\t\tfixedCommitments[c.id] = c;\n\t\t});\n\t}\n\n\t/**\n\t * Get the temporary commitments by its id.\n\t * @returns The temporary commitments.\n\t */\n\tget temporaryRoutine(): CommitmentInterface[] {\n\t\tlet commitmentsIds = storage.getVariable<string[]>(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY);\n\t\tif (!commitmentsIds) {\n\t\t\treturn [];\n\t\t}\n\t\tlet commitments = commitmentsIds\n\t\t\t.map((id) => getCommitmentById(id))\n\t\t\t.filter((commitment) => commitment !== undefined);\n\t\treturn commitments;\n\t}\n\n\tget allRoutine(): CommitmentInterface[] {\n\t\treturn [...this.fixedRoutine, ...this.temporaryRoutine];\n\t}\n\n\t/**\n\t * This feature adds the commitments during the game session.\n\t * @param commitment The commitment or commitments to add.\n\t */\n\tadd(commitment: CommitmentInterface[] | CommitmentInterface) {\n\t\tif (!Array.isArray(commitment)) {\n\t\t\tcommitment = [commitment];\n\t\t}\n\t\tlet commitmentsIds = commitment\n\t\t\t.map((commitment) => {\n\t\t\t\tlet commitmentTest = getCommitmentById(commitment.id);\n\t\t\t\tif (!commitmentTest) {\n\t\t\t\t\tconsole.warn(`[NQTR] Commitment ${commitment.id} not found, it will be ignored`);\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn commitment.id;\n\t\t\t})\n\t\t\t.filter((id) => id !== undefined);\n\n\t\tstorage.setVariable(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY, commitmentsIds);\n\t}\n\n\t/**\n\t * Get the commitments added during the game session.\n\t * @param id The id of the commitment.\n\t * @returns The commitment or undefined if not found.\n\t */\n\tfind(id: string): CommitmentInterface | undefined {\n\t\treturn getCommitmentById(id);\n\t}\n\n\t/**\n\t * Remove the commitments added during the game session.\n\t * @param commitment The commitment or commitments to remove.\n\t */\n\tremove(commitment: CommitmentInterface[] | CommitmentInterface) {\n\t\tif (!Array.isArray(commitment)) {\n\t\t\tcommitment = [commitment];\n\t\t}\n\t\tlet commitmentsIds = commitment.map((commitment) => {\n\t\t\treturn commitment.id;\n\t\t});\n\n\t\tlet currentCommitments = storage.getVariable<string[]>(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY);\n\t\tif (!currentCommitments) {\n\t\t\treturn;\n\t\t}\n\t\tcurrentCommitments = currentCommitments.filter((id) => !commitmentsIds.includes(id));\n\t\tstorage.setVariable(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY, currentCommitments);\n\t}\n\n\t/**\n\t * Clear all the expired commitments.\n\t */\n\tclearExpiredRoutine() {\n\t\tObject.values(registeredCommitments).forEach((commitment) => {\n\t\t\tif (commitment.expired) {\n\t\t\t\tdelete registeredCommitments[commitment.id];\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Get the current commitments. The hidden commitments are not included.\n\t * In case there is a character who has two or more commitments at the same time, will be selected the commitment with the highest priority.\n\t * Higher priority commitments are calculated using the following steps:\n\t * 1. The commitments that have Commitments BaseModel.priority set to a higher value will be selected first.\n\t * 2. If there are commitments with the same priority, the commitments that are not fixed will be selected first.\n\t * 3. If there are commitments with the same priority and the same fixed status, priority will be given to the commitment with a lower index.\n\t * @returns The current commitments.\n\t */\n\tget currentRoutine(): CommitmentInterface[] {\n\t\tlet character_commitments: { [character: string]: CommitmentInterface } = {};\n\t\t[...this.temporaryRoutine, ...this.fixedRoutine].reverse().forEach((c) => {\n\t\t\tif (c.isActive) {\n\t\t\t\tif (c.characters.length > 0) {\n\t\t\t\t\t// all the characters don't already have commitments or the commitment has a higher priority\n\t\t\t\t\tlet allAvailable = c.characters.every(\n\t\t\t\t\t\t(ch) => !character_commitments[ch.id] || c.priority > character_commitments[ch.id].priority\n\t\t\t\t\t);\n\t\t\t\t\tif (allAvailable) {\n\t\t\t\t\t\tc.characters.forEach((ch) => {\n\t\t\t\t\t\t\tcharacter_commitments[ch.id] = c;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(`[NQTR] The commitment ${c.id} has no characters assigned`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn Object.values(character_commitments);\n\t}\n\n\tget currentRoomRoutine(): CommitmentInterface[] {\n\t\treturn navigator.currentRoom?.routine || [];\n\t}\n\n\t/**\n\t * Get the character commitment.\n\t * @param character The character.\n\t * @returns The commitment or undefined if not found.\n\t */\n\tgetCommitmentByCharacter(character: CharacterInterface): CommitmentInterface | undefined {\n\t\tthis.currentRoutine.forEach((c) => {\n\t\t\tif (c.characters.map((ch) => ch.id).includes(character.id)) {\n\t\t\t\treturn c;\n\t\t\t}\n\t\t});\n\t\treturn undefined;\n\t}\n}\n","export const TIME_SETTINGS_KEY = '___nqtr-time_manager_settings___';\nexport const TIME_DATA_KEY = '___nqtr-time_manager_data___';\n\n","import { ITimeStlot, TimeSettings } from \"../types/TimeSettings\";\n\nexport default class TimeManagerSettings implements TimeSettings {\n static minDayHours: number = 0\n static maxDayHours: number = 24\n static defaultTimeSpent: number = 1\n static timeSlots: ITimeStlot[] = []\n static weekLength: number = 7\n static weekendStartDay: number = this.weekLength - 1\n static weekDaysNames: string[] = []\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { TIME_DATA_KEY } from \"../constants\";\nimport TimeDataType from \"../types/TimeDataType\";\nimport { ITimeStlot, TimeSettings } from \"../types/TimeSettings\";\nimport TimeManagerSettings from \"./TimeManagerSettings\";\n\nexport default class TimeManager {\n initialize(settings: TimeSettings) {\n const {\n minDayHours = 0,\n maxDayHours = 24,\n defaultTimeSpent = 1,\n timeSlots = [],\n weekLength = 7,\n weekendStartDay = weekLength - 1,\n weekDaysNames = [],\n } = settings;\n TimeManagerSettings.minDayHours = minDayHours;\n TimeManagerSettings.maxDayHours = maxDayHours;\n TimeManagerSettings.defaultTimeSpent = defaultTimeSpent;\n TimeManagerSettings.timeSlots = timeSlots;\n TimeManagerSettings.weekLength = weekLength;\n if (weekendStartDay >= TimeManagerSettings.weekLength) {\n console.warn(`[NQTR] Weekend start day should be less than week length ${weekLength}, so will be ignored`);\n } else {\n TimeManagerSettings.weekendStartDay = weekendStartDay;\n }\n if (weekDaysNames.length !== weekLength) {\n console.warn(`[NQTR] Week days names should be equal to week length ${weekLength}, so will be ignored`);\n } else {\n TimeManagerSettings.weekDaysNames = weekDaysNames;\n }\n }\n get minDayHours(): number {\n return TimeManagerSettings.minDayHours;\n }\n get maxDayHours(): number {\n return TimeManagerSettings.maxDayHours;\n }\n get defaultTimeSpent(): number {\n return TimeManagerSettings.defaultTimeSpent;\n }\n get timeSlots(): ITimeStlot[] {\n return TimeManagerSettings.timeSlots;\n }\n get weekLength(): number {\n return TimeManagerSettings.weekLength;\n }\n get weekendStartDay(): number {\n return TimeManagerSettings.weekendStartDay;\n }\n get weekDaysNames(): string[] {\n return TimeManagerSettings.weekDaysNames;\n }\n\n /**\n * Get the current hour\n */\n get currentHour(): number {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n if (data.hasOwnProperty(\"currentHour\") && typeof data.currentHour === \"number\") {\n return data.currentHour;\n }\n return this.minDayHours;\n }\n set currentHour(value: number | undefined) {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n if (typeof value === \"number\") {\n data.currentHour = value;\n } else {\n delete data.currentHour;\n }\n storage.setVariable(TIME_DATA_KEY, data);\n }\n /**\n * Get the current day\n */\n get currentDay(): number {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n if (data.hasOwnProperty(\"currentDay\") && typeof data.currentDay === \"number\") {\n return data.currentDay;\n }\n return 0;\n }\n set currentDay(value: number | undefined) {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n if (typeof value === \"number\") {\n data.currentDay = value;\n } else {\n delete data.currentDay;\n }\n storage.setVariable(TIME_DATA_KEY, data);\n }\n /**\n * If the current day is greater than or equal to the weekend start day, then it will return true.\n */\n get isWeekend(): boolean {\n return this.currentWeekDayNumber >= this.weekendStartDay;\n }\n /**\n * Get the current week day number (1 - {@link weekLength}).\n * For example, if the week length is 7 and the current day is 10, then the result will be 4.\n */\n get currentWeekDayNumber(): number {\n let result = this.currentDay % this.weekLength;\n return result + 1;\n }\n /**\n * Get the current week day name. If the week days names are not defined, then it will return undefined.\n * For example, if the week days names are ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] and the current day is 10, then the result will be 'Thursday'.\n * @default \"\"\n */\n get currentDayName(): string {\n let weekDayNumber = this.currentWeekDayNumber - 1;\n if (weekDayNumber >= this.weekDaysNames.length) {\n console.warn(`[NQTR] Week day name is not defined for day ${weekDayNumber}`, this.weekDaysNames);\n return \"\";\n }\n return this.weekDaysNames[weekDayNumber];\n }\n /**\n * Get the current {@link timeSlots} index.\n * You can use this property to create \"Image that changes based on the time period\":\n * @example\n * ```tsx\n * import { weekLength } from '@drincs/nqtr';\n *\n * function changeBackground() {\n * return (\n * <img src={`background-currentTimeSlot.currentTimeSlot.png`} />\n * )\n * }\n */\n get currentTimeSlot(): number {\n if (this.timeSlots.length === 0) {\n console.warn(\"[NQTR] Time slots are not defined\");\n return 0;\n }\n for (let index = 0; index < this.timeSlots.length; index++) {\n let slot = this.timeSlots[index];\n if (this.timeSlots.length > index + 1) {\n if (this.nowIsBetween(slot.startHour, this.timeSlots[index + 1].startHour)) {\n return index;\n }\n }\n }\n return this.timeSlots.length - 1;\n }\n\n /**\n * This function will increase the current hour by the given time spent.\n * If the new hour is greater than or equal to the max day hours, then it will increase the day and set the new hour.\n * @param timeSpent is the time spent in hours (default: {@link defaultTimeSpent})\n * @returns currentTimeSlot.currentHour\n */\n increaseHour(timeSpent: number = this.defaultTimeSpent): number {\n let newHour = this.currentHour + timeSpent;\n if (newHour >= this.maxDayHours) {\n this.increaseDay();\n newHour = this.minDayHours + (newHour - this.maxDayHours);\n }\n this.currentHour = newHour;\n return this.currentHour;\n }\n\n /**\n * This function will increase the current day by the given days.\n * @param newDayHour is the hour of the new day (default: {@link minDayHours})\n * @param days is the number of days to increase (default: 1)\n * @returns timeTracker.currentDay\n */\n increaseDay(newDayHour: number = this.minDayHours, days: number = 1): number {\n let newDay = this.currentDay + days;\n this.currentDay = newDay;\n this.currentHour = newDayHour;\n return this.currentDay;\n }\n\n /**\n * This function will check if the current hour is between the given hours.\n * @param fromHour the starting hour. If the {@link currentHour} is equal to this hour, the function will return true.\n * @param toHour the ending hour.\n * @returns true if the current hour is between the given hours, otherwise false.\n */\n nowIsBetween(fromHour: number | undefined, toHour: number | undefined): boolean {\n if (fromHour === undefined) {\n fromHour = this.minDayHours - 1;\n }\n if (toHour === undefined) {\n toHour = this.maxDayHours + 1;\n }\n let currentHour = this.currentHour;\n if (fromHour < toHour) {\n return currentHour >= fromHour && currentHour < toHour;\n }\n return currentHour >= fromHour || currentHour < toHour;\n }\n}\n","import NavigatorManager from \"./NavigatorManager\";\nimport QuestManager from \"./QuestManager\";\nimport RoutineManager from \"./RoutineManager\";\nimport { default as TimeManager } from \"./TimeManager\";\n\nconst timeTracker = new TimeManager();\nconst navigator = new NavigatorManager();\nconst routine = new RoutineManager();\nconst questsNotebook = new QuestManager();\n\nexport { navigator, questsNotebook, routine, timeTracker };\n","import { ActivityInterface } from \"../interface\"\n\nexport const registeredActivities: { [id: string]: ActivityInterface } = {}\n\nexport function saveActivity(activities: ActivityInterface | ActivityInterface[]) {\n if (Array.isArray(activities)) {\n activities.forEach(activity => {\n registeredActivities[activity.id] = activity\n })\n return\n }\n registeredActivities[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 */\nexport function getActivityById(id: string): ActivityInterface | undefined {\n try {\n let activity = registeredActivities[id]\n if (!activity) {\n console.error(`[NQTR] Activity ${id} not found`)\n return\n }\n return activity\n }\n catch (e) {\n console.error(`[NQTR] Error while getting Activity ${id}`, e)\n return\n }\n}\n","import { StoredClassModel } from \"@drincs/pixi-vn\";\nimport { getActivityById } from \"../../decorators\";\nimport { ActivityInterface } from \"../../interface\";\nimport NavigationAbstractInterface from \"../../interface/navigation/NavigationAbstractClass\";\nimport { timeTracker } from \"../../managers\";\n\ntype ActiveScheduling = {\n fromHour?: number;\n toHour?: number;\n fromDay?: number;\n toDay?: number;\n};\ntype ExcludedScheduling = {\n toDay?: number;\n};\n\nexport default abstract class NavigationAbstractClass extends StoredClassModel implements NavigationAbstractInterface {\n constructor(categoryId: string, id: string, private defaultActivities: ActivityInterface[] = []) {\n super(categoryId, id);\n }\n private get defaultActivitiesIds(): string[] {\n return this.defaultActivities.map((activity) => activity.id);\n }\n private get activeActivityScheduling(): { [activityId: string]: ActiveScheduling } {\n return this.getStorageProperty<{ [activityId: string]: ActiveScheduling }>(`activeActivityScheduling`) || {};\n }\n private get excludedActivitiesScheduling(): { [activityId: string]: ExcludedScheduling } {\n return (\n this.getStorageProperty<{ [activityId: string]: ExcludedScheduling }>(`excludedActivitiesScheduling`) || {}\n );\n }\n private removeActivityScheduling(activityId: string) {\n let activeActivityScheduling = this.activeActivityScheduling;\n delete activeActivityScheduling[activityId];\n this.setStorageProperty(`activeActivityScheduling`, activeActivityScheduling);\n let excludedActivitiesScheduling = this.excludedActivitiesScheduling;\n delete excludedActivitiesScheduling[activityId];\n this.setStorageProperty(`excludedActivitiesScheduling`, excludedActivitiesScheduling);\n }\n private editActivityScheduling(activityId: string, scheduling: ActiveScheduling) {\n this.removeActivityScheduling(activityId);\n let activeActivityScheduling = this.activeActivityScheduling;\n activeActivityScheduling[activityId] = scheduling;\n this.setStorageProperty(`activeActivityScheduling`, activeActivityScheduling);\n }\n private editExcludedActivityScheduling(activityId: string, scheduling: ExcludedScheduling) {\n this.removeActivityScheduling(activityId);\n let excludedActivitiesScheduling = this.excludedActivitiesScheduling;\n excludedActivitiesScheduling[activityId] = scheduling;\n this.setStorageProperty(`excludedActivitiesScheduling`, excludedActivitiesScheduling);\n }\n private get additionalActivitiesIds(): string[] {\n return this.getStorageProperty<string[]>(`additionalActivitiesIds`) || [];\n }\n private get excludedActivitiesIds(): string[] {\n return this.getStorageProperty<string[]>(`excludedActivitiesIds`) || [];\n }\n addActivity(\n activity: ActivityInterface,\n options: {\n /**\n * the activity will be associated with this class only for the specified hours.\n * If you set from 3 and to 5, the activity will be associated with this class only for hours 3, 4 and 5. soSo at 2 or 6 it will not be associated with this class.\n */\n hours?: {\n from: number;\n to: number;\n };\n /**\n * the activity will be associated with this class from the specified day.\n * If you set 3, the activity will be associated with this class from day 3. So at day 2 it will not be associated with this class.\n */\n fromDay?: number;\n /**\n * the activity will be associated with this class to the specified day.\n * If you set 3, the activity will be associated with this class until day 3. So at day 4 it will not be associated with this class.\n */\n toDay?: number;\n } = {}\n ) {\n const { hours, fromDay, toDay } = options;\n let scheduling: ActiveScheduling = {};\n if (hours) {\n if (hours.from >= hours.to) {\n throw new Error(`[NQTR] The from hour must be less than the to hour.`);\n }\n scheduling.fromHour = hours.from;\n }\n if (fromDay === 0) {\n console.warn(`[NQTR] The from day must be greater than 0, so it will be ignored.`);\n }\n if (toDay === 0) {\n console.warn(`[NQTR] The to day must be greater than 0, so it will be ignored.`);\n }\n if (fromDay && toDay && fromDay >= toDay) {\n throw new Error(`[NQTR] The from day must be less than the to day.`);\n }\n if (fromDay) {\n scheduling.fromDay = fromDay;\n }\n if (toDay) {\n scheduling.toDay = toDay;\n }\n\n if (this.defaultActivitiesIds.includes(activity.id)) {\n console.warn(`[NQTR] Activity with id ${activity.id} already exists, so it will be ignored.`);\n return;\n }\n let additionalActivitiesIds = this.additionalActivitiesIds;\n if (additionalActivitiesIds.includes(activity.id)) {\n if (Object.keys(scheduling).length) {\n this.editActivityScheduling(activity.id, scheduling);\n return;\n } else if (this.excludedActivitiesIds.includes(activity.id)) {\n this.removeActivityScheduling(activity.id);\n console.log(\n `[NQTR] Activity with id ${activity.id} was excluded, so it will be associated with this class again.`\n );\n return;\n }\n console.warn(`[NQTR] Activity with id ${activity.id} already exists, so it will be ignored.`);\n return;\n }\n additionalActivitiesIds.push(activity.id);\n this.setStorageProperty(`additionalActivitiesIds`, additionalActivitiesIds);\n if (Object.keys(scheduling).length) {\n this.editActivityScheduling(activity.id, scheduling);\n }\n }\n removeActivity(\n activity: ActivityInterface,\n options: {\n /**\n * The activity will be excluded from this class only for the specified days.\n * If to 3, the activity will be excluded from this class only for days 1, 2 and 3. So at day 4 it will be associated with this class.\n */\n toDay?: number;\n } = {}\n ) {\n const { toDay } = options;\n let scheduling: ExcludedScheduling = {};\n if (toDay === 0) {\n console.warn(`[NQTR] The to day must be greater than 0, so it will be ignored.`);\n }\n if (toDay) {\n scheduling.toDay = toDay;\n }\n\n let additionalActivitiesIds = this.additionalActivitiesIds;\n if (additionalActivitiesIds.includes(activity.id)) {\n if (Object.keys(scheduling).length) {\n this.editExcludedActivityScheduling(activity.id, scheduling);\n return;\n }\n additionalActivitiesIds = additionalActivitiesIds.filter((id) => id !== activity.id);\n this.setStorageProperty(`additionalActivitiesIds`, additionalActivitiesIds);\n } else if (this.defaultActivitiesIds.includes(activity.id)) {\n if (Object.keys(scheduling).length) {\n this.editExcludedActivityScheduling(activity.id, scheduling);\n return;\n }\n let excludedActivitiesIds = this.excludedActivitiesIds;\n excludedActivitiesIds.push(activity.id);\n this.setStorageProperty(`excludedActivitiesIds`, excludedActivitiesIds);\n } else {\n console.warn(`[NQTR] Activity with id ${activity.id} not found, so it will be ignored.`);\n }\n }\n clearExpiredActivities() {\n let activeActivityScheduling = this.activeActivityScheduling;\n let excludedActivitiesScheduling = this.excludedActivitiesScheduling;\n let additionalActivitiesIds = this.additionalActivitiesIds;\n let excludedActivitiesIds = this.excludedActivitiesIds;\n\n additionalActivitiesIds.forEach((activityId) => {\n if (activityId in activeActivityScheduling) {\n let { toDay } = activeActivityScheduling[activityId];\n if (toDay && toDay < timeTracker.currentDay) {\n this.removeActivityScheduling(activityId);\n additionalActivitiesIds = additionalActivitiesIds.filter((id) => id !== activityId);\n }\n }\n });\n excludedActivitiesIds.forEach((activityId) => {\n if (activityId in excludedActivitiesScheduling) {\n let { toDay } = excludedActivitiesScheduling[activityId];\n if (toDay && toDay < timeTracker.currentDay) {\n this.removeActivityScheduling(activityId);\n excludedActivitiesIds = excludedActivitiesIds.filter((id) => id !== activityId);\n }\n }\n });\n }\n\n get activities(): ActivityInterface[] {\n let res: ActivityInterface[] = [];\n Object.entries(this.activeActivityScheduling).forEach(([activityId, scheduling]) => {\n let activity = getActivityById(activityId);\n const {\n fromDay = activity?.fromDay,\n fromHour = activity?.fromHour,\n toDay = activity?.toDay,\n toHour = activity?.toHour,\n } = scheduling;\n if (\n activity &&\n timeTracker.nowIsBetween(fromHour, toHour) &&\n !(fromDay && fromDay > timeTracker.currentDay) &&\n !(toDay && toDay < timeTracker.currentDay)\n ) {\n res.push(activity);\n }\n });\n Object.entries(this.excludedActivitiesScheduling).forEach(([activityId, scheduling]) => {\n let activity = getActivityById(activityId);\n if (activity && activity.isActive && !(scheduling.toDay && scheduling.toDay >= timeTracker.currentDay)) {\n res.push(activity);\n }\n });\n this.defaultActivities.forEach((activity) => {\n if (activity.isActive && !res.find((a) => a.id === activity.id)) {\n res.push(activity);\n }\n });\n return res;\n }\n}\n","import { CharacterInterface } from \"@drincs/pixi-vn\";\nimport { ActivityInterface, CommitmentInterface, LocationInterface } from \"../../interface\";\nimport { RoomBaseInternalInterface } from \"../../interface/navigation/RoomInterface\";\nimport { routine } from \"../../managers\";\nimport NavigationAbstractClass from \"./NavigationAbstractClass\";\n\nconst ROOM_CATEGORY = \"__nqtr-room__\";\nexport default class RoomStoredClass extends NavigationAbstractClass implements RoomBaseInternalInterface {\n constructor(\n id: string,\n /**\n * The location where the room is.\n */\n private readonly _location: LocationInterface,\n activities: ActivityInterface[] = []\n ) {\n super(ROOM_CATEGORY, id, activities);\n }\n get routine(): CommitmentInterface[] {\n return routine.currentRoutine.filter((c) => c.room.id === this.id);\n }\n\n get location(): LocationInterface {\n return this._location;\n }\n\n get characters(): CharacterInterface[] {\n let characters: CharacterInterface[] = [];\n this.routine.forEach((commitment) => {\n characters.push(...commitment.characters);\n });\n return characters;\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import QuestProps from '../../interface/quest/QuestProps.mjs';
2
- import { S as StageInterface } from '../../StageInterface-DJ7l0ubG.mjs';
2
+ import { S as StageInterface } from '../../StageInterface-DX74DUxG.mjs';
3
3
  import QuestStoredClass from './QuestStoredClass.mjs';
4
4
  import '@drincs/nqtr';
5
5
  import '@drincs/pixi-vn';
@@ -1,5 +1,5 @@
1
1
  import QuestProps from '../../interface/quest/QuestProps.js';
2
- import { S as StageInterface } from '../../StageInterface-DJ7l0ubG.js';
2
+ import { S as StageInterface } from '../../StageInterface-DX74DUxG.js';
3
3
  import QuestStoredClass from './QuestStoredClass.js';
4
4
  import '@drincs/nqtr';
5
5
  import '@drincs/pixi-vn';
@@ -1,6 +1,6 @@
1
1
  import { OnRunProps } from '@drincs/nqtr';
2
2
  import { StoredClassModel } from '@drincs/pixi-vn';
3
- import { b as QuestBaseInternalInterface, S as StageInterface, Q as QuestInterface } from '../../StageInterface-DJ7l0ubG.mjs';
3
+ import { b as QuestBaseInternalInterface, S as StageInterface, Q as QuestInterface } from '../../StageInterface-DX74DUxG.mjs';
4
4
 
5
5
  declare class QuestStoredClass extends StoredClassModel implements QuestBaseInternalInterface {
6
6
  private readonly _stages;
@@ -1,6 +1,6 @@
1
1
  import { OnRunProps } from '@drincs/nqtr';
2
2
  import { StoredClassModel } from '@drincs/pixi-vn';
3
- import { b as QuestBaseInternalInterface, S as StageInterface, Q as QuestInterface } from '../../StageInterface-DJ7l0ubG.js';
3
+ import { b as QuestBaseInternalInterface, S as StageInterface, Q as QuestInterface } from '../../StageInterface-DX74DUxG.js';
4
4
 
5
5
  declare class QuestStoredClass extends StoredClassModel implements QuestBaseInternalInterface {
6
6
  private readonly _stages;
@@ -2,7 +2,7 @@ import StageProps from '../../interface/quest/StageProps.mjs';
2
2
  import StageFlags from '../../interface/quest/StageFlags.mjs';
3
3
  import StageStoredClass from './StageStoredClass.mjs';
4
4
  import '@drincs/nqtr';
5
- import '../../StageInterface-DJ7l0ubG.mjs';
5
+ import '../../StageInterface-DX74DUxG.mjs';
6
6
  import '@drincs/pixi-vn';
7
7
 
8
8
  declare class StageBaseModel extends StageStoredClass {
@@ -2,7 +2,7 @@ import StageProps from '../../interface/quest/StageProps.js';
2
2
  import StageFlags from '../../interface/quest/StageFlags.js';
3
3
  import StageStoredClass from './StageStoredClass.js';
4
4
  import '@drincs/nqtr';
5
- import '../../StageInterface-DJ7l0ubG.js';
5
+ import '../../StageInterface-DX74DUxG.js';
6
6
  import '@drincs/pixi-vn';
7
7
 
8
8
  declare class StageBaseModel extends StageStoredClass {
@@ -1,2 +1,2 @@
1
- 'use strict';var pixiVn=require('@drincs/pixi-vn');var s="___nqtr-time_manager_data___";var n=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var f=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:a=1,timeSlots:C=[],weekLength:m=7,weekendStartDay:D=m-1,weekDaysNames:v=[]}=e;n.minDayHours=t,n.maxDayHours=r,n.defaultTimeSpent=a,n.timeSlots=C,n.weekLength=m,D>=n.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${m}, so will be ignored`):n.weekendStartDay=D,v.length!==m?console.warn(`[NQTR] Week days names should be equal to week length ${m}, so will be ignored`):n.weekDaysNames=v;}get minDayHours(){return n.minDayHours}get maxDayHours(){return n.maxDayHours}get defaultTimeSpent(){return n.defaultTimeSpent}get timeSlots(){return n.timeSlots}get weekLength(){return n.weekLength}get weekendStartDay(){return n.weekendStartDay}get weekDaysNames(){return n.weekDaysNames}get currentHour(){let e=pixiVn.storage.getVariable(s)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=pixiVn.storage.getVariable(s)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,pixiVn.storage.setVariable(s,t);}get currentDay(){let e=pixiVn.storage.getVariable(s)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=pixiVn.storage.getVariable(s)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,pixiVn.storage.setVariable(s,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}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.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var _=new f;var k="__nqtr-stage__",g=class extends pixiVn.StoredClassModel{constructor(e,t={}){super(k,e),this._onStart=t.onStart,this._onEnd=t.onEnd,this._daysRequiredToStart=t.daysRequiredToStart,this._questsRequiredToStart=t.questsRequiredToStart||[];}_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 prevStageEndDay(){return this.getStorageProperty("prevStageEndDay")}set prevStageEndDay(e){this.setStorageProperty("prevStageEndDay",e);}get startDay(){let e=this.prevStageEndDay;if(e!==undefined)return e+this.daysRequiredToStart}get canStart(){let e=this.daysRequiredToStart;if(e>0){let t=this.prevStageEndDay;if(t===undefined||t+e>_.currentDay)return false}return !(this.questsRequiredToStart.length>0&&!this.questsRequiredToStart.every(t=>t.quest.currentStageIndex&&t.quest.currentStageIndex>=t.stageNumber))}inizialize(){this.daysRequiredToStart>0&&(this.prevStageEndDay=_.currentDay,console.log(`[NQTR] Stage ${this.id} will start on day ${this.startDay}`));}start(e){this.canStart?(this.started=true,this.onStart&&this.onStart(this,e)):console.warn(`[NQTR] Stage ${this.id} can't start`);}_daysRequiredToStart;get daysRequiredToStart(){return this._daysRequiredToStart||0}_questsRequiredToStart;get questsRequiredToStart(){return this._questsRequiredToStart||[]}};var I=class extends g{constructor(e,t){super(e,{onStart:t.onStart,onEnd:t.onEnd,daysRequiredToStart:t.daysRequiredToStart,questsRequiredToStart:t.questsRequiredToStart}),this._name=t.name||"",this._flags=t.flags||[],this._description=t.description||"",this._adviceDescription=t.adviceDescription||"",this._image=t.image,this._flagsRequiredToStart=t.flagsRequiredToStart||[],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}_flagsRequiredToStart;get flagsRequiredToStart(){return this._flagsRequiredToStart}_requestDescriptionToStart;get requestDescriptionToStart(){return this._requestDescriptionToStart}get completed(){return super.completed?true:this.flags.length>0?!!this.flags.every(e=>pixiVn.getFlag(e.flag)):false}set completed(e){super.completed=e;}get canStart(){return this.flagsRequiredToStart.length>0&&!this.flagsRequiredToStart.every(e=>pixiVn.getFlag(e.flag))?false:super.canStart}};module.exports=I;//# sourceMappingURL=StageBaseModel.js.map
1
+ 'use strict';var pixiVn=require('@drincs/pixi-vn');var s="___nqtr-time_manager_data___";var n=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var l=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:a=1,timeSlots:C=[],weekLength:m=7,weekendStartDay:D=m-1,weekDaysNames:v=[]}=e;n.minDayHours=t,n.maxDayHours=r,n.defaultTimeSpent=a,n.timeSlots=C,n.weekLength=m,D>=n.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${m}, so will be ignored`):n.weekendStartDay=D,v.length!==m?console.warn(`[NQTR] Week days names should be equal to week length ${m}, so will be ignored`):n.weekDaysNames=v;}get minDayHours(){return n.minDayHours}get maxDayHours(){return n.maxDayHours}get defaultTimeSpent(){return n.defaultTimeSpent}get timeSlots(){return n.timeSlots}get weekLength(){return n.weekLength}get weekendStartDay(){return n.weekendStartDay}get weekDaysNames(){return n.weekDaysNames}get currentHour(){let e=pixiVn.storage.getVariable(s)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=pixiVn.storage.getVariable(s)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,pixiVn.storage.setVariable(s,t);}get currentDay(){let e=pixiVn.storage.getVariable(s)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=pixiVn.storage.getVariable(s)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,pixiVn.storage.setVariable(s,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}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.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours-1),t===undefined&&(t=this.maxDayHours+1);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var _=new l;var k="__nqtr-stage__",g=class extends pixiVn.StoredClassModel{constructor(e,t={}){super(k,e),this._onStart=t.onStart,this._onEnd=t.onEnd,this._daysRequiredToStart=t.daysRequiredToStart,this._questsRequiredToStart=t.questsRequiredToStart||[];}_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 prevStageEndDay(){return this.getStorageProperty("prevStageEndDay")}set prevStageEndDay(e){this.setStorageProperty("prevStageEndDay",e);}get startDay(){let e=this.prevStageEndDay;if(e!==undefined)return e+this.daysRequiredToStart}get canStart(){let e=this.daysRequiredToStart;if(e>0){let t=this.prevStageEndDay;if(t===undefined||t+e>_.currentDay)return false}return !(this.questsRequiredToStart.length>0&&!this.questsRequiredToStart.every(t=>t.quest.currentStageIndex&&t.quest.currentStageIndex>=t.stageNumber))}inizialize(){this.daysRequiredToStart>0&&(this.prevStageEndDay=_.currentDay,console.log(`[NQTR] Stage ${this.id} will start on day ${this.startDay}`));}start(e){this.canStart?(this.started=true,this.onStart&&this.onStart(this,e)):console.warn(`[NQTR] Stage ${this.id} can't start`);}_daysRequiredToStart;get daysRequiredToStart(){return this._daysRequiredToStart||0}_questsRequiredToStart;get questsRequiredToStart(){return this._questsRequiredToStart||[]}};var I=class extends g{constructor(e,t){super(e,{onStart:t.onStart,onEnd:t.onEnd,daysRequiredToStart:t.daysRequiredToStart,questsRequiredToStart:t.questsRequiredToStart}),this._name=t.name||"",this._flags=t.flags||[],this._description=t.description||"",this._adviceDescription=t.adviceDescription||"",this._image=t.image,this._flagsRequiredToStart=t.flagsRequiredToStart||[],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}_flagsRequiredToStart;get flagsRequiredToStart(){return this._flagsRequiredToStart}_requestDescriptionToStart;get requestDescriptionToStart(){return this._requestDescriptionToStart}get completed(){return super.completed?true:this.flags.length>0?!!this.flags.every(e=>pixiVn.getFlag(e.flag)):false}set completed(e){super.completed=e;}get canStart(){return this.flagsRequiredToStart.length>0&&!this.flagsRequiredToStart.every(e=>pixiVn.getFlag(e.flag))?false:super.canStart}};module.exports=I;//# sourceMappingURL=StageBaseModel.js.map
2
2
  //# sourceMappingURL=StageBaseModel.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/constants.ts","../../../src/managers/TimeManagerSettings.ts","../../../src/managers/TimeManager.ts","../../../src/managers/index.ts","../../../src/classes/quest/StageStoredClass.ts","../../../src/classes/quest/StageBaseModel.ts"],"names":["TIME_DATA_KEY","TimeManagerSettings","TimeManager","settings","minDayHours","maxDayHours","defaultTimeSpent","timeSlots","weekLength","weekendStartDay","weekDaysNames","data","storage","value","weekDayNumber","index","slot","timeSpent","newHour","newDayHour","days","newDay","fromHour","toHour","currentHour","timeTracker","navigator","STAGE_CATEGORY","StageStoredClass","StoredClassModel","id","options","prevStageEndDay","daysRequired","q","props","StageBaseModel","flag","getFlag"],"mappings":"mDACO,IAAMA,EAAgB,8BCC7B,CAAA,IAAqBC,EAArB,KAAiE,CAC7D,OAAO,WAAsB,CAAA,CAAA,CAC7B,OAAO,WAAsB,CAAA,EAAA,CAC7B,OAAO,gBAA2B,CAAA,CAAA,CAClC,OAAO,SAAA,CA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CAAA,SAAA,CACF,KAEJ,IAAK,CAAA,KAAA,CAAM,OAAS,CAClB,CAAA,CAAA,CAAA,IAAA,CAAK,MAAM,KAAOE,CAAAA,CAAAA,EAASC,eAAQD,CAAK,CAAA,IAAI,CAAC,CAK5C,CAAA,KACR,CACA,IAAa,SAAA,CAAUxB,CAAgB,CAAA,CACtC,KAAM,CAAA,SAAA,CAAYA,EACnB,CACA,IAAa,UAAoB,CAChC,OAAI,KAAK,oBAAqB,CAAA,MAAA,CAAS,GAAK,CAAC,IAAA,CAAK,qBAAqB,KAAOwB,CAAAA,CAAAA,EAASC,eAAQD,CAAK,CAAA,IAAI,CAAC,CACjG,CAAA,KAAA,CAED,KAAM,CAAA,QACd,CACD","file":"StageBaseModel.js","sourcesContent":["export const TIME_SETTINGS_KEY = '___nqtr-time_manager_settings___';\nexport const TIME_DATA_KEY = '___nqtr-time_manager_data___';\n\n","import { ITimeStlot, TimeSettings } from \"../types/TimeSettings\";\n\nexport default class TimeManagerSettings implements TimeSettings {\n static minDayHours: number = 0\n static maxDayHours: number = 24\n static defaultTimeSpent: number = 1\n static timeSlots: ITimeStlot[] = []\n static weekLength: number = 7\n static weekendStartDay: number = this.weekLength - 1\n static weekDaysNames: string[] = []\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { TIME_DATA_KEY } from \"../constants\";\nimport TimeDataType from \"../types/TimeDataType\";\nimport { ITimeStlot, TimeSettings } from \"../types/TimeSettings\";\nimport TimeManagerSettings from \"./TimeManagerSettings\";\n\nexport default class TimeManager {\n initialize(settings: TimeSettings) {\n const {\n minDayHours = 0,\n maxDayHours = 24,\n defaultTimeSpent = 1,\n timeSlots = [],\n weekLength = 7,\n weekendStartDay = weekLength - 1,\n weekDaysNames = [],\n } = settings\n TimeManagerSettings.minDayHours = minDayHours\n TimeManagerSettings.maxDayHours = maxDayHours\n TimeManagerSettings.defaultTimeSpent = defaultTimeSpent\n TimeManagerSettings.timeSlots = timeSlots\n TimeManagerSettings.weekLength = weekLength\n if (weekendStartDay >= TimeManagerSettings.weekLength) {\n console.warn(`[NQTR] Weekend start day should be less than week length ${weekLength}, so will be ignored`)\n }\n else {\n TimeManagerSettings.weekendStartDay = weekendStartDay\n }\n if (weekDaysNames.length !== weekLength) {\n console.warn(`[NQTR] Week days names should be equal to week length ${weekLength}, so will be ignored`)\n }\n else {\n TimeManagerSettings.weekDaysNames = weekDaysNames\n }\n }\n get minDayHours(): number {\n return TimeManagerSettings.minDayHours\n }\n get maxDayHours(): number {\n return TimeManagerSettings.maxDayHours\n }\n get defaultTimeSpent(): number {\n return TimeManagerSettings.defaultTimeSpent\n }\n get timeSlots(): ITimeStlot[] {\n return TimeManagerSettings.timeSlots\n }\n get weekLength(): number {\n return TimeManagerSettings.weekLength\n }\n get weekendStartDay(): number {\n return TimeManagerSettings.weekendStartDay\n }\n get weekDaysNames(): string[] {\n return TimeManagerSettings.weekDaysNames\n }\n\n /**\n * Get the current hour\n */\n get currentHour(): number {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {}\n if (data.hasOwnProperty('currentHour') && typeof data.currentHour === 'number') {\n return data.currentHour\n }\n return this.minDayHours\n }\n set currentHour(value: number | undefined) {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {}\n if (typeof value === 'number') {\n data.currentHour = value\n } else {\n delete data.currentHour\n }\n storage.setVariable(TIME_DATA_KEY, data)\n }\n /**\n * Get the current day\n */\n get currentDay(): number {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {}\n if (data.hasOwnProperty('currentDay') && typeof data.currentDay === 'number') {\n return data.currentDay\n }\n return 0\n }\n set currentDay(value: number | undefined) {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {}\n if (typeof value === 'number') {\n data.currentDay = value\n }\n else {\n delete data.currentDay\n }\n storage.setVariable(TIME_DATA_KEY, data)\n }\n /**\n * If the current day is greater than or equal to the weekend start day, then it will return true.\n */\n get isWeekend(): boolean {\n return this.currentWeekDayNumber >= this.weekendStartDay\n }\n /**\n * Get the current week day number (1 - {@link weekLength}).\n * For example, if the week length is 7 and the current day is 10, then the result will be 4.\n */\n get currentWeekDayNumber(): number {\n let result = this.currentDay % this.weekLength\n return result + 1\n }\n /**\n * Get the current week day name. If the week days names are not defined, then it will return undefined.\n * For example, if the week days names are ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] and the current day is 10, then the result will be 'Thursday'.\n * @default \"\"\n */\n get currentDayName(): string {\n let weekDayNumber = this.currentWeekDayNumber - 1\n if (weekDayNumber >= this.weekDaysNames.length) {\n console.warn(`[NQTR] Week day name is not defined for day ${weekDayNumber}`, this.weekDaysNames)\n return \"\"\n }\n return this.weekDaysNames[weekDayNumber]\n }\n /**\n * Get the current {@link timeSlots} index.\n * You can use this property to create \"Image that changes based on the time period\":\n * @example\n * ```tsx\n * import { weekLength } from '@drincs/nqtr';\n * \n * function changeBackground() {\n * return (\n * <img src={`background-currentTimeSlot.currentTimeSlot.png`} />\n * )\n * }\n */\n get currentTimeSlot(): number {\n if (this.timeSlots.length === 0) {\n console.warn('[NQTR] Time slots are not defined')\n return 0\n }\n for (let index = 0; index < this.timeSlots.length; index++) {\n let slot = this.timeSlots[index]\n if (this.timeSlots.length > index + 1) {\n if (this.nowIsBetween(slot.startHour, this.timeSlots[index + 1].startHour)) {\n return index\n }\n }\n }\n return this.timeSlots.length - 1\n }\n\n /**\n * This function will increase the current hour by the given time spent.\n * If the new hour is greater than or equal to the max day hours, then it will increase the day and set the new hour.\n * @param timeSpent is the time spent in hours (default: {@link defaultTimeSpent})\n * @returns currentTimeSlot.currentHour\n */\n increaseHour(timeSpent: number = this.defaultTimeSpent): number {\n let newHour = this.currentHour + timeSpent\n if (newHour >= this.maxDayHours) {\n this.increaseDay()\n newHour = this.minDayHours + (newHour - this.maxDayHours)\n }\n this.currentHour = newHour\n return this.currentHour\n }\n\n /**\n * This function will increase the current day by the given days.\n * @param newDayHour is the hour of the new day (default: {@link minDayHours})\n * @param days is the number of days to increase (default: 1)\n * @returns timeTracker.currentDay\n */\n increaseDay(newDayHour: number = this.minDayHours, days: number = 1): number {\n let newDay = this.currentDay + days\n this.currentDay = newDay\n this.currentHour = newDayHour\n return this.currentDay\n }\n\n /**\n * This function will check if the current hour is between the given hours.\n * @param fromHour the starting hour. If the {@link currentHour} is equal to this hour, the function will return true.\n * @param toHour the ending hour.\n * @returns true if the current hour is between the given hours, otherwise false.\n */\n nowIsBetween(fromHour: number | undefined, toHour: number | undefined): boolean {\n if (fromHour === undefined) {\n fromHour = this.minDayHours\n }\n if (toHour === undefined) {\n toHour = this.maxDayHours\n }\n let currentHour = this.currentHour\n if (fromHour < toHour) {\n return currentHour >= fromHour && currentHour < toHour\n }\n return currentHour >= fromHour || currentHour < toHour\n }\n}\n","import NavigatorManager from \"./NavigatorManager\";\nimport QuestManager from \"./QuestManager\";\nimport RoutineManager from \"./RoutineManager\";\nimport { default as TimeManager } from \"./TimeManager\";\n\nconst timeTracker = new TimeManager();\nconst navigator = new NavigatorManager();\nconst routine = new RoutineManager();\nconst questsNotebook = new QuestManager();\n\nexport { navigator, questsNotebook, routine, timeTracker };\n","import { OnRunProps } from \"@drincs/nqtr\";\nimport { StoredClassModel } from \"@drincs/pixi-vn\";\nimport { StageInterface } from \"../../interface\";\nimport { StageBaseInternalInterface } from \"../../interface/quest/StageInterface\";\nimport { timeTracker } from \"../../managers\";\nimport { QuestsRequiredType } from \"../../types\";\n\nconst STAGE_CATEGORY = \"__nqtr-stage__\";\nexport default class StageStoredClass extends StoredClassModel implements StageBaseInternalInterface {\n constructor(\n id: string,\n options: {\n /**\n * The function that will be executed when the stage starts.\n */\n onStart?: (stage: StageInterface, props: OnRunProps) => void;\n /**\n * The function that will be executed when the stage ends.\n */\n onEnd?: (stage: StageInterface, props: OnRunProps) => void;\n /**\n * The day required to start the stage.\n * @example If the value is 3, and the previous stage ends on day 1, the stage will start on day 4.\n */\n daysRequiredToStart?: number;\n /**\n * The quests required to start the stage.\n * @default []\n */\n questsRequiredToStart?: QuestsRequiredType[];\n } = {}\n ) {\n super(STAGE_CATEGORY, id);\n this._onStart = options.onStart;\n this._onEnd = options.onEnd;\n this._daysRequiredToStart = options.daysRequiredToStart;\n this._questsRequiredToStart = options.questsRequiredToStart || [];\n }\n\n private _onStart?: (stage: StageInterface, props: OnRunProps) => void;\n get onStart(): undefined | ((stage: StageInterface, props: OnRunProps) => void) {\n return this._onStart;\n }\n\n private _onEnd?: (stage: StageInterface, props: OnRunProps) => void;\n get onEnd(): undefined | ((stage: StageInterface, props: OnRunProps) => void) {\n return this._onEnd;\n }\n\n get completed(): boolean {\n return this.getStorageProperty<boolean>(\"completed\") || false;\n }\n set completed(value: boolean) {\n this.setStorageProperty(\"completed\", value);\n }\n\n get started(): boolean {\n return this.getStorageProperty<boolean>(\"started\") || false;\n }\n set started(value: boolean) {\n this.setStorageProperty(\"started\", value);\n }\n\n private get prevStageEndDay(): number | undefined {\n return this.getStorageProperty<number>(\"prevStageEndDay\");\n }\n private set prevStageEndDay(value: number | undefined) {\n this.setStorageProperty(\"prevStageEndDay\", value);\n }\n\n get startDay(): number | undefined {\n let prevStageEndDay = this.prevStageEndDay;\n if (prevStageEndDay === undefined) {\n return undefined;\n }\n return prevStageEndDay + this.daysRequiredToStart;\n }\n\n get canStart(): boolean {\n let daysRequired = this.daysRequiredToStart;\n if (daysRequired > 0) {\n let prevStageEndDay = this.prevStageEndDay;\n if (prevStageEndDay === undefined) {\n return false;\n }\n if (prevStageEndDay + daysRequired > timeTracker.currentDay) {\n return false;\n }\n }\n if (\n this.questsRequiredToStart.length > 0 &&\n !this.questsRequiredToStart.every(\n (q) => q.quest.currentStageIndex && q.quest.currentStageIndex >= q.stageNumber\n )\n ) {\n return false;\n }\n return true;\n }\n\n inizialize() {\n if (this.daysRequiredToStart > 0) {\n this.prevStageEndDay = timeTracker.currentDay;\n console.log(`[NQTR] Stage ${this.id} will start on day ${this.startDay}`);\n }\n }\n\n start(props: OnRunProps) {\n if (this.canStart) {\n this.started = true;\n if (this.onStart) {\n this.onStart(this as any as StageInterface, props);\n }\n } else {\n console.warn(`[NQTR] Stage ${this.id} can't start`);\n }\n }\n\n private _daysRequiredToStart?: number;\n get daysRequiredToStart(): number {\n return this._daysRequiredToStart || 0;\n }\n\n private _questsRequiredToStart: QuestsRequiredType[];\n get questsRequiredToStart(): QuestsRequiredType[] {\n return this._questsRequiredToStart || [];\n }\n}\n","import { getFlag } from \"@drincs/pixi-vn\";\nimport { StageProps } from \"../../interface\";\nimport StageFlags from \"../../interface/quest/StageFlags\";\nimport StageStoredClass from \"./StageStoredClass\";\n\nexport default class StageBaseModel extends StageStoredClass {\n\tconstructor(id: string, props: StageProps) {\n\t\tsuper(id, {\n\t\t\tonStart: props.onStart,\n\t\t\tonEnd: props.onEnd,\n\t\t\tdaysRequiredToStart: props.daysRequiredToStart,\n\t\t\tquestsRequiredToStart: props.questsRequiredToStart,\n\t\t});\n\t\tthis._name = props.name || \"\";\n\t\tthis._flags = props.flags || [];\n\t\tthis._description = props.description || \"\";\n\t\tthis._adviceDescription = props.adviceDescription || \"\";\n\t\tthis._image = props.image;\n\t\tthis._flagsRequiredToStart = props.flagsRequiredToStart || [];\n\t\tthis._requestDescriptionToStart = props.requestDescriptionToStart || \"\";\n\t}\n\n\tprivate _name: string;\n\t/**\n\t * The name of the stage.\n\t */\n\tget name(): string {\n\t\treturn this._name;\n\t}\n\n\tprivate _description: string;\n\t/**\n\t * The description of the stage.\n\t */\n\tget description(): string {\n\t\treturn this._description;\n\t}\n\n\tprivate _adviceDescription: string;\n\t/**\n\t * The advice description of the stage.\n\t */\n\tget adviceDescription(): string {\n\t\treturn this._adviceDescription;\n\t}\n\n\tprivate _image?: string;\n\t/**\n\t * The image of the stage.\n\t */\n\tget image(): string | undefined {\n\t\treturn this._image;\n\t}\n\n\tprivate _flags: StageFlags[];\n\t/**\n\t * The list of flags that the player must complete to finish the stage.\n\t */\n\tget flags(): StageFlags[] {\n\t\treturn this._flags;\n\t}\n\n\tprivate _flagsRequiredToStart: StageFlags[];\n\t/**\n\t * The list of flags required to start the stage.\n\t */\n\tget flagsRequiredToStart(): StageFlags[] {\n\t\treturn this._flagsRequiredToStart;\n\t}\n\n\tprivate _requestDescriptionToStart: string;\n\t/**\n\t * The description of the request to start the stage.\n\t */\n\tget requestDescriptionToStart(): string {\n\t\treturn this._requestDescriptionToStart;\n\t}\n\n\toverride get completed(): boolean {\n\t\tif (super.completed) {\n\t\t\treturn true;\n\t\t}\n\t\tif (this.flags.length > 0) {\n\t\t\tif (!this.flags.every((flag) => getFlag(flag.flag))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\toverride set completed(value: boolean) {\n\t\tsuper.completed = value;\n\t}\n\toverride get canStart(): boolean {\n\t\tif (this.flagsRequiredToStart.length > 0 && !this.flagsRequiredToStart.every((flag) => getFlag(flag.flag))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn super.canStart;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/constants.ts","../../../src/managers/TimeManagerSettings.ts","../../../src/managers/TimeManager.ts","../../../src/managers/index.ts","../../../src/classes/quest/StageStoredClass.ts","../../../src/classes/quest/StageBaseModel.ts"],"names":["TIME_DATA_KEY","TimeManagerSettings","TimeManager","settings","minDayHours","maxDayHours","defaultTimeSpent","timeSlots","weekLength","weekendStartDay","weekDaysNames","data","storage","value","weekDayNumber","index","slot","timeSpent","newHour","newDayHour","days","newDay","fromHour","toHour","currentHour","timeTracker","STAGE_CATEGORY","StageStoredClass","StoredClassModel","id","options","prevStageEndDay","daysRequired","q","props","StageBaseModel","flag","getFlag"],"mappings":"mDACO,IAAMA,EAAgB,8BCC7B,CAAA,IAAqBC,EAArB,KAAiE,CAC7D,OAAO,WAAsB,CAAA,CAAA,CAC7B,OAAO,WAAsB,CAAA,EAAA,CAC7B,OAAO,gBAA2B,CAAA,CAAA,CAClC,OAAO,SAAA,C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IAAK,CAAA,KAAA,CAAM,OAAS,CAClB,CAAA,CAAA,CAAA,IAAA,CAAK,MAAM,KAAOE,CAAAA,CAAAA,EAASC,eAAQD,CAAK,CAAA,IAAI,CAAC,CAK5C,CAAA,KACR,CACA,IAAa,SAAA,CAAUvB,CAAgB,CAAA,CACtC,KAAM,CAAA,SAAA,CAAYA,EACnB,CACA,IAAa,UAAoB,CAChC,OAAI,KAAK,oBAAqB,CAAA,MAAA,CAAS,GAAK,CAAC,IAAA,CAAK,qBAAqB,KAAOuB,CAAAA,CAAAA,EAASC,eAAQD,CAAK,CAAA,IAAI,CAAC,CACjG,CAAA,KAAA,CAED,KAAM,CAAA,QACd,CACD","file":"StageBaseModel.js","sourcesContent":["export const TIME_SETTINGS_KEY = '___nqtr-time_manager_settings___';\nexport const TIME_DATA_KEY = '___nqtr-time_manager_data___';\n\n","import { ITimeStlot, TimeSettings } from \"../types/TimeSettings\";\n\nexport default class TimeManagerSettings implements TimeSettings {\n static minDayHours: number = 0\n static maxDayHours: number = 24\n static defaultTimeSpent: number = 1\n static timeSlots: ITimeStlot[] = []\n static weekLength: number = 7\n static weekendStartDay: number = this.weekLength - 1\n static weekDaysNames: string[] = []\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { TIME_DATA_KEY } from \"../constants\";\nimport TimeDataType from \"../types/TimeDataType\";\nimport { ITimeStlot, TimeSettings } from \"../types/TimeSettings\";\nimport TimeManagerSettings from \"./TimeManagerSettings\";\n\nexport default class TimeManager {\n initialize(settings: TimeSettings) {\n const {\n minDayHours = 0,\n maxDayHours = 24,\n defaultTimeSpent = 1,\n timeSlots = [],\n weekLength = 7,\n weekendStartDay = weekLength - 1,\n weekDaysNames = [],\n } = settings;\n TimeManagerSettings.minDayHours = minDayHours;\n TimeManagerSettings.maxDayHours = maxDayHours;\n TimeManagerSettings.defaultTimeSpent = defaultTimeSpent;\n TimeManagerSettings.timeSlots = timeSlots;\n TimeManagerSettings.weekLength = weekLength;\n if (weekendStartDay >= TimeManagerSettings.weekLength) {\n console.warn(`[NQTR] Weekend start day should be less than week length ${weekLength}, so will be ignored`);\n } else {\n TimeManagerSettings.weekendStartDay = weekendStartDay;\n }\n if (weekDaysNames.length !== weekLength) {\n console.warn(`[NQTR] Week days names should be equal to week length ${weekLength}, so will be ignored`);\n } else {\n TimeManagerSettings.weekDaysNames = weekDaysNames;\n }\n }\n get minDayHours(): number {\n return TimeManagerSettings.minDayHours;\n }\n get maxDayHours(): number {\n return TimeManagerSettings.maxDayHours;\n }\n get defaultTimeSpent(): number {\n return TimeManagerSettings.defaultTimeSpent;\n }\n get timeSlots(): ITimeStlot[] {\n return TimeManagerSettings.timeSlots;\n }\n get weekLength(): number {\n return TimeManagerSettings.weekLength;\n }\n get weekendStartDay(): number {\n return TimeManagerSettings.weekendStartDay;\n }\n get weekDaysNames(): string[] {\n return TimeManagerSettings.weekDaysNames;\n }\n\n /**\n * Get the current hour\n */\n get currentHour(): number {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n if (data.hasOwnProperty(\"currentHour\") && typeof data.currentHour === \"number\") {\n return data.currentHour;\n }\n return this.minDayHours;\n }\n set currentHour(value: number | undefined) {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n if (typeof value === \"number\") {\n data.currentHour = value;\n } else {\n delete data.currentHour;\n }\n storage.setVariable(TIME_DATA_KEY, data);\n }\n /**\n * Get the current day\n */\n get currentDay(): number {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n if (data.hasOwnProperty(\"currentDay\") && typeof data.currentDay === \"number\") {\n return data.currentDay;\n }\n return 0;\n }\n set currentDay(value: number | undefined) {\n let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n if (typeof value === \"number\") {\n data.currentDay = value;\n } else {\n delete data.currentDay;\n }\n storage.setVariable(TIME_DATA_KEY, data);\n }\n /**\n * If the current day is greater than or equal to the weekend start day, then it will return true.\n */\n get isWeekend(): boolean {\n return this.currentWeekDayNumber >= this.weekendStartDay;\n }\n /**\n * Get the current week day number (1 - {@link weekLength}).\n * For example, if the week length is 7 and the current day is 10, then the result will be 4.\n */\n get currentWeekDayNumber(): number {\n let result = this.currentDay % this.weekLength;\n return result + 1;\n }\n /**\n * Get the current week day name. If the week days names are not defined, then it will return undefined.\n * For example, if the week days names are ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] and the current day is 10, then the result will be 'Thursday'.\n * @default \"\"\n */\n get currentDayName(): string {\n let weekDayNumber = this.currentWeekDayNumber - 1;\n if (weekDayNumber >= this.weekDaysNames.length) {\n console.warn(`[NQTR] Week day name is not defined for day ${weekDayNumber}`, this.weekDaysNames);\n return \"\";\n }\n return this.weekDaysNames[weekDayNumber];\n }\n /**\n * Get the current {@link timeSlots} index.\n * You can use this property to create \"Image that changes based on the time period\":\n * @example\n * ```tsx\n * import { weekLength } from '@drincs/nqtr';\n *\n * function changeBackground() {\n * return (\n * <img src={`background-currentTimeSlot.currentTimeSlot.png`} />\n * )\n * }\n */\n get currentTimeSlot(): number {\n if (this.timeSlots.length === 0) {\n console.warn(\"[NQTR] Time slots are not defined\");\n return 0;\n }\n for (let index = 0; index < this.timeSlots.length; index++) {\n let slot = this.timeSlots[index];\n if (this.timeSlots.length > index + 1) {\n if (this.nowIsBetween(slot.startHour, this.timeSlots[index + 1].startHour)) {\n return index;\n }\n }\n }\n return this.timeSlots.length - 1;\n }\n\n /**\n * This function will increase the current hour by the given time spent.\n * If the new hour is greater than or equal to the max day hours, then it will increase the day and set the new hour.\n * @param timeSpent is the time spent in hours (default: {@link defaultTimeSpent})\n * @returns currentTimeSlot.currentHour\n */\n increaseHour(timeSpent: number = this.defaultTimeSpent): number {\n let newHour = this.currentHour + timeSpent;\n if (newHour >= this.maxDayHours) {\n this.increaseDay();\n newHour = this.minDayHours + (newHour - this.maxDayHours);\n }\n this.currentHour = newHour;\n return this.currentHour;\n }\n\n /**\n * This function will increase the current day by the given days.\n * @param newDayHour is the hour of the new day (default: {@link minDayHours})\n * @param days is the number of days to increase (default: 1)\n * @returns timeTracker.currentDay\n */\n increaseDay(newDayHour: number = this.minDayHours, days: number = 1): number {\n let newDay = this.currentDay + days;\n this.currentDay = newDay;\n this.currentHour = newDayHour;\n return this.currentDay;\n }\n\n /**\n * This function will check if the current hour is between the given hours.\n * @param fromHour the starting hour. If the {@link currentHour} is equal to this hour, the function will return true.\n * @param toHour the ending hour.\n * @returns true if the current hour is between the given hours, otherwise false.\n */\n nowIsBetween(fromHour: number | undefined, toHour: number | undefined): boolean {\n if (fromHour === undefined) {\n fromHour = this.minDayHours - 1;\n }\n if (toHour === undefined) {\n toHour = this.maxDayHours + 1;\n }\n let currentHour = this.currentHour;\n if (fromHour < toHour) {\n return currentHour >= fromHour && currentHour < toHour;\n }\n return currentHour >= fromHour || currentHour < toHour;\n }\n}\n","import NavigatorManager from \"./NavigatorManager\";\nimport QuestManager from \"./QuestManager\";\nimport RoutineManager from \"./RoutineManager\";\nimport { default as TimeManager } from \"./TimeManager\";\n\nconst timeTracker = new TimeManager();\nconst navigator = new NavigatorManager();\nconst routine = new RoutineManager();\nconst questsNotebook = new QuestManager();\n\nexport { navigator, questsNotebook, routine, timeTracker };\n","import { OnRunProps } from \"@drincs/nqtr\";\nimport { StoredClassModel } from \"@drincs/pixi-vn\";\nimport { StageInterface } from \"../../interface\";\nimport { StageBaseInternalInterface } from \"../../interface/quest/StageInterface\";\nimport { timeTracker } from \"../../managers\";\nimport { QuestsRequiredType } from \"../../types\";\n\nconst STAGE_CATEGORY = \"__nqtr-stage__\";\nexport default class StageStoredClass extends StoredClassModel implements StageBaseInternalInterface {\n constructor(\n id: string,\n options: {\n /**\n * The function that will be executed when the stage starts.\n */\n onStart?: (stage: StageInterface, props: OnRunProps) => void;\n /**\n * The function that will be executed when the stage ends.\n */\n onEnd?: (stage: StageInterface, props: OnRunProps) => void;\n /**\n * The day required to start the stage.\n * @example If the value is 3, and the previous stage ends on day 1, the stage will start on day 4.\n */\n daysRequiredToStart?: number;\n /**\n * The quests required to start the stage.\n * @default []\n */\n questsRequiredToStart?: QuestsRequiredType[];\n } = {}\n ) {\n super(STAGE_CATEGORY, id);\n this._onStart = options.onStart;\n this._onEnd = options.onEnd;\n this._daysRequiredToStart = options.daysRequiredToStart;\n this._questsRequiredToStart = options.questsRequiredToStart || [];\n }\n\n private _onStart?: (stage: StageInterface, props: OnRunProps) => void;\n get onStart(): undefined | ((stage: StageInterface, props: OnRunProps) => void) {\n return this._onStart;\n }\n\n private _onEnd?: (stage: StageInterface, props: OnRunProps) => void;\n get onEnd(): undefined | ((stage: StageInterface, props: OnRunProps) => void) {\n return this._onEnd;\n }\n\n get completed(): boolean {\n return this.getStorageProperty<boolean>(\"completed\") || false;\n }\n set completed(value: boolean) {\n this.setStorageProperty(\"completed\", value);\n }\n\n get started(): boolean {\n return this.getStorageProperty<boolean>(\"started\") || false;\n }\n set started(value: boolean) {\n this.setStorageProperty(\"started\", value);\n }\n\n private get prevStageEndDay(): number | undefined {\n return this.getStorageProperty<number>(\"prevStageEndDay\");\n }\n private set prevStageEndDay(value: number | undefined) {\n this.setStorageProperty(\"prevStageEndDay\", value);\n }\n\n get startDay(): number | undefined {\n let prevStageEndDay = this.prevStageEndDay;\n if (prevStageEndDay === undefined) {\n return undefined;\n }\n return prevStageEndDay + this.daysRequiredToStart;\n }\n\n get canStart(): boolean {\n let daysRequired = this.daysRequiredToStart;\n if (daysRequired > 0) {\n let prevStageEndDay = this.prevStageEndDay;\n if (prevStageEndDay === undefined) {\n return false;\n }\n if (prevStageEndDay + daysRequired > timeTracker.currentDay) {\n return false;\n }\n }\n if (\n this.questsRequiredToStart.length > 0 &&\n !this.questsRequiredToStart.every(\n (q) => q.quest.currentStageIndex && q.quest.currentStageIndex >= q.stageNumber\n )\n ) {\n return false;\n }\n return true;\n }\n\n inizialize() {\n if (this.daysRequiredToStart > 0) {\n this.prevStageEndDay = timeTracker.currentDay;\n console.log(`[NQTR] Stage ${this.id} will start on day ${this.startDay}`);\n }\n }\n\n start(props: OnRunProps) {\n if (this.canStart) {\n this.started = true;\n if (this.onStart) {\n this.onStart(this as any as StageInterface, props);\n }\n } else {\n console.warn(`[NQTR] Stage ${this.id} can't start`);\n }\n }\n\n private _daysRequiredToStart?: number;\n get daysRequiredToStart(): number {\n return this._daysRequiredToStart || 0;\n }\n\n private _questsRequiredToStart: QuestsRequiredType[];\n get questsRequiredToStart(): QuestsRequiredType[] {\n return this._questsRequiredToStart || [];\n }\n}\n","import { getFlag } from \"@drincs/pixi-vn\";\nimport { StageProps } from \"../../interface\";\nimport StageFlags from \"../../interface/quest/StageFlags\";\nimport StageStoredClass from \"./StageStoredClass\";\n\nexport default class StageBaseModel extends StageStoredClass {\n\tconstructor(id: string, props: StageProps) {\n\t\tsuper(id, {\n\t\t\tonStart: props.onStart,\n\t\t\tonEnd: props.onEnd,\n\t\t\tdaysRequiredToStart: props.daysRequiredToStart,\n\t\t\tquestsRequiredToStart: props.questsRequiredToStart,\n\t\t});\n\t\tthis._name = props.name || \"\";\n\t\tthis._flags = props.flags || [];\n\t\tthis._description = props.description || \"\";\n\t\tthis._adviceDescription = props.adviceDescription || \"\";\n\t\tthis._image = props.image;\n\t\tthis._flagsRequiredToStart = props.flagsRequiredToStart || [];\n\t\tthis._requestDescriptionToStart = props.requestDescriptionToStart || \"\";\n\t}\n\n\tprivate _name: string;\n\t/**\n\t * The name of the stage.\n\t */\n\tget name(): string {\n\t\treturn this._name;\n\t}\n\n\tprivate _description: string;\n\t/**\n\t * The description of the stage.\n\t */\n\tget description(): string {\n\t\treturn this._description;\n\t}\n\n\tprivate _adviceDescription: string;\n\t/**\n\t * The advice description of the stage.\n\t */\n\tget adviceDescription(): string {\n\t\treturn this._adviceDescription;\n\t}\n\n\tprivate _image?: string;\n\t/**\n\t * The image of the stage.\n\t */\n\tget image(): string | undefined {\n\t\treturn this._image;\n\t}\n\n\tprivate _flags: StageFlags[];\n\t/**\n\t * The list of flags that the player must complete to finish the stage.\n\t */\n\tget flags(): StageFlags[] {\n\t\treturn this._flags;\n\t}\n\n\tprivate _flagsRequiredToStart: StageFlags[];\n\t/**\n\t * The list of flags required to start the stage.\n\t */\n\tget flagsRequiredToStart(): StageFlags[] {\n\t\treturn this._flagsRequiredToStart;\n\t}\n\n\tprivate _requestDescriptionToStart: string;\n\t/**\n\t * The description of the request to start the stage.\n\t */\n\tget requestDescriptionToStart(): string {\n\t\treturn this._requestDescriptionToStart;\n\t}\n\n\toverride get completed(): boolean {\n\t\tif (super.completed) {\n\t\t\treturn true;\n\t\t}\n\t\tif (this.flags.length > 0) {\n\t\t\tif (!this.flags.every((flag) => getFlag(flag.flag))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\toverride set completed(value: boolean) {\n\t\tsuper.completed = value;\n\t}\n\toverride get canStart(): boolean {\n\t\tif (this.flagsRequiredToStart.length > 0 && !this.flagsRequiredToStart.every((flag) => getFlag(flag.flag))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn super.canStart;\n\t}\n}\n"]}
@@ -1,2 +1,2 @@
1
- import {getFlag,StoredClassModel,storage}from'@drincs/pixi-vn';var s="___nqtr-time_manager_data___";var n=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var f=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:a=1,timeSlots:C=[],weekLength:m=7,weekendStartDay:D=m-1,weekDaysNames:v=[]}=e;n.minDayHours=t,n.maxDayHours=r,n.defaultTimeSpent=a,n.timeSlots=C,n.weekLength=m,D>=n.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${m}, so will be ignored`):n.weekendStartDay=D,v.length!==m?console.warn(`[NQTR] Week days names should be equal to week length ${m}, so will be ignored`):n.weekDaysNames=v;}get minDayHours(){return n.minDayHours}get maxDayHours(){return n.maxDayHours}get defaultTimeSpent(){return n.defaultTimeSpent}get timeSlots(){return n.timeSlots}get weekLength(){return n.weekLength}get weekendStartDay(){return n.weekendStartDay}get weekDaysNames(){return n.weekDaysNames}get currentHour(){let e=storage.getVariable(s)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=storage.getVariable(s)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,storage.setVariable(s,t);}get currentDay(){let e=storage.getVariable(s)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=storage.getVariable(s)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,storage.setVariable(s,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}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.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var _=new f;var k="__nqtr-stage__",g=class extends StoredClassModel{constructor(e,t={}){super(k,e),this._onStart=t.onStart,this._onEnd=t.onEnd,this._daysRequiredToStart=t.daysRequiredToStart,this._questsRequiredToStart=t.questsRequiredToStart||[];}_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 prevStageEndDay(){return this.getStorageProperty("prevStageEndDay")}set prevStageEndDay(e){this.setStorageProperty("prevStageEndDay",e);}get startDay(){let e=this.prevStageEndDay;if(e!==undefined)return e+this.daysRequiredToStart}get canStart(){let e=this.daysRequiredToStart;if(e>0){let t=this.prevStageEndDay;if(t===undefined||t+e>_.currentDay)return false}return !(this.questsRequiredToStart.length>0&&!this.questsRequiredToStart.every(t=>t.quest.currentStageIndex&&t.quest.currentStageIndex>=t.stageNumber))}inizialize(){this.daysRequiredToStart>0&&(this.prevStageEndDay=_.currentDay,console.log(`[NQTR] Stage ${this.id} will start on day ${this.startDay}`));}start(e){this.canStart?(this.started=true,this.onStart&&this.onStart(this,e)):console.warn(`[NQTR] Stage ${this.id} can't start`);}_daysRequiredToStart;get daysRequiredToStart(){return this._daysRequiredToStart||0}_questsRequiredToStart;get questsRequiredToStart(){return this._questsRequiredToStart||[]}};var I=class extends g{constructor(e,t){super(e,{onStart:t.onStart,onEnd:t.onEnd,daysRequiredToStart:t.daysRequiredToStart,questsRequiredToStart:t.questsRequiredToStart}),this._name=t.name||"",this._flags=t.flags||[],this._description=t.description||"",this._adviceDescription=t.adviceDescription||"",this._image=t.image,this._flagsRequiredToStart=t.flagsRequiredToStart||[],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}_flagsRequiredToStart;get flagsRequiredToStart(){return this._flagsRequiredToStart}_requestDescriptionToStart;get requestDescriptionToStart(){return this._requestDescriptionToStart}get completed(){return super.completed?true:this.flags.length>0?!!this.flags.every(e=>getFlag(e.flag)):false}set completed(e){super.completed=e;}get canStart(){return this.flagsRequiredToStart.length>0&&!this.flagsRequiredToStart.every(e=>getFlag(e.flag))?false:super.canStart}};export{I as default};//# sourceMappingURL=StageBaseModel.mjs.map
1
+ import {getFlag,StoredClassModel,storage}from'@drincs/pixi-vn';var s="___nqtr-time_manager_data___";var n=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var l=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:a=1,timeSlots:C=[],weekLength:m=7,weekendStartDay:D=m-1,weekDaysNames:v=[]}=e;n.minDayHours=t,n.maxDayHours=r,n.defaultTimeSpent=a,n.timeSlots=C,n.weekLength=m,D>=n.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${m}, so will be ignored`):n.weekendStartDay=D,v.length!==m?console.warn(`[NQTR] Week days names should be equal to week length ${m}, so will be ignored`):n.weekDaysNames=v;}get minDayHours(){return n.minDayHours}get maxDayHours(){return n.maxDayHours}get defaultTimeSpent(){return n.defaultTimeSpent}get timeSlots(){return n.timeSlots}get weekLength(){return n.weekLength}get weekendStartDay(){return n.weekendStartDay}get weekDaysNames(){return n.weekDaysNames}get currentHour(){let e=storage.getVariable(s)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=storage.getVariable(s)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,storage.setVariable(s,t);}get currentDay(){let e=storage.getVariable(s)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=storage.getVariable(s)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,storage.setVariable(s,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}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.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours-1),t===undefined&&(t=this.maxDayHours+1);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var _=new l;var k="__nqtr-stage__",g=class extends StoredClassModel{constructor(e,t={}){super(k,e),this._onStart=t.onStart,this._onEnd=t.onEnd,this._daysRequiredToStart=t.daysRequiredToStart,this._questsRequiredToStart=t.questsRequiredToStart||[];}_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 prevStageEndDay(){return this.getStorageProperty("prevStageEndDay")}set prevStageEndDay(e){this.setStorageProperty("prevStageEndDay",e);}get startDay(){let e=this.prevStageEndDay;if(e!==undefined)return e+this.daysRequiredToStart}get canStart(){let e=this.daysRequiredToStart;if(e>0){let t=this.prevStageEndDay;if(t===undefined||t+e>_.currentDay)return false}return !(this.questsRequiredToStart.length>0&&!this.questsRequiredToStart.every(t=>t.quest.currentStageIndex&&t.quest.currentStageIndex>=t.stageNumber))}inizialize(){this.daysRequiredToStart>0&&(this.prevStageEndDay=_.currentDay,console.log(`[NQTR] Stage ${this.id} will start on day ${this.startDay}`));}start(e){this.canStart?(this.started=true,this.onStart&&this.onStart(this,e)):console.warn(`[NQTR] Stage ${this.id} can't start`);}_daysRequiredToStart;get daysRequiredToStart(){return this._daysRequiredToStart||0}_questsRequiredToStart;get questsRequiredToStart(){return this._questsRequiredToStart||[]}};var I=class extends g{constructor(e,t){super(e,{onStart:t.onStart,onEnd:t.onEnd,daysRequiredToStart:t.daysRequiredToStart,questsRequiredToStart:t.questsRequiredToStart}),this._name=t.name||"",this._flags=t.flags||[],this._description=t.description||"",this._adviceDescription=t.adviceDescription||"",this._image=t.image,this._flagsRequiredToStart=t.flagsRequiredToStart||[],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}_flagsRequiredToStart;get flagsRequiredToStart(){return this._flagsRequiredToStart}_requestDescriptionToStart;get requestDescriptionToStart(){return this._requestDescriptionToStart}get completed(){return super.completed?true:this.flags.length>0?!!this.flags.every(e=>getFlag(e.flag)):false}set completed(e){super.completed=e;}get canStart(){return this.flagsRequiredToStart.length>0&&!this.flagsRequiredToStart.every(e=>getFlag(e.flag))?false:super.canStart}};export{I as default};//# sourceMappingURL=StageBaseModel.mjs.map
2
2
  //# sourceMappingURL=StageBaseModel.mjs.map