@drincs/nqtr 0.3.0 → 0.3.2

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 (233) hide show
  1. package/dist/{RoomInterface-D7qXKwBI.d.ts → RoomInterface-BglEhkQT.d.ts} +12 -12
  2. package/dist/{RoomInterface-C7Sg80EF.d.mts → RoomInterface-DsZAp6Pv.d.mts} +12 -12
  3. package/dist/{StageInterface-DmLgfrk4.d.mts → StageInterface-DJ7l0ubG.d.mts} +17 -17
  4. package/dist/{StageInterface-DmLgfrk4.d.ts → StageInterface-DJ7l0ubG.d.ts} +17 -17
  5. package/dist/classes/ActivityBaseModel.d.mts +4 -4
  6. package/dist/classes/ActivityBaseModel.d.ts +4 -4
  7. package/dist/classes/ActivityBaseModel.js +1 -1
  8. package/dist/classes/ActivityBaseModel.js.map +1 -1
  9. package/dist/classes/ActivityBaseModel.mjs +1 -1
  10. package/dist/classes/ActivityBaseModel.mjs.map +1 -1
  11. package/dist/classes/ActivityStoredClass.d.mts +4 -4
  12. package/dist/classes/ActivityStoredClass.d.ts +4 -4
  13. package/dist/classes/ActivityStoredClass.js +1 -1
  14. package/dist/classes/ActivityStoredClass.js.map +1 -1
  15. package/dist/classes/ActivityStoredClass.mjs +1 -1
  16. package/dist/classes/ActivityStoredClass.mjs.map +1 -1
  17. package/dist/classes/CommitmentBaseModel.d.mts +3 -3
  18. package/dist/classes/CommitmentBaseModel.d.ts +3 -3
  19. package/dist/classes/CommitmentBaseModel.js +1 -1
  20. package/dist/classes/CommitmentBaseModel.js.map +1 -1
  21. package/dist/classes/CommitmentBaseModel.mjs +1 -1
  22. package/dist/classes/CommitmentBaseModel.mjs.map +1 -1
  23. package/dist/classes/CommitmentStoredClass.d.mts +5 -5
  24. package/dist/classes/CommitmentStoredClass.d.ts +5 -5
  25. package/dist/classes/CommitmentStoredClass.js +1 -1
  26. package/dist/classes/CommitmentStoredClass.js.map +1 -1
  27. package/dist/classes/CommitmentStoredClass.mjs +1 -1
  28. package/dist/classes/CommitmentStoredClass.mjs.map +1 -1
  29. package/dist/classes/index.d.mts +6 -6
  30. package/dist/classes/index.d.ts +6 -6
  31. package/dist/classes/index.js +1 -1
  32. package/dist/classes/index.js.map +1 -1
  33. package/dist/classes/index.mjs +1 -1
  34. package/dist/classes/index.mjs.map +1 -1
  35. package/dist/classes/navigation/LocationBaseModel.d.mts +3 -3
  36. package/dist/classes/navigation/LocationBaseModel.d.ts +3 -3
  37. package/dist/classes/navigation/LocationBaseModel.js +1 -1
  38. package/dist/classes/navigation/LocationBaseModel.mjs +1 -1
  39. package/dist/classes/navigation/LocationStoredClass.d.mts +6 -6
  40. package/dist/classes/navigation/LocationStoredClass.d.ts +6 -6
  41. package/dist/classes/navigation/LocationStoredClass.js +1 -1
  42. package/dist/classes/navigation/LocationStoredClass.mjs +1 -1
  43. package/dist/classes/navigation/MapBaseModel.d.mts +2 -2
  44. package/dist/classes/navigation/MapBaseModel.d.ts +2 -2
  45. package/dist/classes/navigation/MapBaseModel.js +1 -1
  46. package/dist/classes/navigation/MapBaseModel.mjs +1 -1
  47. package/dist/classes/navigation/MapStoredClass.d.mts +5 -5
  48. package/dist/classes/navigation/MapStoredClass.d.ts +5 -5
  49. package/dist/classes/navigation/NavigationAbstractClass.d.mts +6 -6
  50. package/dist/classes/navigation/NavigationAbstractClass.d.ts +6 -6
  51. package/dist/classes/navigation/NavigationAbstractClass.js +1 -1
  52. package/dist/classes/navigation/NavigationAbstractClass.mjs +1 -1
  53. package/dist/classes/navigation/RoomBaseModel.d.mts +4 -4
  54. package/dist/classes/navigation/RoomBaseModel.d.ts +4 -4
  55. package/dist/classes/navigation/RoomBaseModel.js +1 -1
  56. package/dist/classes/navigation/RoomBaseModel.mjs +1 -1
  57. package/dist/classes/navigation/RoomStoredClass.d.mts +6 -6
  58. package/dist/classes/navigation/RoomStoredClass.d.ts +6 -6
  59. package/dist/classes/navigation/RoomStoredClass.js +1 -1
  60. package/dist/classes/navigation/RoomStoredClass.mjs +1 -1
  61. package/dist/classes/quest/QuestBaseModel.d.mts +3 -3
  62. package/dist/classes/quest/QuestBaseModel.d.ts +3 -3
  63. package/dist/classes/quest/QuestBaseModel.js +1 -1
  64. package/dist/classes/quest/QuestBaseModel.js.map +1 -1
  65. package/dist/classes/quest/QuestBaseModel.mjs +1 -1
  66. package/dist/classes/quest/QuestBaseModel.mjs.map +1 -1
  67. package/dist/classes/quest/QuestStoredClass.d.mts +14 -14
  68. package/dist/classes/quest/QuestStoredClass.d.ts +14 -14
  69. package/dist/classes/quest/QuestStoredClass.js +1 -1
  70. package/dist/classes/quest/QuestStoredClass.js.map +1 -1
  71. package/dist/classes/quest/QuestStoredClass.mjs +1 -1
  72. package/dist/classes/quest/QuestStoredClass.mjs.map +1 -1
  73. package/dist/classes/quest/StageBaseModel.d.mts +2 -2
  74. package/dist/classes/quest/StageBaseModel.d.ts +2 -2
  75. package/dist/classes/quest/StageBaseModel.js +1 -1
  76. package/dist/classes/quest/StageBaseModel.js.map +1 -1
  77. package/dist/classes/quest/StageBaseModel.mjs +1 -1
  78. package/dist/classes/quest/StageBaseModel.mjs.map +1 -1
  79. package/dist/classes/quest/StageStoredClass.d.mts +7 -7
  80. package/dist/classes/quest/StageStoredClass.d.ts +7 -7
  81. package/dist/classes/quest/StageStoredClass.js +1 -1
  82. package/dist/classes/quest/StageStoredClass.js.map +1 -1
  83. package/dist/classes/quest/StageStoredClass.mjs +1 -1
  84. package/dist/classes/quest/StageStoredClass.mjs.map +1 -1
  85. package/dist/decorators/ActivityDecorator.d.mts +5 -5
  86. package/dist/decorators/ActivityDecorator.d.ts +5 -5
  87. package/dist/decorators/CommitmentDecorator.d.mts +6 -6
  88. package/dist/decorators/CommitmentDecorator.d.ts +6 -6
  89. package/dist/decorators/QuestDecorator.d.mts +5 -5
  90. package/dist/decorators/QuestDecorator.d.ts +5 -5
  91. package/dist/decorators/RoomDecorator.d.mts +5 -5
  92. package/dist/decorators/RoomDecorator.d.ts +5 -5
  93. package/dist/decorators/index.d.mts +3 -3
  94. package/dist/decorators/index.d.ts +3 -3
  95. package/dist/index.d.mts +11 -8
  96. package/dist/index.d.ts +11 -8
  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 +3 -3
  102. package/dist/interface/ActivityInterface.d.ts +3 -3
  103. package/dist/interface/CommitmentInterface.d.mts +2 -2
  104. package/dist/interface/CommitmentInterface.d.ts +2 -2
  105. package/dist/interface/CommitmentProps.d.mts +3 -3
  106. package/dist/interface/CommitmentProps.d.ts +3 -3
  107. package/dist/interface/index.d.mts +3 -3
  108. package/dist/interface/index.d.ts +3 -3
  109. package/dist/interface/navigation/LocationBaseModelProps.d.mts +3 -3
  110. package/dist/interface/navigation/LocationBaseModelProps.d.ts +3 -3
  111. package/dist/interface/navigation/LocationInterface.d.mts +2 -2
  112. package/dist/interface/navigation/LocationInterface.d.ts +2 -2
  113. package/dist/interface/navigation/MapBaseModelProps.d.mts +3 -3
  114. package/dist/interface/navigation/MapBaseModelProps.d.ts +3 -3
  115. package/dist/interface/navigation/MapInterface.d.mts +2 -2
  116. package/dist/interface/navigation/MapInterface.d.ts +2 -2
  117. package/dist/interface/navigation/NavigationAbstractClass.d.mts +5 -5
  118. package/dist/interface/navigation/NavigationAbstractClass.d.ts +5 -5
  119. package/dist/interface/navigation/RoomBaseModelProps.d.mts +3 -3
  120. package/dist/interface/navigation/RoomBaseModelProps.d.ts +3 -3
  121. package/dist/interface/navigation/RoomInterface.d.mts +2 -2
  122. package/dist/interface/navigation/RoomInterface.d.ts +2 -2
  123. package/dist/interface/quest/QuestInterface.d.mts +2 -2
  124. package/dist/interface/quest/QuestInterface.d.ts +2 -2
  125. package/dist/interface/quest/QuestProps.d.mts +4 -4
  126. package/dist/interface/quest/QuestProps.d.ts +4 -4
  127. package/dist/interface/quest/StageInterface.d.mts +2 -2
  128. package/dist/interface/quest/StageInterface.d.ts +2 -2
  129. package/dist/interface/quest/StageProps.d.mts +4 -4
  130. package/dist/interface/quest/StageProps.d.ts +4 -4
  131. package/dist/managers/NavigatorManager.d.mts +9 -9
  132. package/dist/managers/NavigatorManager.d.ts +9 -9
  133. package/dist/managers/QuestManager.d.mts +9 -9
  134. package/dist/managers/QuestManager.d.ts +9 -9
  135. package/dist/managers/QuestManager.js +1 -1
  136. package/dist/managers/QuestManager.js.map +1 -1
  137. package/dist/managers/QuestManager.mjs +1 -1
  138. package/dist/managers/QuestManager.mjs.map +1 -1
  139. package/dist/managers/RoutineManager.d.mts +12 -12
  140. package/dist/managers/RoutineManager.d.ts +12 -12
  141. package/dist/managers/RoutineManager.js +1 -1
  142. package/dist/managers/RoutineManager.mjs +1 -1
  143. package/dist/managers/index.d.mts +3 -3
  144. package/dist/managers/index.d.ts +3 -3
  145. package/dist/managers/index.js +1 -1
  146. package/dist/managers/index.js.map +1 -1
  147. package/dist/managers/index.mjs +1 -1
  148. package/dist/managers/index.mjs.map +1 -1
  149. package/dist/nqtr.d.d.mts +195 -0
  150. package/dist/nqtr.d.d.ts +195 -0
  151. package/dist/nqtr.d.js +2 -0
  152. package/dist/nqtr.d.js.map +1 -0
  153. package/dist/nqtr.d.mjs +2 -0
  154. package/dist/nqtr.d.mjs.map +1 -0
  155. package/dist/types/OnRunEvent.d.mts +3 -2
  156. package/dist/types/OnRunEvent.d.ts +3 -2
  157. package/dist/types/QuestsRequired.d.mts +2 -2
  158. package/dist/types/QuestsRequired.d.ts +2 -2
  159. package/dist/types/index.d.mts +3 -2
  160. package/dist/types/index.d.ts +3 -2
  161. package/package.json +1 -2
  162. package/dist/override/ActivityInterface.d.mts +0 -28
  163. package/dist/override/ActivityInterface.d.ts +0 -28
  164. package/dist/override/ActivityInterface.js +0 -2
  165. package/dist/override/ActivityInterface.js.map +0 -1
  166. package/dist/override/ActivityInterface.mjs +0 -2
  167. package/dist/override/ActivityInterface.mjs.map +0 -1
  168. package/dist/override/CommitmentInterface.d.mts +0 -24
  169. package/dist/override/CommitmentInterface.d.ts +0 -24
  170. package/dist/override/CommitmentInterface.js +0 -2
  171. package/dist/override/CommitmentInterface.js.map +0 -1
  172. package/dist/override/CommitmentInterface.mjs +0 -2
  173. package/dist/override/CommitmentInterface.mjs.map +0 -1
  174. package/dist/override/GraphicItemInterface.d.mts +0 -19
  175. package/dist/override/GraphicItemInterface.d.ts +0 -19
  176. package/dist/override/GraphicItemInterface.js +0 -2
  177. package/dist/override/GraphicItemInterface.js.map +0 -1
  178. package/dist/override/GraphicItemInterface.mjs +0 -2
  179. package/dist/override/GraphicItemInterface.mjs.map +0 -1
  180. package/dist/override/LocationInterface.d.mts +0 -29
  181. package/dist/override/LocationInterface.d.ts +0 -29
  182. package/dist/override/LocationInterface.js +0 -2
  183. package/dist/override/LocationInterface.js.map +0 -1
  184. package/dist/override/LocationInterface.mjs +0 -2
  185. package/dist/override/LocationInterface.mjs.map +0 -1
  186. package/dist/override/MapInterface.d.mts +0 -12
  187. package/dist/override/MapInterface.d.ts +0 -12
  188. package/dist/override/MapInterface.js +0 -2
  189. package/dist/override/MapInterface.js.map +0 -1
  190. package/dist/override/MapInterface.mjs +0 -2
  191. package/dist/override/MapInterface.mjs.map +0 -1
  192. package/dist/override/OnRenderGraphicItemProps.d.mts +0 -19
  193. package/dist/override/OnRenderGraphicItemProps.d.ts +0 -19
  194. package/dist/override/OnRenderGraphicItemProps.js +0 -2
  195. package/dist/override/OnRenderGraphicItemProps.js.map +0 -1
  196. package/dist/override/OnRenderGraphicItemProps.mjs +0 -2
  197. package/dist/override/OnRenderGraphicItemProps.mjs.map +0 -1
  198. package/dist/override/OnRunProps.d.mts +0 -19
  199. package/dist/override/OnRunProps.d.ts +0 -19
  200. package/dist/override/OnRunProps.js +0 -2
  201. package/dist/override/OnRunProps.js.map +0 -1
  202. package/dist/override/OnRunProps.mjs +0 -2
  203. package/dist/override/OnRunProps.mjs.map +0 -1
  204. package/dist/override/OnStartEndStageQuest.d.mts +0 -19
  205. package/dist/override/OnStartEndStageQuest.d.ts +0 -19
  206. package/dist/override/OnStartEndStageQuest.js +0 -2
  207. package/dist/override/OnStartEndStageQuest.js.map +0 -1
  208. package/dist/override/OnStartEndStageQuest.mjs +0 -2
  209. package/dist/override/OnStartEndStageQuest.mjs.map +0 -1
  210. package/dist/override/QuestInterface.d.mts +0 -24
  211. package/dist/override/QuestInterface.d.ts +0 -24
  212. package/dist/override/QuestInterface.js +0 -2
  213. package/dist/override/QuestInterface.js.map +0 -1
  214. package/dist/override/QuestInterface.mjs +0 -2
  215. package/dist/override/QuestInterface.mjs.map +0 -1
  216. package/dist/override/RoomInterface.d.mts +0 -33
  217. package/dist/override/RoomInterface.d.ts +0 -33
  218. package/dist/override/RoomInterface.js +0 -2
  219. package/dist/override/RoomInterface.js.map +0 -1
  220. package/dist/override/RoomInterface.mjs +0 -2
  221. package/dist/override/RoomInterface.mjs.map +0 -1
  222. package/dist/override/StageInterface.d.mts +0 -34
  223. package/dist/override/StageInterface.d.ts +0 -34
  224. package/dist/override/StageInterface.js +0 -2
  225. package/dist/override/StageInterface.js.map +0 -1
  226. package/dist/override/StageInterface.mjs +0 -2
  227. package/dist/override/StageInterface.mjs.map +0 -1
  228. package/dist/override/index.d.mts +0 -12
  229. package/dist/override/index.d.ts +0 -12
  230. package/dist/override/index.js +0 -2
  231. package/dist/override/index.js.map +0 -1
  232. package/dist/override/index.mjs +0 -2
  233. package/dist/override/index.mjs.map +0 -1
@@ -1,17 +1,17 @@
1
- import { OnStartEndStageQuest } from '@drincs/nqtr/dist/override';
1
+ import { OnRunProps } from '@drincs/nqtr';
2
2
  import { StoredClassModel } from '@drincs/pixi-vn';
3
- import { c as StageBaseInternalInterface, S as StageBaseInterface, a as QuestsRequiredType } from '../../StageInterface-DmLgfrk4.js';
3
+ import { c as StageBaseInternalInterface, S as StageInterface, a as QuestsRequiredType } from '../../StageInterface-DJ7l0ubG.js';
4
4
 
5
5
  declare class StageStoredClass extends StoredClassModel implements StageBaseInternalInterface {
6
6
  constructor(id: string, options?: {
7
7
  /**
8
8
  * The function that will be executed when the stage starts.
9
9
  */
10
- onStart?: (stage: StageBaseInterface, props: OnStartEndStageQuest) => void;
10
+ onStart?: (stage: StageInterface, props: OnRunProps) => void;
11
11
  /**
12
12
  * The function that will be executed when the stage ends.
13
13
  */
14
- onEnd?: (stage: StageBaseInterface, props: OnStartEndStageQuest) => void;
14
+ onEnd?: (stage: StageInterface, props: OnRunProps) => void;
15
15
  /**
16
16
  * The day required to start the stage.
17
17
  * @example If the value is 3, and the previous stage ends on day 1, the stage will start on day 4.
@@ -24,9 +24,9 @@ declare class StageStoredClass extends StoredClassModel implements StageBaseInte
24
24
  questsRequiredToStart?: QuestsRequiredType[];
25
25
  });
26
26
  private _onStart?;
27
- get onStart(): undefined | ((stage: StageBaseInterface, props: OnStartEndStageQuest) => void);
27
+ get onStart(): undefined | ((stage: StageInterface, props: OnRunProps) => void);
28
28
  private _onEnd?;
29
- get onEnd(): undefined | ((stage: StageBaseInterface, props: OnStartEndStageQuest) => void);
29
+ get onEnd(): undefined | ((stage: StageInterface, props: OnRunProps) => void);
30
30
  get completed(): boolean;
31
31
  set completed(value: boolean);
32
32
  get started(): boolean;
@@ -36,7 +36,7 @@ declare class StageStoredClass extends StoredClassModel implements StageBaseInte
36
36
  get startDay(): number | undefined;
37
37
  get canStart(): boolean;
38
38
  inizialize(): void;
39
- start(props: OnStartEndStageQuest): void;
39
+ start(props: OnRunProps): void;
40
40
  private _daysRequiredToStart?;
41
41
  get daysRequiredToStart(): number;
42
42
  private _questsRequiredToStart;
@@ -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 l=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:x=[],weekLength:m=7,weekendStartDay:D=m-1,weekDaysNames:_=[]}=e;n.minDayHours=t,n.maxDayHours=r,n.defaultTimeSpent=i,n.timeSlots=x,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,_.length!==m?console.warn(`[NQTR] Week days names should be equal to week length ${m}, so will be ignored`):n.weekDaysNames=_;}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 b=new l;var N="__nqtr-stage__",I=class extends pixiVn.StoredClassModel{constructor(e,t={}){super(N,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>b.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=b.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||[]}};module.exports=I;//# sourceMappingURL=StageStoredClass.js.map
1
+ 'use strict';var pixiVn=require('@drincs/pixi-vn');var o="___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:x=[],weekLength:m=7,weekendStartDay:D=m-1,weekDaysNames:_=[]}=e;n.minDayHours=t,n.maxDayHours=r,n.defaultTimeSpent=a,n.timeSlots=x,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,_.length!==m?console.warn(`[NQTR] Week days names should be equal to week length ${m}, so will be ignored`):n.weekDaysNames=_;}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(o)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=pixiVn.storage.getVariable(o)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,pixiVn.storage.setVariable(o,t);}get currentDay(){let e=pixiVn.storage.getVariable(o)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=pixiVn.storage.getVariable(o)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,pixiVn.storage.setVariable(o,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 b=new l;var N="__nqtr-stage__",I=class extends pixiVn.StoredClassModel{constructor(e,t={}){super(N,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>b.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=b.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||[]}};module.exports=I;//# sourceMappingURL=StageStoredClass.js.map
2
2
  //# sourceMappingURL=StageStoredClass.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"],"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"],"mappings":"mDACO,IAAMA,EAAgB,8BCC7B,CAAA,IAAqBC,EAArB,KAAiE,CAC7D,OAAO,WAAA,CAAsB,EAC7B,OAAO,WAAA,CAAsB,GAC7B,OAAO,gBAAA,CAA2B,EAClC,OAAO,SAAA,CAA0B,EAAC,CAClC,OAAO,UAAqB,CAAA,CAAA,CAC5B,OAAO,eAA0B,CAAA,IAAA,CAAK,WAAa,CACnD,CAAA,OAAO,aAA0B,CAAA,EACrC,CCJA,CAAA,IAAqBC,EAArB,KAAiC,CAC7B,WAAWC,CAAwB,CAAA,CAC/B,GAAM,CACF,YAAAC,CAAc,CAAA,CAAA,CACd,YAAAC,CAAc,CAAA,EAAA,CACd,iBAAAC,CAAmB,CAAA,CAAA,CACnB,SAAAC,CAAAA,CAAAA,CAAY,EACZ,CAAA,UAAA,CAAAC,EAAa,CACb,CAAA,eAAA,CAAAC,EAAkBD,CAAa,CAAA,CAAA,CAC/B,aAAAE,CAAAA,CAAAA,CAAgB,EACpB,CAAA,CAAIP,EACJF,CAAoB,CAAA,WAAA,CAAcG,EAClCH,CAAoB,CAAA,WAAA,CAAcI,CAClCJ,CAAAA,CAAAA,CAAoB,iBAAmBK,CACvCL,CAAAA,CAAAA,CAAoB,UAAYM,CAChCN,CAAAA,CAAAA,CAAoB,WAAaO,CAC7BC,CAAAA,CAAAA,EAAmBR,CAAoB,CAAA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S,CAAMA,EAAAA,CAAAA,CAAE,MAAM,iBAAqBA,EAAAA,CAAAA,CAAE,MAAM,iBAAqBA,EAAAA,CAAAA,CAAE,WACpE,CAAA,CAKF,CAEA,UAAa,EAAA,CACR,KAAK,mBAAsB,CAAA,CAAA,GAC9B,KAAK,eAAkBT,CAAAA,CAAAA,CAAY,UACnC,CAAA,OAAA,CAAQ,IAAI,CAAgB,aAAA,EAAA,IAAA,CAAK,EAAE,CAAsB,mBAAA,EAAA,IAAA,CAAK,QAAQ,CAAE,CAAA,CAAA,EAE1E,CAEA,KAAA,CAAMU,EAA6B,CAC9B,IAAA,CAAK,UACR,IAAK,CAAA,OAAA,CAAU,KACX,IAAK,CAAA,OAAA,EACR,IAAK,CAAA,OAAA,CAAQ,KAA+BA,CAAK,CAAA,EAGlD,QAAQ,IAAK,CAAA,CAAA,aAAA,EAAgB,KAAK,EAAE,CAAA,YAAA,CAAc,EAEpD,CAEQ,qBACR,IAAI,mBAAA,EAA8B,CACjC,OAAO,IAAA,CAAK,sBAAwB,CACrC,CAEQ,sBACR,CAAA,IAAI,uBAA8C,CACjD,OAAO,KAAK,sBAA0B,EAAA,EACvC,CACD","file":"StageStoredClass.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 { OnStartEndStageQuest } from \"@drincs/nqtr/dist/override\";\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\tconstructor(\n\t\tid: string,\n\t\toptions: {\n\t\t\t/**\n\t\t\t * The function that will be executed when the stage starts.\n\t\t\t */\n\t\t\tonStart?: (stage: StageInterface, props: OnStartEndStageQuest) => void;\n\t\t\t/**\n\t\t\t * The function that will be executed when the stage ends.\n\t\t\t */\n\t\t\tonEnd?: (stage: StageInterface, props: OnStartEndStageQuest) => void;\n\t\t\t/**\n\t\t\t * The day required to start the stage.\n\t\t\t * @example If the value is 3, and the previous stage ends on day 1, the stage will start on day 4.\n\t\t\t */\n\t\t\tdaysRequiredToStart?: number;\n\t\t\t/**\n\t\t\t * The quests required to start the stage.\n\t\t\t * @default []\n\t\t\t */\n\t\t\tquestsRequiredToStart?: QuestsRequiredType[];\n\t\t} = {}\n\t) {\n\t\tsuper(STAGE_CATEGORY, id);\n\t\tthis._onStart = options.onStart;\n\t\tthis._onEnd = options.onEnd;\n\t\tthis._daysRequiredToStart = options.daysRequiredToStart;\n\t\tthis._questsRequiredToStart = options.questsRequiredToStart || [];\n\t}\n\n\tprivate _onStart?: (stage: StageInterface, props: OnStartEndStageQuest) => void;\n\tget onStart(): undefined | ((stage: StageInterface, props: OnStartEndStageQuest) => void) {\n\t\treturn this._onStart;\n\t}\n\n\tprivate _onEnd?: (stage: StageInterface, props: OnStartEndStageQuest) => void;\n\tget onEnd(): undefined | ((stage: StageInterface, props: OnStartEndStageQuest) => void) {\n\t\treturn this._onEnd;\n\t}\n\n\tget completed(): boolean {\n\t\treturn this.getStorageProperty<boolean>(\"completed\") || false;\n\t}\n\tset completed(value: boolean) {\n\t\tthis.setStorageProperty(\"completed\", value);\n\t}\n\n\tget started(): boolean {\n\t\treturn this.getStorageProperty<boolean>(\"started\") || false;\n\t}\n\tset started(value: boolean) {\n\t\tthis.setStorageProperty(\"started\", value);\n\t}\n\n\tprivate get prevStageEndDay(): number | undefined {\n\t\treturn this.getStorageProperty<number>(\"prevStageEndDay\");\n\t}\n\tprivate set prevStageEndDay(value: number | undefined) {\n\t\tthis.setStorageProperty(\"prevStageEndDay\", value);\n\t}\n\n\tget startDay(): number | undefined {\n\t\tlet prevStageEndDay = this.prevStageEndDay;\n\t\tif (prevStageEndDay === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn prevStageEndDay + this.daysRequiredToStart;\n\t}\n\n\tget canStart(): boolean {\n\t\tlet daysRequired = this.daysRequiredToStart;\n\t\tif (daysRequired > 0) {\n\t\t\tlet prevStageEndDay = this.prevStageEndDay;\n\t\t\tif (prevStageEndDay === undefined) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (prevStageEndDay + daysRequired > timeTracker.currentDay) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tthis.questsRequiredToStart.length > 0 &&\n\t\t\t!this.questsRequiredToStart.every(\n\t\t\t\t(q) => q.quest.currentStageIndex && q.quest.currentStageIndex >= q.stageNumber\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tinizialize() {\n\t\tif (this.daysRequiredToStart > 0) {\n\t\t\tthis.prevStageEndDay = timeTracker.currentDay;\n\t\t\tconsole.log(`[NQTR] Stage ${this.id} will start on day ${this.startDay}`);\n\t\t}\n\t}\n\n\tstart(props: OnStartEndStageQuest) {\n\t\tif (this.canStart) {\n\t\t\tthis.started = true;\n\t\t\tif (this.onStart) {\n\t\t\t\tthis.onStart(this as any as StageInterface, props);\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.warn(`[NQTR] Stage ${this.id} can't start`);\n\t\t}\n\t}\n\n\tprivate _daysRequiredToStart?: number;\n\tget daysRequiredToStart(): number {\n\t\treturn this._daysRequiredToStart || 0;\n\t}\n\n\tprivate _questsRequiredToStart: QuestsRequiredType[];\n\tget questsRequiredToStart(): QuestsRequiredType[] {\n\t\treturn this._questsRequiredToStart || [];\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"],"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"],"mappings":"mDACO,IAAMA,EAAgB,8BCC7B,CAAA,IAAqBC,EAArB,KAAiE,CAC7D,OAAO,WAAA,CAAsB,EAC7B,OAAO,WAAA,CAAsB,GAC7B,OAAO,gBAAA,CAA2B,EAClC,OAAO,SAAA,CAA0B,EAAC,CAClC,OAAO,UAAqB,CAAA,CAAA,CAC5B,OAAO,eAA0B,CAAA,IAAA,CAAK,WAAa,CACnD,CAAA,OAAO,aAA0B,CAAA,EACrC,CCJA,CAAA,IAAqBC,EAArB,KAAiC,CAC7B,WAAWC,CAAwB,CAAA,CAC/B,GAAM,CACF,YAAAC,CAAc,CAAA,CAAA,CACd,YAAAC,CAAc,CAAA,EAAA,CACd,iBAAAC,CAAmB,CAAA,CAAA,CACnB,SAAAC,CAAAA,CAAAA,CAAY,EACZ,CAAA,UAAA,CAAAC,EAAa,CACb,CAAA,eAAA,CAAAC,EAAkBD,CAAa,CAAA,CAAA,CAC/B,aAAAE,CAAAA,CAAAA,CAAgB,EACpB,CAAA,CAAIP,EACJF,CAAoB,CAAA,WAAA,CAAcG,EAClCH,CAAoB,CAAA,WAAA,CAAcI,CAClCJ,CAAAA,CAAAA,CAAoB,iBAAmBK,CACvCL,CAAAA,CAAAA,CAAoB,UAAYM,CAChCN,CAAAA,CAAAA,CAAoB,WAAaO,CAC7BC,CAAAA,CAAAA,EAAmBR,CAAoB,CAAA,UAAA,CACvC,QAAQ,IAAK,CAAA,CAAA,yDAAA,E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iBAAqBA,EAAAA,CAAAA,CAAE,MAAM,iBAAqBA,EAAAA,CAAAA,CAAE,WACvE,CAAA,CAKR,CAEA,UAAa,EAAA,CACL,KAAK,mBAAsB,CAAA,CAAA,GAC3B,KAAK,eAAkBT,CAAAA,CAAAA,CAAY,UACnC,CAAA,OAAA,CAAQ,IAAI,CAAgB,aAAA,EAAA,IAAA,CAAK,EAAE,CAAsB,mBAAA,EAAA,IAAA,CAAK,QAAQ,CAAE,CAAA,CAAA,EAEhF,CAEA,KAAA,CAAMU,EAAmB,CACjB,IAAA,CAAK,UACL,IAAK,CAAA,OAAA,CAAU,KACX,IAAK,CAAA,OAAA,EACL,IAAK,CAAA,OAAA,CAAQ,KAA+BA,CAAK,CAAA,EAGrD,QAAQ,IAAK,CAAA,CAAA,aAAA,EAAgB,KAAK,EAAE,CAAA,YAAA,CAAc,EAE1D,CAEQ,qBACR,IAAI,mBAAA,EAA8B,CAC9B,OAAO,IAAA,CAAK,sBAAwB,CACxC,CAEQ,sBACR,CAAA,IAAI,uBAA8C,CAC9C,OAAO,KAAK,sBAA0B,EAAA,EAC1C,CACJ","file":"StageStoredClass.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"]}
@@ -1,2 +1,2 @@
1
- import {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:i=1,timeSlots:x=[],weekLength:m=7,weekendStartDay:D=m-1,weekDaysNames:_=[]}=e;n.minDayHours=t,n.maxDayHours=r,n.defaultTimeSpent=i,n.timeSlots=x,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,_.length!==m?console.warn(`[NQTR] Week days names should be equal to week length ${m}, so will be ignored`):n.weekDaysNames=_;}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 b=new l;var N="__nqtr-stage__",I=class extends StoredClassModel{constructor(e,t={}){super(N,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>b.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=b.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||[]}};export{I as default};//# sourceMappingURL=StageStoredClass.mjs.map
1
+ import {StoredClassModel,storage}from'@drincs/pixi-vn';var o="___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:x=[],weekLength:m=7,weekendStartDay:D=m-1,weekDaysNames:_=[]}=e;n.minDayHours=t,n.maxDayHours=r,n.defaultTimeSpent=a,n.timeSlots=x,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,_.length!==m?console.warn(`[NQTR] Week days names should be equal to week length ${m}, so will be ignored`):n.weekDaysNames=_;}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(o)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=storage.getVariable(o)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,storage.setVariable(o,t);}get currentDay(){let e=storage.getVariable(o)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=storage.getVariable(o)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,storage.setVariable(o,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 b=new l;var N="__nqtr-stage__",I=class extends StoredClassModel{constructor(e,t={}){super(N,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>b.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=b.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||[]}};export{I as default};//# sourceMappingURL=StageStoredClass.mjs.map
2
2
  //# sourceMappingURL=StageStoredClass.mjs.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"],"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"],"mappings":"uDACO,IAAMA,EAAgB,8BCC7B,CAAA,IAAqBC,EAArB,KAAiE,CAC7D,OAAO,WAAA,CAAsB,EAC7B,OAAO,WAAA,CAAsB,GAC7B,OAAO,gBAAA,CAA2B,EAClC,OAAO,SAAA,CAA0B,EAAC,CAClC,OAA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EAEpD,CAEQ,qBACR,IAAI,mBAAA,EAA8B,CACjC,OAAO,IAAA,CAAK,sBAAwB,CACrC,CAEQ,sBACR,CAAA,IAAI,uBAA8C,CACjD,OAAO,KAAK,sBAA0B,EAAA,EACvC,CACD","file":"StageStoredClass.mjs","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 { OnStartEndStageQuest } from \"@drincs/nqtr/dist/override\";\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\tconstructor(\n\t\tid: string,\n\t\toptions: {\n\t\t\t/**\n\t\t\t * The function that will be executed when the stage starts.\n\t\t\t */\n\t\t\tonStart?: (stage: StageInterface, props: OnStartEndStageQuest) => void;\n\t\t\t/**\n\t\t\t * The function that will be executed when the stage ends.\n\t\t\t */\n\t\t\tonEnd?: (stage: StageInterface, props: OnStartEndStageQuest) => void;\n\t\t\t/**\n\t\t\t * The day required to start the stage.\n\t\t\t * @example If the value is 3, and the previous stage ends on day 1, the stage will start on day 4.\n\t\t\t */\n\t\t\tdaysRequiredToStart?: number;\n\t\t\t/**\n\t\t\t * The quests required to start the stage.\n\t\t\t * @default []\n\t\t\t */\n\t\t\tquestsRequiredToStart?: QuestsRequiredType[];\n\t\t} = {}\n\t) {\n\t\tsuper(STAGE_CATEGORY, id);\n\t\tthis._onStart = options.onStart;\n\t\tthis._onEnd = options.onEnd;\n\t\tthis._daysRequiredToStart = options.daysRequiredToStart;\n\t\tthis._questsRequiredToStart = options.questsRequiredToStart || [];\n\t}\n\n\tprivate _onStart?: (stage: StageInterface, props: OnStartEndStageQuest) => void;\n\tget onStart(): undefined | ((stage: StageInterface, props: OnStartEndStageQuest) => void) {\n\t\treturn this._onStart;\n\t}\n\n\tprivate _onEnd?: (stage: StageInterface, props: OnStartEndStageQuest) => void;\n\tget onEnd(): undefined | ((stage: StageInterface, props: OnStartEndStageQuest) => void) {\n\t\treturn this._onEnd;\n\t}\n\n\tget completed(): boolean {\n\t\treturn this.getStorageProperty<boolean>(\"completed\") || false;\n\t}\n\tset completed(value: boolean) {\n\t\tthis.setStorageProperty(\"completed\", value);\n\t}\n\n\tget started(): boolean {\n\t\treturn this.getStorageProperty<boolean>(\"started\") || false;\n\t}\n\tset started(value: boolean) {\n\t\tthis.setStorageProperty(\"started\", value);\n\t}\n\n\tprivate get prevStageEndDay(): number | undefined {\n\t\treturn this.getStorageProperty<number>(\"prevStageEndDay\");\n\t}\n\tprivate set prevStageEndDay(value: number | undefined) {\n\t\tthis.setStorageProperty(\"prevStageEndDay\", value);\n\t}\n\n\tget startDay(): number | undefined {\n\t\tlet prevStageEndDay = this.prevStageEndDay;\n\t\tif (prevStageEndDay === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn prevStageEndDay + this.daysRequiredToStart;\n\t}\n\n\tget canStart(): boolean {\n\t\tlet daysRequired = this.daysRequiredToStart;\n\t\tif (daysRequired > 0) {\n\t\t\tlet prevStageEndDay = this.prevStageEndDay;\n\t\t\tif (prevStageEndDay === undefined) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (prevStageEndDay + daysRequired > timeTracker.currentDay) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tthis.questsRequiredToStart.length > 0 &&\n\t\t\t!this.questsRequiredToStart.every(\n\t\t\t\t(q) => q.quest.currentStageIndex && q.quest.currentStageIndex >= q.stageNumber\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tinizialize() {\n\t\tif (this.daysRequiredToStart > 0) {\n\t\t\tthis.prevStageEndDay = timeTracker.currentDay;\n\t\t\tconsole.log(`[NQTR] Stage ${this.id} will start on day ${this.startDay}`);\n\t\t}\n\t}\n\n\tstart(props: OnStartEndStageQuest) {\n\t\tif (this.canStart) {\n\t\t\tthis.started = true;\n\t\t\tif (this.onStart) {\n\t\t\t\tthis.onStart(this as any as StageInterface, props);\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.warn(`[NQTR] Stage ${this.id} can't start`);\n\t\t}\n\t}\n\n\tprivate _daysRequiredToStart?: number;\n\tget daysRequiredToStart(): number {\n\t\treturn this._daysRequiredToStart || 0;\n\t}\n\n\tprivate _questsRequiredToStart: QuestsRequiredType[];\n\tget questsRequiredToStart(): QuestsRequiredType[] {\n\t\treturn this._questsRequiredToStart || [];\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"],"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"],"mappings":"uDACO,IAAMA,EAAgB,8BCC7B,CAAA,IAAqBC,EAArB,KAAiE,CAC7D,OAAO,WAAA,CAAsB,EAC7B,OAAO,WAAA,CAAsB,GAC7B,OAAO,gBAAA,CAA2B,EAClC,OAAO,SAAA,CAA0B,EAAC,CAClC,OAAO,UAAqB,CAAA,CAAA,CAC5B,OAAO,eAA0B,CA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AA8B,CAC9B,OAAO,IAAA,CAAK,sBAAwB,CACxC,CAEQ,sBACR,CAAA,IAAI,uBAA8C,CAC9C,OAAO,KAAK,sBAA0B,EAAA,EAC1C,CACJ","file":"StageStoredClass.mjs","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"]}
@@ -1,15 +1,15 @@
1
- import ActivityBaseInterface from '../interface/ActivityInterface.mjs';
2
- import '@drincs/nqtr/dist/override';
1
+ import ActivityInterface from '../interface/ActivityInterface.mjs';
2
+ import '@drincs/nqtr';
3
3
 
4
4
  declare const registeredActivities: {
5
- [id: string]: ActivityBaseInterface;
5
+ [id: string]: ActivityInterface;
6
6
  };
7
- declare function saveActivity(activities: ActivityBaseInterface | ActivityBaseInterface[]): void;
7
+ declare function saveActivity(activities: ActivityInterface | ActivityInterface[]): void;
8
8
  /**
9
9
  * Get an activity by its id.
10
10
  * @param id The id of the activity.
11
11
  * @returns The activity or undefined if not found.
12
12
  */
13
- declare function getActivityById(id: string): ActivityBaseInterface | undefined;
13
+ declare function getActivityById(id: string): ActivityInterface | undefined;
14
14
 
15
15
  export { getActivityById, registeredActivities, saveActivity };
@@ -1,15 +1,15 @@
1
- import ActivityBaseInterface from '../interface/ActivityInterface.js';
2
- import '@drincs/nqtr/dist/override';
1
+ import ActivityInterface from '../interface/ActivityInterface.js';
2
+ import '@drincs/nqtr';
3
3
 
4
4
  declare const registeredActivities: {
5
- [id: string]: ActivityBaseInterface;
5
+ [id: string]: ActivityInterface;
6
6
  };
7
- declare function saveActivity(activities: ActivityBaseInterface | ActivityBaseInterface[]): void;
7
+ declare function saveActivity(activities: ActivityInterface | ActivityInterface[]): void;
8
8
  /**
9
9
  * Get an activity by its id.
10
10
  * @param id The id of the activity.
11
11
  * @returns The activity or undefined if not found.
12
12
  */
13
- declare function getActivityById(id: string): ActivityBaseInterface | undefined;
13
+ declare function getActivityById(id: string): ActivityInterface | undefined;
14
14
 
15
15
  export { getActivityById, registeredActivities, saveActivity };
@@ -1,27 +1,27 @@
1
- import { C as CommitmentBaseInterface } from '../RoomInterface-C7Sg80EF.mjs';
2
- import '@drincs/nqtr/dist/override';
1
+ import { C as CommitmentInterface } from '../RoomInterface-DsZAp6Pv.mjs';
2
+ import '@drincs/nqtr';
3
3
  import '@drincs/pixi-vn';
4
4
  import '../interface/ActivityInterface.mjs';
5
5
  import '../types/ExecutionType.mjs';
6
6
  import '../interface/navigation/NavigationAbstractClass.mjs';
7
7
 
8
8
  declare const registeredCommitments: {
9
- [id: string]: CommitmentBaseInterface;
9
+ [id: string]: CommitmentInterface;
10
10
  };
11
11
  declare const fixedCommitments: {
12
- [id: string]: CommitmentBaseInterface;
12
+ [id: string]: CommitmentInterface;
13
13
  };
14
14
  /**
15
15
  * Save a commitment in the registered commitments. If the commitment already exists, it will be overwritten.
16
16
  * @param commitment The commitment or commitments to save.
17
17
  * @returns
18
18
  */
19
- declare function saveCommitment(commitment: CommitmentBaseInterface | CommitmentBaseInterface[]): void;
19
+ declare function saveCommitment(commitment: CommitmentInterface | CommitmentInterface[]): void;
20
20
  /**
21
21
  * Get a commitment by its id.
22
22
  * @param id The id of the commitment.
23
23
  * @returns The commitment or undefined if not found.
24
24
  */
25
- declare function getCommitmentById(id: string): CommitmentBaseInterface | undefined;
25
+ declare function getCommitmentById(id: string): CommitmentInterface | undefined;
26
26
 
27
27
  export { fixedCommitments, getCommitmentById, registeredCommitments, saveCommitment };
@@ -1,27 +1,27 @@
1
- import { C as CommitmentBaseInterface } from '../RoomInterface-D7qXKwBI.js';
2
- import '@drincs/nqtr/dist/override';
1
+ import { C as CommitmentInterface } from '../RoomInterface-BglEhkQT.js';
2
+ import '@drincs/nqtr';
3
3
  import '@drincs/pixi-vn';
4
4
  import '../interface/ActivityInterface.js';
5
5
  import '../types/ExecutionType.js';
6
6
  import '../interface/navigation/NavigationAbstractClass.js';
7
7
 
8
8
  declare const registeredCommitments: {
9
- [id: string]: CommitmentBaseInterface;
9
+ [id: string]: CommitmentInterface;
10
10
  };
11
11
  declare const fixedCommitments: {
12
- [id: string]: CommitmentBaseInterface;
12
+ [id: string]: CommitmentInterface;
13
13
  };
14
14
  /**
15
15
  * Save a commitment in the registered commitments. If the commitment already exists, it will be overwritten.
16
16
  * @param commitment The commitment or commitments to save.
17
17
  * @returns
18
18
  */
19
- declare function saveCommitment(commitment: CommitmentBaseInterface | CommitmentBaseInterface[]): void;
19
+ declare function saveCommitment(commitment: CommitmentInterface | CommitmentInterface[]): void;
20
20
  /**
21
21
  * Get a commitment by its id.
22
22
  * @param id The id of the commitment.
23
23
  * @returns The commitment or undefined if not found.
24
24
  */
25
- declare function getCommitmentById(id: string): CommitmentBaseInterface | undefined;
25
+ declare function getCommitmentById(id: string): CommitmentInterface | undefined;
26
26
 
27
27
  export { fixedCommitments, getCommitmentById, registeredCommitments, saveCommitment };
@@ -1,8 +1,8 @@
1
- import { Q as QuestBaseInterface } from '../StageInterface-DmLgfrk4.mjs';
2
- import '@drincs/nqtr/dist/override';
1
+ import { Q as QuestInterface } from '../StageInterface-DJ7l0ubG.mjs';
2
+ import '@drincs/nqtr';
3
3
 
4
4
  declare const registeredQuests: {
5
- [id: string]: QuestBaseInterface;
5
+ [id: string]: QuestInterface;
6
6
  };
7
7
  /**
8
8
  * Save a quest in the registered quests. If the quest already exists, it will be overwritten.
@@ -11,12 +11,12 @@ declare const registeredQuests: {
11
11
  * @param props The quest properties
12
12
  * @returns The created quest
13
13
  */
14
- declare function saveQuest(quest: QuestBaseInterface | QuestBaseInterface[]): void;
14
+ declare function saveQuest(quest: QuestInterface | QuestInterface[]): void;
15
15
  /**
16
16
  * Get a quest by its id.
17
17
  * @param id The id of the quest.
18
18
  * @returns The quest or undefined if not found.
19
19
  */
20
- declare function getQuestById(id: string): QuestBaseInterface | undefined;
20
+ declare function getQuestById(id: string): QuestInterface | undefined;
21
21
 
22
22
  export { getQuestById, registeredQuests, saveQuest };
@@ -1,8 +1,8 @@
1
- import { Q as QuestBaseInterface } from '../StageInterface-DmLgfrk4.js';
2
- import '@drincs/nqtr/dist/override';
1
+ import { Q as QuestInterface } from '../StageInterface-DJ7l0ubG.js';
2
+ import '@drincs/nqtr';
3
3
 
4
4
  declare const registeredQuests: {
5
- [id: string]: QuestBaseInterface;
5
+ [id: string]: QuestInterface;
6
6
  };
7
7
  /**
8
8
  * Save a quest in the registered quests. If the quest already exists, it will be overwritten.
@@ -11,12 +11,12 @@ declare const registeredQuests: {
11
11
  * @param props The quest properties
12
12
  * @returns The created quest
13
13
  */
14
- declare function saveQuest(quest: QuestBaseInterface | QuestBaseInterface[]): void;
14
+ declare function saveQuest(quest: QuestInterface | QuestInterface[]): void;
15
15
  /**
16
16
  * Get a quest by its id.
17
17
  * @param id The id of the quest.
18
18
  * @returns The quest or undefined if not found.
19
19
  */
20
- declare function getQuestById(id: string): QuestBaseInterface | undefined;
20
+ declare function getQuestById(id: string): QuestInterface | undefined;
21
21
 
22
22
  export { getQuestById, registeredQuests, saveQuest };
@@ -1,12 +1,12 @@
1
- import { R as RoomBaseInterface } from '../RoomInterface-C7Sg80EF.mjs';
2
- import '@drincs/nqtr/dist/override';
1
+ import { R as RoomInterface } from '../RoomInterface-DsZAp6Pv.mjs';
2
+ import '@drincs/nqtr';
3
3
  import '@drincs/pixi-vn';
4
4
  import '../interface/ActivityInterface.mjs';
5
5
  import '../types/ExecutionType.mjs';
6
6
  import '../interface/navigation/NavigationAbstractClass.mjs';
7
7
 
8
8
  declare const registeredRooms: {
9
- [id: string]: RoomBaseInterface;
9
+ [id: string]: RoomInterface;
10
10
  };
11
11
  /**
12
12
  * Save a room in the registered rooms. If the room already exists, it will be overwritten.
@@ -17,12 +17,12 @@ declare const registeredRooms: {
17
17
  * saveRoom([mcRoom, aliceRoom, annRoom, bathroom, lounge, terrace, gymRoom]);
18
18
  * ```
19
19
  */
20
- declare function saveRoom(room: RoomBaseInterface | RoomBaseInterface[]): void;
20
+ declare function saveRoom(room: RoomInterface | RoomInterface[]): void;
21
21
  /**
22
22
  * Get a room by its id.
23
23
  * @param id The id of the room.
24
24
  * @returns The room or undefined if not found.
25
25
  */
26
- declare function getRoomById(id: string): RoomBaseInterface | undefined;
26
+ declare function getRoomById(id: string): RoomInterface | undefined;
27
27
 
28
28
  export { getRoomById, registeredRooms, saveRoom };
@@ -1,12 +1,12 @@
1
- import { R as RoomBaseInterface } from '../RoomInterface-D7qXKwBI.js';
2
- import '@drincs/nqtr/dist/override';
1
+ import { R as RoomInterface } from '../RoomInterface-BglEhkQT.js';
2
+ import '@drincs/nqtr';
3
3
  import '@drincs/pixi-vn';
4
4
  import '../interface/ActivityInterface.js';
5
5
  import '../types/ExecutionType.js';
6
6
  import '../interface/navigation/NavigationAbstractClass.js';
7
7
 
8
8
  declare const registeredRooms: {
9
- [id: string]: RoomBaseInterface;
9
+ [id: string]: RoomInterface;
10
10
  };
11
11
  /**
12
12
  * Save a room in the registered rooms. If the room already exists, it will be overwritten.
@@ -17,12 +17,12 @@ declare const registeredRooms: {
17
17
  * saveRoom([mcRoom, aliceRoom, annRoom, bathroom, lounge, terrace, gymRoom]);
18
18
  * ```
19
19
  */
20
- declare function saveRoom(room: RoomBaseInterface | RoomBaseInterface[]): void;
20
+ declare function saveRoom(room: RoomInterface | RoomInterface[]): void;
21
21
  /**
22
22
  * Get a room by its id.
23
23
  * @param id The id of the room.
24
24
  * @returns The room or undefined if not found.
25
25
  */
26
- declare function getRoomById(id: string): RoomBaseInterface | undefined;
26
+ declare function getRoomById(id: string): RoomInterface | undefined;
27
27
 
28
28
  export { getRoomById, registeredRooms, saveRoom };
@@ -3,9 +3,9 @@ export { saveCommitment } from './CommitmentDecorator.mjs';
3
3
  export { saveQuest as newQuest } from './QuestDecorator.mjs';
4
4
  export { saveRoom } from './RoomDecorator.mjs';
5
5
  import '../interface/ActivityInterface.mjs';
6
- import '@drincs/nqtr/dist/override';
7
- import '../RoomInterface-C7Sg80EF.mjs';
6
+ import '@drincs/nqtr';
7
+ import '../RoomInterface-DsZAp6Pv.mjs';
8
8
  import '@drincs/pixi-vn';
9
9
  import '../types/ExecutionType.mjs';
10
10
  import '../interface/navigation/NavigationAbstractClass.mjs';
11
- import '../StageInterface-DmLgfrk4.mjs';
11
+ import '../StageInterface-DJ7l0ubG.mjs';
@@ -3,9 +3,9 @@ export { saveCommitment } from './CommitmentDecorator.js';
3
3
  export { saveQuest as newQuest } from './QuestDecorator.js';
4
4
  export { saveRoom } from './RoomDecorator.js';
5
5
  import '../interface/ActivityInterface.js';
6
- import '@drincs/nqtr/dist/override';
7
- import '../RoomInterface-D7qXKwBI.js';
6
+ import '@drincs/nqtr';
7
+ import '../RoomInterface-BglEhkQT.js';
8
8
  import '@drincs/pixi-vn';
9
9
  import '../types/ExecutionType.js';
10
10
  import '../interface/navigation/NavigationAbstractClass.js';
11
- import '../StageInterface-DmLgfrk4.js';
11
+ import '../StageInterface-DJ7l0ubG.js';