@drincs/nqtr 0.2.12 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RoomInterface-BOE1uacE.d.mts +78 -0
- package/dist/RoomInterface-BswqipsF.d.ts +78 -0
- package/dist/StageInterface-DgeEtkqv.d.mts +162 -0
- package/dist/StageInterface-DgeEtkqv.d.ts +162 -0
- package/dist/classes/ActivityBaseModel.d.mts +63 -0
- package/dist/classes/ActivityBaseModel.d.ts +63 -0
- package/dist/classes/ActivityBaseModel.js +2 -0
- package/dist/classes/ActivityBaseModel.js.map +1 -0
- package/dist/classes/ActivityBaseModel.mjs +2 -0
- package/dist/classes/ActivityBaseModel.mjs.map +1 -0
- package/dist/classes/ActivityStoredClass.d.mts +27 -0
- package/dist/classes/ActivityStoredClass.d.ts +27 -0
- package/dist/classes/ActivityStoredClass.js +2 -0
- package/dist/classes/ActivityStoredClass.js.map +1 -0
- package/dist/classes/ActivityStoredClass.mjs +2 -0
- package/dist/classes/ActivityStoredClass.mjs.map +1 -0
- package/dist/classes/CommitmentBaseModel.d.mts +65 -0
- package/dist/classes/CommitmentBaseModel.d.ts +65 -0
- package/dist/classes/CommitmentBaseModel.js +2 -0
- package/dist/classes/CommitmentBaseModel.js.map +1 -0
- package/dist/classes/CommitmentBaseModel.mjs +2 -0
- package/dist/classes/CommitmentBaseModel.mjs.map +1 -0
- package/dist/classes/CommitmentStoredClass.d.mts +29 -0
- package/dist/classes/CommitmentStoredClass.d.ts +29 -0
- package/dist/classes/CommitmentStoredClass.js +2 -0
- package/dist/classes/CommitmentStoredClass.js.map +1 -0
- package/dist/classes/CommitmentStoredClass.mjs +2 -0
- package/dist/classes/CommitmentStoredClass.mjs.map +1 -0
- package/dist/classes/index.d.mts +27 -8
- package/dist/classes/index.d.ts +27 -8
- package/dist/classes/index.js +1 -1700
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +1 -1691
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/navigation/LocationBaseModel.d.mts +54 -0
- package/dist/classes/navigation/LocationBaseModel.d.ts +54 -0
- package/dist/classes/navigation/LocationBaseModel.js +2 -0
- package/dist/classes/navigation/LocationBaseModel.js.map +1 -0
- package/dist/classes/navigation/LocationBaseModel.mjs +2 -0
- package/dist/classes/navigation/LocationBaseModel.mjs.map +1 -0
- package/dist/classes/navigation/LocationStoredClass.d.mts +23 -0
- package/dist/classes/navigation/LocationStoredClass.d.ts +23 -0
- package/dist/classes/navigation/LocationStoredClass.js +2 -0
- package/dist/classes/navigation/LocationStoredClass.js.map +1 -0
- package/dist/classes/navigation/LocationStoredClass.mjs +2 -0
- package/dist/classes/navigation/LocationStoredClass.mjs.map +1 -0
- package/dist/classes/navigation/MapBaseModel.d.mts +41 -0
- package/dist/classes/navigation/MapBaseModel.d.ts +41 -0
- package/dist/classes/navigation/MapBaseModel.js +2 -0
- package/dist/classes/navigation/MapBaseModel.js.map +1 -0
- package/dist/classes/navigation/MapBaseModel.mjs +2 -0
- package/dist/classes/navigation/MapBaseModel.mjs.map +1 -0
- package/dist/classes/navigation/MapStoredClass.d.mts +14 -0
- package/dist/classes/navigation/MapStoredClass.d.ts +14 -0
- package/dist/classes/navigation/MapStoredClass.js +2 -0
- package/dist/classes/navigation/MapStoredClass.js.map +1 -0
- package/dist/classes/navigation/MapStoredClass.mjs +2 -0
- package/dist/classes/navigation/MapStoredClass.mjs.map +1 -0
- package/dist/classes/navigation/NavigationAbstractClass.d.mts +48 -0
- package/dist/classes/navigation/NavigationAbstractClass.d.ts +48 -0
- package/dist/classes/navigation/NavigationAbstractClass.js +2 -0
- package/dist/classes/navigation/NavigationAbstractClass.js.map +1 -0
- package/dist/classes/navigation/NavigationAbstractClass.mjs +2 -0
- package/dist/classes/navigation/NavigationAbstractClass.mjs.map +1 -0
- package/dist/classes/navigation/RoomBaseModel.d.mts +67 -0
- package/dist/classes/navigation/RoomBaseModel.d.ts +67 -0
- package/dist/classes/navigation/RoomBaseModel.js +2 -0
- package/dist/classes/navigation/RoomBaseModel.js.map +1 -0
- package/dist/classes/navigation/RoomBaseModel.mjs +2 -0
- package/dist/classes/navigation/RoomBaseModel.mjs.map +1 -0
- package/dist/classes/navigation/RoomStoredClass.d.mts +23 -0
- package/dist/classes/navigation/RoomStoredClass.d.ts +23 -0
- package/dist/classes/navigation/RoomStoredClass.js +2 -0
- package/dist/classes/navigation/RoomStoredClass.js.map +1 -0
- package/dist/classes/navigation/RoomStoredClass.mjs +2 -0
- package/dist/classes/navigation/RoomStoredClass.mjs.map +1 -0
- package/dist/classes/quest/QuestBaseModel.d.mts +36 -0
- package/dist/classes/quest/QuestBaseModel.d.ts +36 -0
- package/dist/classes/quest/QuestBaseModel.js +2 -0
- package/dist/classes/quest/QuestBaseModel.js.map +1 -0
- package/dist/classes/quest/QuestBaseModel.mjs +2 -0
- package/dist/classes/quest/QuestBaseModel.mjs.map +1 -0
- package/dist/classes/quest/QuestStoredClass.d.mts +37 -0
- package/dist/classes/quest/QuestStoredClass.d.ts +37 -0
- package/dist/classes/quest/QuestStoredClass.js +2 -0
- package/dist/classes/quest/QuestStoredClass.js.map +1 -0
- package/dist/classes/quest/QuestStoredClass.mjs +2 -0
- package/dist/classes/quest/QuestStoredClass.mjs.map +1 -0
- package/dist/classes/quest/StageBaseModel.d.mts +50 -0
- package/dist/classes/quest/StageBaseModel.d.ts +50 -0
- package/dist/classes/quest/StageBaseModel.js +2 -0
- package/dist/classes/quest/StageBaseModel.js.map +1 -0
- package/dist/classes/quest/StageBaseModel.mjs +2 -0
- package/dist/classes/quest/StageBaseModel.mjs.map +1 -0
- package/dist/classes/quest/StageStoredClass.d.mts +46 -0
- package/dist/classes/quest/StageStoredClass.d.ts +46 -0
- package/dist/classes/quest/StageStoredClass.js +2 -0
- package/dist/classes/quest/StageStoredClass.js.map +1 -0
- package/dist/classes/quest/StageStoredClass.mjs +2 -0
- package/dist/classes/quest/StageStoredClass.mjs.map +1 -0
- package/dist/constants.d.mts +4 -0
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -0
- package/dist/constants.mjs +2 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/decorators/ActivityDecorator.d.mts +5 -15
- package/dist/decorators/ActivityDecorator.d.ts +5 -15
- package/dist/decorators/ActivityDecorator.js +1 -407
- package/dist/decorators/ActivityDecorator.js.map +1 -1
- package/dist/decorators/ActivityDecorator.mjs +1 -403
- package/dist/decorators/ActivityDecorator.mjs.map +1 -1
- package/dist/decorators/CommitmentDecorator.d.mts +9 -37
- package/dist/decorators/CommitmentDecorator.d.ts +9 -37
- package/dist/decorators/CommitmentDecorator.js +1 -91
- package/dist/decorators/CommitmentDecorator.js.map +1 -1
- package/dist/decorators/CommitmentDecorator.mjs +1 -81
- package/dist/decorators/CommitmentDecorator.mjs.map +1 -1
- package/dist/decorators/QuestDecorator.d.mts +6 -16
- package/dist/decorators/QuestDecorator.d.ts +6 -16
- package/dist/decorators/QuestDecorator.js +1 -799
- package/dist/decorators/QuestDecorator.js.map +1 -1
- package/dist/decorators/QuestDecorator.mjs +1 -794
- package/dist/decorators/QuestDecorator.mjs.map +1 -1
- package/dist/decorators/RoomDecorator.d.mts +8 -32
- package/dist/decorators/RoomDecorator.d.ts +8 -32
- package/dist/decorators/RoomDecorator.js +1 -56
- package/dist/decorators/RoomDecorator.js.map +1 -1
- package/dist/decorators/RoomDecorator.mjs +1 -48
- package/dist/decorators/RoomDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +8 -13
- package/dist/decorators/index.d.ts +8 -13
- package/dist/decorators/index.js +1 -1068
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +1 -1053
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/index.d.mts +2 -12
- package/dist/functions/index.d.ts +2 -12
- package/dist/functions/index.js +1 -293
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +1 -281
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +62 -18
- package/dist/index.d.ts +62 -18
- package/dist/index.js +1 -2058
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -2023
- package/dist/index.mjs.map +1 -1
- package/dist/interface/ActivityInterface.d.mts +40 -0
- package/dist/interface/ActivityInterface.d.ts +40 -0
- package/dist/interface/ActivityInterface.js +2 -0
- package/dist/interface/ActivityInterface.js.map +1 -0
- package/dist/interface/ActivityInterface.mjs +2 -0
- package/dist/interface/ActivityInterface.mjs.map +1 -0
- package/dist/interface/ActivityProps.d.mts +48 -3
- package/dist/interface/ActivityProps.d.ts +48 -3
- package/dist/interface/ActivityProps.js +1 -3
- package/dist/interface/ActivityProps.js.map +1 -1
- package/dist/interface/ActivityProps.mjs +1 -2
- package/dist/interface/ActivityProps.mjs.map +1 -1
- package/dist/interface/CommitmentInterface.d.mts +6 -0
- package/dist/interface/CommitmentInterface.d.ts +6 -0
- package/dist/interface/CommitmentInterface.js +2 -0
- package/dist/interface/CommitmentInterface.js.map +1 -0
- package/dist/interface/CommitmentInterface.mjs +2 -0
- package/dist/interface/CommitmentInterface.mjs.map +1 -0
- package/dist/interface/CommitmentProps.d.mts +78 -7
- package/dist/interface/CommitmentProps.d.ts +78 -7
- package/dist/interface/CommitmentProps.js +1 -3
- package/dist/interface/CommitmentProps.js.map +1 -1
- package/dist/interface/CommitmentProps.mjs +1 -2
- package/dist/interface/CommitmentProps.mjs.map +1 -1
- package/dist/interface/index.d.mts +12 -8
- package/dist/interface/index.d.ts +12 -8
- package/dist/interface/index.js +1 -3
- package/dist/interface/index.js.map +1 -1
- package/dist/interface/index.mjs +1 -2
- package/dist/interface/index.mjs.map +1 -1
- package/dist/interface/navigation/LocationBaseModelProps.d.mts +32 -0
- package/dist/interface/navigation/LocationBaseModelProps.d.ts +32 -0
- package/dist/interface/navigation/LocationBaseModelProps.js +2 -0
- package/dist/interface/navigation/LocationBaseModelProps.js.map +1 -0
- package/dist/interface/navigation/LocationBaseModelProps.mjs +2 -0
- package/dist/interface/navigation/LocationBaseModelProps.mjs.map +1 -0
- package/dist/interface/navigation/LocationInterface.d.mts +6 -0
- package/dist/interface/navigation/LocationInterface.d.ts +6 -0
- package/dist/interface/navigation/LocationInterface.js +2 -0
- package/dist/interface/navigation/LocationInterface.js.map +1 -0
- package/dist/interface/navigation/LocationInterface.mjs +2 -0
- package/dist/interface/navigation/LocationInterface.mjs.map +1 -0
- package/dist/interface/navigation/MapBaseModelProps.d.mts +22 -0
- package/dist/interface/navigation/MapBaseModelProps.d.ts +22 -0
- package/dist/interface/navigation/MapBaseModelProps.js +2 -0
- package/dist/interface/navigation/MapBaseModelProps.js.map +1 -0
- package/dist/interface/navigation/MapBaseModelProps.mjs +2 -0
- package/dist/interface/navigation/MapBaseModelProps.mjs.map +1 -0
- package/dist/interface/navigation/MapInterface.d.mts +6 -0
- package/dist/interface/navigation/MapInterface.d.ts +6 -0
- package/dist/interface/navigation/MapInterface.js +2 -0
- package/dist/interface/navigation/MapInterface.js.map +1 -0
- package/dist/interface/navigation/MapInterface.mjs +2 -0
- package/dist/interface/navigation/MapInterface.mjs.map +1 -0
- package/dist/interface/navigation/NavigationAbstractClass.d.mts +54 -0
- package/dist/interface/navigation/NavigationAbstractClass.d.ts +54 -0
- package/dist/interface/navigation/NavigationAbstractClass.js +2 -0
- package/dist/interface/navigation/NavigationAbstractClass.js.map +1 -0
- package/dist/interface/navigation/NavigationAbstractClass.mjs +2 -0
- package/dist/interface/navigation/NavigationAbstractClass.mjs.map +1 -0
- package/dist/interface/navigation/RoomBaseModelProps.d.mts +37 -0
- package/dist/interface/navigation/RoomBaseModelProps.d.ts +37 -0
- package/dist/interface/navigation/RoomBaseModelProps.js +2 -0
- package/dist/interface/navigation/RoomBaseModelProps.js.map +1 -0
- package/dist/interface/navigation/RoomBaseModelProps.mjs +2 -0
- package/dist/interface/navigation/RoomBaseModelProps.mjs.map +1 -0
- package/dist/interface/navigation/RoomInterface.d.mts +6 -0
- package/dist/interface/navigation/RoomInterface.d.ts +6 -0
- package/dist/interface/navigation/RoomInterface.js +2 -0
- package/dist/interface/navigation/RoomInterface.js.map +1 -0
- package/dist/interface/navigation/RoomInterface.mjs +2 -0
- package/dist/interface/navigation/RoomInterface.mjs.map +1 -0
- package/dist/interface/quest/QuestInterface.d.mts +2 -0
- package/dist/interface/quest/QuestInterface.d.ts +2 -0
- package/dist/interface/quest/QuestInterface.js +2 -0
- package/dist/interface/quest/QuestInterface.js.map +1 -0
- package/dist/interface/quest/QuestInterface.mjs +2 -0
- package/dist/interface/quest/QuestInterface.mjs.map +1 -0
- package/dist/interface/quest/QuestProps.d.mts +39 -6
- package/dist/interface/quest/QuestProps.d.ts +39 -6
- package/dist/interface/quest/QuestProps.js +1 -3
- package/dist/interface/quest/QuestProps.js.map +1 -1
- package/dist/interface/quest/QuestProps.mjs +1 -2
- package/dist/interface/quest/QuestProps.mjs.map +1 -1
- package/dist/interface/quest/StageFlags.js +1 -3
- package/dist/interface/quest/StageFlags.js.map +1 -1
- package/dist/interface/quest/StageFlags.mjs +1 -2
- package/dist/interface/quest/StageFlags.mjs.map +1 -1
- package/dist/interface/quest/StageInterface.d.mts +2 -0
- package/dist/interface/quest/StageInterface.d.ts +2 -0
- package/dist/interface/quest/StageInterface.js +2 -0
- package/dist/interface/quest/StageInterface.js.map +1 -0
- package/dist/interface/quest/StageInterface.mjs +2 -0
- package/dist/interface/quest/StageInterface.mjs.map +1 -0
- package/dist/interface/quest/StageProps.d.mts +60 -6
- package/dist/interface/quest/StageProps.d.ts +60 -6
- package/dist/interface/quest/StageProps.js +1 -3
- package/dist/interface/quest/StageProps.js.map +1 -1
- package/dist/interface/quest/StageProps.mjs +1 -2
- package/dist/interface/quest/StageProps.mjs.map +1 -1
- package/dist/managers/NavigatorManager.d.mts +22 -0
- package/dist/managers/NavigatorManager.d.ts +22 -0
- package/dist/managers/NavigatorManager.js +2 -0
- package/dist/managers/NavigatorManager.js.map +1 -0
- package/dist/managers/NavigatorManager.mjs +2 -0
- package/dist/managers/NavigatorManager.mjs.map +1 -0
- package/dist/managers/QuestManager.d.mts +17 -0
- package/dist/managers/QuestManager.d.ts +17 -0
- package/dist/managers/QuestManager.js +2 -0
- package/dist/managers/QuestManager.js.map +1 -0
- package/dist/managers/QuestManager.mjs +2 -0
- package/dist/managers/QuestManager.mjs.map +1 -0
- package/dist/managers/RoutineManager.d.mts +59 -0
- package/dist/managers/RoutineManager.d.ts +59 -0
- package/dist/managers/RoutineManager.js +2 -0
- package/dist/managers/RoutineManager.js.map +1 -0
- package/dist/managers/RoutineManager.mjs +2 -0
- package/dist/managers/RoutineManager.mjs.map +1 -0
- package/dist/managers/TimeManager.d.mts +28 -38
- package/dist/managers/TimeManager.d.ts +28 -38
- package/dist/managers/TimeManager.js +1 -250
- package/dist/managers/TimeManager.js.map +1 -1
- package/dist/managers/TimeManager.mjs +1 -248
- package/dist/managers/TimeManager.mjs.map +1 -1
- package/dist/managers/TimeManagerSettings.d.mts +13 -0
- package/dist/managers/TimeManagerSettings.d.ts +13 -0
- package/dist/managers/TimeManagerSettings.js +2 -0
- package/dist/managers/TimeManagerSettings.js.map +1 -0
- package/dist/managers/TimeManagerSettings.mjs +2 -0
- package/dist/managers/TimeManagerSettings.mjs.map +1 -0
- package/dist/managers/index.d.mts +18 -1
- package/dist/managers/index.d.ts +18 -1
- package/dist/managers/index.js +1 -250
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +1 -248
- package/dist/managers/index.mjs.map +1 -1
- package/dist/override/ActivityInterface.d.mts +28 -0
- package/dist/override/ActivityInterface.d.ts +28 -0
- package/dist/override/ActivityInterface.js +2 -0
- package/dist/override/ActivityInterface.js.map +1 -0
- package/dist/override/ActivityInterface.mjs +2 -0
- package/dist/override/ActivityInterface.mjs.map +1 -0
- package/dist/override/CommitmentInterface.d.mts +24 -0
- package/dist/override/CommitmentInterface.d.ts +24 -0
- package/dist/override/CommitmentInterface.js +2 -0
- package/dist/override/CommitmentInterface.js.map +1 -0
- package/dist/override/CommitmentInterface.mjs +2 -0
- package/dist/override/CommitmentInterface.mjs.map +1 -0
- package/dist/override/GraphicItemInterface.js +1 -3
- package/dist/override/GraphicItemInterface.js.map +1 -1
- package/dist/override/GraphicItemInterface.mjs +1 -2
- package/dist/override/GraphicItemInterface.mjs.map +1 -1
- package/dist/override/LocationInterface.d.mts +29 -0
- package/dist/override/LocationInterface.d.ts +29 -0
- package/dist/override/LocationInterface.js +2 -0
- package/dist/override/LocationInterface.js.map +1 -0
- package/dist/override/LocationInterface.mjs +2 -0
- package/dist/override/LocationInterface.mjs.map +1 -0
- package/dist/override/MapInterface.d.mts +12 -0
- package/dist/override/MapInterface.d.ts +12 -0
- package/dist/override/MapInterface.js +2 -0
- package/dist/override/MapInterface.js.map +1 -0
- package/dist/override/MapInterface.mjs +2 -0
- package/dist/override/MapInterface.mjs.map +1 -0
- package/dist/override/OnRenderGraphicItemProps.js +1 -3
- package/dist/override/OnRenderGraphicItemProps.js.map +1 -1
- package/dist/override/OnRenderGraphicItemProps.mjs +1 -2
- package/dist/override/OnRenderGraphicItemProps.mjs.map +1 -1
- package/dist/override/OnRunProps.js +1 -3
- package/dist/override/OnRunProps.js.map +1 -1
- package/dist/override/OnRunProps.mjs +1 -2
- package/dist/override/OnRunProps.mjs.map +1 -1
- package/dist/override/OnStartEndStageQuest.js +1 -3
- package/dist/override/OnStartEndStageQuest.js.map +1 -1
- package/dist/override/OnStartEndStageQuest.mjs +1 -2
- package/dist/override/OnStartEndStageQuest.mjs.map +1 -1
- package/dist/override/QuestInterface.d.mts +24 -0
- package/dist/override/QuestInterface.d.ts +24 -0
- package/dist/override/QuestInterface.js +2 -0
- package/dist/override/QuestInterface.js.map +1 -0
- package/dist/override/QuestInterface.mjs +2 -0
- package/dist/override/QuestInterface.mjs.map +1 -0
- package/dist/override/RoomInterface.d.mts +33 -0
- package/dist/override/RoomInterface.d.ts +33 -0
- package/dist/override/RoomInterface.js +2 -0
- package/dist/override/RoomInterface.js.map +1 -0
- package/dist/override/RoomInterface.mjs +2 -0
- package/dist/override/RoomInterface.mjs.map +1 -0
- package/dist/override/StageInterface.d.mts +34 -0
- package/dist/override/StageInterface.d.ts +34 -0
- package/dist/override/StageInterface.js +2 -0
- package/dist/override/StageInterface.js.map +1 -0
- package/dist/override/StageInterface.mjs +2 -0
- package/dist/override/StageInterface.mjs.map +1 -0
- package/dist/override/index.d.mts +8 -4
- package/dist/override/index.d.ts +8 -4
- package/dist/override/index.js +1 -3
- package/dist/override/index.js.map +1 -1
- package/dist/override/index.mjs +1 -2
- package/dist/override/index.mjs.map +1 -1
- package/dist/types/ExecutionType.js +1 -3
- package/dist/types/ExecutionType.js.map +1 -1
- package/dist/types/ExecutionType.mjs +1 -2
- package/dist/types/ExecutionType.mjs.map +1 -1
- package/dist/types/OnRunEvent.d.mts +8 -0
- package/dist/types/OnRunEvent.d.ts +8 -0
- package/dist/types/OnRunEvent.js +2 -0
- package/dist/types/OnRunEvent.js.map +1 -0
- package/dist/types/OnRunEvent.mjs +2 -0
- package/dist/types/OnRunEvent.mjs.map +1 -0
- package/dist/types/QuestsRequired.d.mts +1 -5
- package/dist/types/QuestsRequired.d.ts +1 -5
- package/dist/types/QuestsRequired.js +1 -3
- package/dist/types/QuestsRequired.js.map +1 -1
- package/dist/types/QuestsRequired.mjs +1 -2
- package/dist/types/QuestsRequired.mjs.map +1 -1
- package/dist/types/TimeDataType.d.mts +6 -0
- package/dist/types/TimeDataType.d.ts +6 -0
- package/dist/types/TimeDataType.js +2 -0
- package/dist/types/TimeDataType.js.map +1 -0
- package/dist/types/TimeDataType.mjs +2 -0
- package/dist/types/TimeDataType.mjs.map +1 -0
- package/dist/types/TimeSettings.d.mts +1 -1
- package/dist/types/TimeSettings.d.ts +1 -1
- package/dist/types/TimeSettings.js +1 -3
- package/dist/types/TimeSettings.js.map +1 -1
- package/dist/types/TimeSettings.mjs +1 -2
- package/dist/types/TimeSettings.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -5
- package/dist/types/index.d.ts +1 -5
- package/dist/types/index.js +1 -3
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +1 -2
- package/dist/types/index.mjs.map +1 -1
- package/package.json +7 -7
- package/dist/ActivityProps-BkHX8xkA.d.ts +0 -124
- package/dist/ActivityProps-D45DQdcT.d.mts +0 -124
- package/dist/Commitment-C_qBgeF9.d.ts +0 -586
- package/dist/Commitment-DJD0f8AH.d.mts +0 -586
- package/dist/StageProps-CCjGI625.d.ts +0 -326
- package/dist/StageProps-CuE_n1Wg.d.mts +0 -326
- package/dist/classes/Activity.d.mts +0 -112
- package/dist/classes/Activity.d.ts +0 -112
- package/dist/classes/Activity.js +0 -382
- package/dist/classes/Activity.js.map +0 -1
- package/dist/classes/Activity.mjs +0 -380
- package/dist/classes/Activity.mjs.map +0 -1
- package/dist/classes/ActivityStoredAbstract.d.mts +0 -3
- package/dist/classes/ActivityStoredAbstract.d.ts +0 -3
- package/dist/classes/ActivityStoredAbstract.js +0 -399
- package/dist/classes/ActivityStoredAbstract.js.map +0 -1
- package/dist/classes/ActivityStoredAbstract.mjs +0 -397
- package/dist/classes/ActivityStoredAbstract.mjs.map +0 -1
- package/dist/classes/Commitment.d.mts +0 -8
- package/dist/classes/Commitment.d.ts +0 -8
- package/dist/classes/Commitment.js +0 -439
- package/dist/classes/Commitment.js.map +0 -1
- package/dist/classes/Commitment.mjs +0 -437
- package/dist/classes/Commitment.mjs.map +0 -1
- package/dist/classes/navigation/ActivityRoom.d.mts +0 -8
- package/dist/classes/navigation/ActivityRoom.d.ts +0 -8
- package/dist/classes/navigation/ActivityRoom.js +0 -449
- package/dist/classes/navigation/ActivityRoom.js.map +0 -1
- package/dist/classes/navigation/ActivityRoom.mjs +0 -447
- package/dist/classes/navigation/ActivityRoom.mjs.map +0 -1
- package/dist/classes/navigation/Location.d.mts +0 -8
- package/dist/classes/navigation/Location.d.ts +0 -8
- package/dist/classes/navigation/Location.js +0 -119
- package/dist/classes/navigation/Location.js.map +0 -1
- package/dist/classes/navigation/Location.mjs +0 -117
- package/dist/classes/navigation/Location.mjs.map +0 -1
- package/dist/classes/navigation/Map.d.mts +0 -8
- package/dist/classes/navigation/Map.d.ts +0 -8
- package/dist/classes/navigation/Map.js +0 -115
- package/dist/classes/navigation/Map.js.map +0 -1
- package/dist/classes/navigation/Map.mjs +0 -113
- package/dist/classes/navigation/Map.mjs.map +0 -1
- package/dist/classes/navigation/Room.d.mts +0 -8
- package/dist/classes/navigation/Room.d.ts +0 -8
- package/dist/classes/navigation/Room.js +0 -779
- package/dist/classes/navigation/Room.js.map +0 -1
- package/dist/classes/navigation/Room.mjs +0 -774
- package/dist/classes/navigation/Room.mjs.map +0 -1
- package/dist/classes/quest/Goal.d.mts +0 -46
- package/dist/classes/quest/Goal.d.ts +0 -46
- package/dist/classes/quest/Goal.js +0 -86
- package/dist/classes/quest/Goal.js.map +0 -1
- package/dist/classes/quest/Goal.mjs +0 -81
- package/dist/classes/quest/Goal.mjs.map +0 -1
- package/dist/classes/quest/Quest.d.mts +0 -6
- package/dist/classes/quest/Quest.d.ts +0 -6
- package/dist/classes/quest/Quest.js +0 -770
- package/dist/classes/quest/Quest.js.map +0 -1
- package/dist/classes/quest/Quest.mjs +0 -768
- package/dist/classes/quest/Quest.mjs.map +0 -1
- package/dist/classes/quest/Stage.d.mts +0 -6
- package/dist/classes/quest/Stage.d.ts +0 -6
- package/dist/classes/quest/Stage.js +0 -537
- package/dist/classes/quest/Stage.js.map +0 -1
- package/dist/classes/quest/Stage.mjs +0 -532
- package/dist/classes/quest/Stage.mjs.map +0 -1
- package/dist/functions/ActivityFunctions.d.mts +0 -20
- package/dist/functions/ActivityFunctions.d.ts +0 -20
- package/dist/functions/ActivityFunctions.js +0 -54
- package/dist/functions/ActivityFunctions.js.map +0 -1
- package/dist/functions/ActivityFunctions.mjs +0 -51
- package/dist/functions/ActivityFunctions.mjs.map +0 -1
- package/dist/functions/NavigationFunctions.d.mts +0 -32
- package/dist/functions/NavigationFunctions.d.ts +0 -32
- package/dist/functions/NavigationFunctions.js +0 -182
- package/dist/functions/NavigationFunctions.js.map +0 -1
- package/dist/functions/NavigationFunctions.mjs +0 -177
- package/dist/functions/NavigationFunctions.mjs.map +0 -1
- package/dist/functions/QuestFunctions.d.mts +0 -8
- package/dist/functions/QuestFunctions.d.ts +0 -8
- package/dist/functions/QuestFunctions.js +0 -21
- package/dist/functions/QuestFunctions.js.map +0 -1
- package/dist/functions/QuestFunctions.mjs +0 -19
- package/dist/functions/QuestFunctions.mjs.map +0 -1
- package/dist/functions/RoutineFunctions.d.mts +0 -36
- package/dist/functions/RoutineFunctions.d.ts +0 -36
- package/dist/functions/RoutineFunctions.js +0 -127
- package/dist/functions/RoutineFunctions.js.map +0 -1
- package/dist/functions/RoutineFunctions.mjs +0 -122
- package/dist/functions/RoutineFunctions.mjs.map +0 -1
- package/dist/interface/RoomActivityMemory.d.mts +0 -9
- package/dist/interface/RoomActivityMemory.d.ts +0 -9
- package/dist/interface/RoomActivityMemory.js +0 -4
- package/dist/interface/RoomActivityMemory.js.map +0 -1
- package/dist/interface/RoomActivityMemory.mjs +0 -3
- package/dist/interface/RoomActivityMemory.mjs.map +0 -1
- package/dist/interface/RoomProps.d.mts +0 -8
- package/dist/interface/RoomProps.d.ts +0 -8
- package/dist/interface/RoomProps.js +0 -4
- package/dist/interface/RoomProps.js.map +0 -1
- package/dist/interface/RoomProps.mjs +0 -3
- package/dist/interface/RoomProps.mjs.map +0 -1
- package/dist/interface/navigation/LocationProps.d.mts +0 -8
- package/dist/interface/navigation/LocationProps.d.ts +0 -8
- package/dist/interface/navigation/LocationProps.js +0 -4
- package/dist/interface/navigation/LocationProps.js.map +0 -1
- package/dist/interface/navigation/LocationProps.mjs +0 -3
- package/dist/interface/navigation/LocationProps.mjs.map +0 -1
- package/dist/interface/navigation/MapProps.d.mts +0 -8
- package/dist/interface/navigation/MapProps.d.ts +0 -8
- package/dist/interface/navigation/MapProps.js +0 -4
- package/dist/interface/navigation/MapProps.js.map +0 -1
- package/dist/interface/navigation/MapProps.mjs +0 -3
- package/dist/interface/navigation/MapProps.mjs.map +0 -1
- package/dist/interface/quest/GoalProps.d.mts +0 -19
- package/dist/interface/quest/GoalProps.d.ts +0 -19
- package/dist/interface/quest/GoalProps.js +0 -4
- package/dist/interface/quest/GoalProps.js.map +0 -1
- package/dist/interface/quest/GoalProps.mjs +0 -3
- package/dist/interface/quest/GoalProps.mjs.map +0 -1
- package/dist/override/GraphicItemType.d.mts +0 -17
- package/dist/override/GraphicItemType.d.ts +0 -17
- package/dist/override/GraphicItemType.js +0 -4
- package/dist/override/GraphicItemType.js.map +0 -1
- package/dist/override/GraphicItemType.mjs +0 -3
- package/dist/override/GraphicItemType.mjs.map +0 -1
- package/dist/override/NeighboringMapsInterface.d.mts +0 -21
- package/dist/override/NeighboringMapsInterface.d.ts +0 -21
- package/dist/override/NeighboringMapsInterface.js +0 -4
- package/dist/override/NeighboringMapsInterface.js.map +0 -1
- package/dist/override/NeighboringMapsInterface.mjs +0 -3
- package/dist/override/NeighboringMapsInterface.mjs.map +0 -1
- package/dist/types/OnRunActivityEvent.d.mts +0 -8
- package/dist/types/OnRunActivityEvent.d.ts +0 -8
- package/dist/types/OnRunActivityEvent.js +0 -4
- package/dist/types/OnRunActivityEvent.js.map +0 -1
- package/dist/types/OnRunActivityEvent.mjs +0 -3
- package/dist/types/OnRunActivityEvent.mjs.map +0 -1
- package/dist/types/OnRunCommitmentEvent.d.mts +0 -8
- package/dist/types/OnRunCommitmentEvent.d.ts +0 -8
- package/dist/types/OnRunCommitmentEvent.js +0 -4
- package/dist/types/OnRunCommitmentEvent.js.map +0 -1
- package/dist/types/OnRunCommitmentEvent.mjs +0 -3
- package/dist/types/OnRunCommitmentEvent.mjs.map +0 -1
|
@@ -1,6 +1,60 @@
|
|
|
1
|
-
import '@drincs/nqtr/dist/override';
|
|
2
|
-
|
|
3
|
-
import '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { OnStartEndStageQuest } from '@drincs/nqtr/dist/override';
|
|
2
|
+
import { a as QuestsRequiredType, S as StageBaseInterface } from '../../StageInterface-DgeEtkqv.js';
|
|
3
|
+
import StageFlags from './StageFlags.js';
|
|
4
|
+
|
|
5
|
+
interface StageProps {
|
|
6
|
+
/**
|
|
7
|
+
* The flags of the stage.
|
|
8
|
+
* @default []
|
|
9
|
+
*/
|
|
10
|
+
flags?: StageFlags[];
|
|
11
|
+
/**
|
|
12
|
+
* The name of the stage.
|
|
13
|
+
* @default ""
|
|
14
|
+
*/
|
|
15
|
+
name?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The description of the stage.
|
|
18
|
+
* @default ""
|
|
19
|
+
*/
|
|
20
|
+
description?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The advice description of the stage.
|
|
23
|
+
* @default ""
|
|
24
|
+
*/
|
|
25
|
+
adviceDescription?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The image of the stage.
|
|
28
|
+
*/
|
|
29
|
+
image?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The day required to start the stage.
|
|
32
|
+
* @example If the value is 3, and the previous stage ends on day 1, the stage will start on day 4.
|
|
33
|
+
*/
|
|
34
|
+
daysRequiredToStart?: number;
|
|
35
|
+
/**
|
|
36
|
+
* The flags required to start the stage.
|
|
37
|
+
* @default []
|
|
38
|
+
*/
|
|
39
|
+
flagsRequiredToStart?: StageFlags[];
|
|
40
|
+
/**
|
|
41
|
+
* The quests required to start the stage.
|
|
42
|
+
* @default []
|
|
43
|
+
*/
|
|
44
|
+
questsRequiredToStart?: QuestsRequiredType[];
|
|
45
|
+
/**
|
|
46
|
+
* The description to request to start the stage.
|
|
47
|
+
* @default ""
|
|
48
|
+
*/
|
|
49
|
+
requestDescriptionToStart?: string;
|
|
50
|
+
/**
|
|
51
|
+
* The function that will be executed when the stage starts.
|
|
52
|
+
*/
|
|
53
|
+
onStart?: (stage: StageBaseInterface, props: OnStartEndStageQuest) => void;
|
|
54
|
+
/**
|
|
55
|
+
* The function that will be executed when the stage ends.
|
|
56
|
+
*/
|
|
57
|
+
onEnd?: (stage: StageBaseInterface, props: OnStartEndStageQuest) => void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type { StageProps as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"StageProps.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"StageProps.mjs"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { R as RoomBaseInterface, L as LocationBaseInterface, M as MapBaseInterface } from '../RoomInterface-BOE1uacE.mjs';
|
|
2
|
+
import '@drincs/pixi-vn';
|
|
3
|
+
import '../interface/ActivityInterface.mjs';
|
|
4
|
+
import '@drincs/nqtr/dist/override';
|
|
5
|
+
import '../types/ExecutionType.mjs';
|
|
6
|
+
import '../interface/navigation/NavigationAbstractClass.mjs';
|
|
7
|
+
|
|
8
|
+
declare class NavigatorManager {
|
|
9
|
+
get rooms(): RoomBaseInterface[];
|
|
10
|
+
get locations(): LocationBaseInterface[];
|
|
11
|
+
get maps(): MapBaseInterface[];
|
|
12
|
+
get currentRoom(): RoomBaseInterface | undefined;
|
|
13
|
+
set currentRoom(room: RoomBaseInterface);
|
|
14
|
+
get currentLocation(): LocationBaseInterface | undefined;
|
|
15
|
+
get currentMap(): MapBaseInterface | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Clear all the expired activities.
|
|
18
|
+
*/
|
|
19
|
+
clearExpiredActivities(): void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { NavigatorManager as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { R as RoomBaseInterface, L as LocationBaseInterface, M as MapBaseInterface } from '../RoomInterface-BswqipsF.js';
|
|
2
|
+
import '@drincs/pixi-vn';
|
|
3
|
+
import '../interface/ActivityInterface.js';
|
|
4
|
+
import '@drincs/nqtr/dist/override';
|
|
5
|
+
import '../types/ExecutionType.js';
|
|
6
|
+
import '../interface/navigation/NavigationAbstractClass.js';
|
|
7
|
+
|
|
8
|
+
declare class NavigatorManager {
|
|
9
|
+
get rooms(): RoomBaseInterface[];
|
|
10
|
+
get locations(): LocationBaseInterface[];
|
|
11
|
+
get maps(): MapBaseInterface[];
|
|
12
|
+
get currentRoom(): RoomBaseInterface | undefined;
|
|
13
|
+
set currentRoom(room: RoomBaseInterface);
|
|
14
|
+
get currentLocation(): LocationBaseInterface | undefined;
|
|
15
|
+
get currentMap(): MapBaseInterface | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Clear all the expired activities.
|
|
18
|
+
*/
|
|
19
|
+
clearExpiredActivities(): void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { NavigatorManager as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var pixiVn=require('@drincs/pixi-vn');var t={};function n(o){try{let e=t[o];if(!e){console.error(`[NQTR] Room ${o} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${o}`,e);return}}var a="___nqtr-current_room_memory___",i=class{get rooms(){return Object.values(t)}get locations(){let e={};return Object.values(t).forEach(r=>{e[r.location.id]=r.location;}),Object.values(e)}get maps(){let e={};return Object.values(t).forEach(r=>{e[r.location.map.id]=r.location.map;}),Object.values(e)}get currentRoom(){let e=pixiVn.storage.getVariable(a);if(!e){console.error("[NQTR] The current room has not yet been set");return}let r=n(e);if(!r){console.error(`[NQTR] Current room ${e} not found`);return}return r}set currentRoom(e){if(!n(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}pixiVn.storage.setVariable(a,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(t).forEach(([e,r])=>{r.clearExpiredActivities();});}};module.exports=i;//# sourceMappingURL=NavigatorManager.js.map
|
|
2
|
+
//# sourceMappingURL=NavigatorManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/decorators/RoomDecorator.ts","../../src/managers/NavigatorManager.ts"],"names":["registeredRooms","getRoomById","id","room","CURRENT_ROOM_MEMORY_KEY","NavigatorManager","result","roomId","storage","_"],"mappings":"mDAEO,IAAMA,EAAmD,EAAC,CA2B1D,SAASC,CAAAA,CAAYC,CAAuC,CAAA,CAClE,GAAI,CACH,IAAIC,CAAOH,CAAAA,CAAAA,CAAgBE,CAAE,CAAA,CAC7B,GAAI,CAACC,CAAAA,CAAM,CACV,OAAA,CAAQ,KAAM,CAAA,CAAA,YAAA,EAAeD,CAAE,CAAY,UAAA,CAAA,CAAA,CAC3C,MACD,CACA,OAAOC,CACR,OAAS,CAAG,CAAA,CACX,OAAQ,CAAA,KAAA,CAAM,CAAmCD,gCAAAA,EAAAA,CAAE,GAAI,CAAC,CAAA,CACxD,MACD,CACD,CCrCA,IAAME,EAA0B,gCACXC,CAAAA,CAAAA,CAArB,KAAsC,CACrC,IAAI,KAAA,EAAQ,CACX,OAAO,MAAA,CAAO,MAAOL,CAAAA,CAAe,CACrC,CACA,IAAI,SAAY,EAAA,CACf,IAAIM,CAAAA,CAA8C,EAAC,CACnD,cAAO,MAAON,CAAAA,CAAe,CAAE,CAAA,OAAA,CAASG,CAAS,EAAA,CAChDG,EAAOH,CAAK,CAAA,QAAA,CAAS,EAAE,CAAA,CAAIA,CAAK,CAAA,SACjC,CAAC,CACM,CAAA,MAAA,CAAO,MAAOG,CAAAA,CAAM,CAC5B,CACA,IAAI,IAAO,EAAA,CACV,IAAIA,CAAAA,CAAyC,EAAC,CAC9C,cAAO,MAAON,CAAAA,CAAe,CAAE,CAAA,OAAA,CAASG,CAAS,EAAA,CAChDG,EAAOH,CAAK,CAAA,QAAA,CAAS,GAAI,CAAA,EAAE,CAAIA,CAAAA,CAAAA,CAAK,SAAS,IAC9C,CAAC,CACM,CAAA,MAAA,CAAO,MAAOG,CAAAA,CAAM,CAC5B,CACA,IAAI,WAAyC,EAAA,CAC5C,IAAIC,CAAAA,CAASC,eAAQ,WAAoBJ,CAAAA,CAAuB,CAChE,CAAA,GAAI,CAACG,CAAAA,CAAQ,CACZ,OAAQ,CAAA,KAAA,CAAM,8CAA8C,CAAA,CAC5D,MACD,CACA,IAAIJ,CAAOF,CAAAA,CAAAA,CAAYM,CAAM,CAAA,CAC7B,GAAI,CAACJ,EAAM,CACV,OAAA,CAAQ,KAAM,CAAA,CAAA,oBAAA,EAAuBI,CAAM,CAAA,UAAA,CAAY,EACvD,MACD,CACA,OAAOJ,CACR,CACA,IAAI,YAAYA,CAAqB,CAAA,CAEpC,GAAI,CADkBF,CAAYE,CAAAA,CAAAA,CAAK,EAAE,CACnB,CAAA,CACrB,OAAQ,CAAA,KAAA,CAAM,CAAmBA,gBAAAA,EAAAA,CAAAA,CAAK,EAAE,CAAwD,sDAAA,CAAA,CAAA,CAChG,MACD,CACAK,cAAQ,CAAA,WAAA,CAAYJ,EAAyBD,CAAK,CAAA,EAAE,EACrD,CACA,IAAI,eAAA,EAAiD,CACpD,OAAO,IAAA,CAAK,WAAa,EAAA,QAC1B,CACA,IAAI,YAAuC,CAC1C,OAAO,IAAK,CAAA,WAAA,EAAa,QAAS,CAAA,GACnC,CAIA,sBAAyB,EAAA,CACxB,MAAO,CAAA,OAAA,CAAQH,CAAe,CAAA,CAAE,QAAQ,CAAC,CAACS,CAAGN,CAAAA,CAAI,CAAM,GAAA,CACtDA,EAAK,sBAAuB,GAC7B,CAAC,EACF,CACD","file":"NavigatorManager.js","sourcesContent":["import { RoomInterface } from \"../interface\";\n\nexport const registeredRooms: { [id: string]: RoomInterface } = {};\n\n/**\n * Save a room in the registered rooms. If the room already exists, it will be overwritten.\n * @param room The room to save.\n * @returns\n * @example\n * ```ts\n * saveRoom([mcRoom, aliceRoom, annRoom, bathroom, lounge, terrace, gymRoom]);\n * ```\n */\nexport function saveRoom(room: RoomInterface | RoomInterface[]) {\n\tif (Array.isArray(room)) {\n\t\troom.forEach((c) => saveRoom(c));\n\t\treturn;\n\t}\n\tif (registeredRooms[room.id]) {\n\t\tconsole.warn(`[NQTR] Room id ${room.id} already exists, it will be overwritten`);\n\t}\n\tregisteredRooms[room.id] = room;\n}\n\n/**\n * Get a room by its id.\n * @param id The id of the room.\n * @returns The room or undefined if not found.\n */\nexport function getRoomById(id: string): RoomInterface | undefined {\n\ttry {\n\t\tlet room = registeredRooms[id];\n\t\tif (!room) {\n\t\t\tconsole.error(`[NQTR] Room ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn room;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Room ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { getRoomById, registeredRooms } from \"../decorators/RoomDecorator\";\nimport { LocationInterface, MapInterface, RoomInterface } from \"../interface\";\n\nconst CURRENT_ROOM_MEMORY_KEY = \"___nqtr-current_room_memory___\";\nexport default class NavigatorManager {\n\tget rooms() {\n\t\treturn Object.values(registeredRooms);\n\t}\n\tget locations() {\n\t\tlet result: { [id: string]: LocationInterface } = {};\n\t\tObject.values(registeredRooms).forEach((room) => {\n\t\t\tresult[room.location.id] = room.location;\n\t\t});\n\t\treturn Object.values(result);\n\t}\n\tget maps() {\n\t\tlet result: { [id: string]: MapInterface } = {};\n\t\tObject.values(registeredRooms).forEach((room) => {\n\t\t\tresult[room.location.map.id] = room.location.map;\n\t\t});\n\t\treturn Object.values(result);\n\t}\n\tget currentRoom(): RoomInterface | undefined {\n\t\tlet roomId = storage.getVariable<string>(CURRENT_ROOM_MEMORY_KEY);\n\t\tif (!roomId) {\n\t\t\tconsole.error(`[NQTR] The current room has not yet been set`);\n\t\t\treturn;\n\t\t}\n\t\tlet room = getRoomById(roomId);\n\t\tif (!room) {\n\t\t\tconsole.error(`[NQTR] Current room ${roomId} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn room;\n\t}\n\tset currentRoom(room: RoomInterface) {\n\t\tlet roomRegistrated = getRoomById(room.id);\n\t\tif (!roomRegistrated) {\n\t\t\tconsole.error(`[NQTR] The room ${room.id} is not registered, so it can't be set as current room`);\n\t\t\treturn;\n\t\t}\n\t\tstorage.setVariable(CURRENT_ROOM_MEMORY_KEY, room.id);\n\t}\n\tget currentLocation(): LocationInterface | undefined {\n\t\treturn this.currentRoom?.location;\n\t}\n\tget currentMap(): MapInterface | undefined {\n\t\treturn this.currentRoom?.location.map;\n\t}\n\t/**\n\t * Clear all the expired activities.\n\t */\n\tclearExpiredActivities() {\n\t\tObject.entries(registeredRooms).forEach(([_, room]) => {\n\t\t\troom.clearExpiredActivities();\n\t\t});\n\t}\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {storage}from'@drincs/pixi-vn';var t={};function n(o){try{let e=t[o];if(!e){console.error(`[NQTR] Room ${o} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${o}`,e);return}}var a="___nqtr-current_room_memory___",i=class{get rooms(){return Object.values(t)}get locations(){let e={};return Object.values(t).forEach(r=>{e[r.location.id]=r.location;}),Object.values(e)}get maps(){let e={};return Object.values(t).forEach(r=>{e[r.location.map.id]=r.location.map;}),Object.values(e)}get currentRoom(){let e=storage.getVariable(a);if(!e){console.error("[NQTR] The current room has not yet been set");return}let r=n(e);if(!r){console.error(`[NQTR] Current room ${e} not found`);return}return r}set currentRoom(e){if(!n(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}storage.setVariable(a,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(t).forEach(([e,r])=>{r.clearExpiredActivities();});}};export{i as default};//# sourceMappingURL=NavigatorManager.mjs.map
|
|
2
|
+
//# sourceMappingURL=NavigatorManager.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/decorators/RoomDecorator.ts","../../src/managers/NavigatorManager.ts"],"names":["registeredRooms","getRoomById","id","room","CURRENT_ROOM_MEMORY_KEY","NavigatorManager","result","roomId","storage","_"],"mappings":"sCAEO,IAAMA,EAAmD,EAAC,CA2B1D,SAASC,CAAAA,CAAYC,CAAuC,CAAA,CAClE,GAAI,CACH,IAAIC,CAAOH,CAAAA,CAAAA,CAAgBE,CAAE,CAAA,CAC7B,GAAI,CAACC,CAAAA,CAAM,CACV,OAAA,CAAQ,KAAM,CAAA,CAAA,YAAA,EAAeD,CAAE,CAAY,UAAA,CAAA,CAAA,CAC3C,MACD,CACA,OAAOC,CACR,OAAS,CAAG,CAAA,CACX,OAAQ,CAAA,KAAA,CAAM,CAAmCD,gCAAAA,EAAAA,CAAE,GAAI,CAAC,CAAA,CACxD,MACD,CACD,CCrCA,IAAME,EAA0B,gCACXC,CAAAA,CAAAA,CAArB,KAAsC,CACrC,IAAI,KAAA,EAAQ,CACX,OAAO,MAAA,CAAO,MAAOL,CAAAA,CAAe,CACrC,CACA,IAAI,SAAY,EAAA,CACf,IAAIM,CAAAA,CAA8C,EAAC,CACnD,cAAO,MAAON,CAAAA,CAAe,CAAE,CAAA,OAAA,CAASG,CAAS,EAAA,CAChDG,EAAOH,CAAK,CAAA,QAAA,CAAS,EAAE,CAAA,CAAIA,CAAK,CAAA,SACjC,CAAC,CACM,CAAA,MAAA,CAAO,MAAOG,CAAAA,CAAM,CAC5B,CACA,IAAI,IAAO,EAAA,CACV,IAAIA,CAAAA,CAAyC,EAAC,CAC9C,cAAO,MAAON,CAAAA,CAAe,CAAE,CAAA,OAAA,CAASG,CAAS,EAAA,CAChDG,EAAOH,CAAK,CAAA,QAAA,CAAS,GAAI,CAAA,EAAE,CAAIA,CAAAA,CAAAA,CAAK,SAAS,IAC9C,CAAC,CACM,CAAA,MAAA,CAAO,MAAOG,CAAAA,CAAM,CAC5B,CACA,IAAI,WAAyC,EAAA,CAC5C,IAAIC,CAAAA,CAASC,QAAQ,WAAoBJ,CAAAA,CAAuB,CAChE,CAAA,GAAI,CAACG,CAAAA,CAAQ,CACZ,OAAQ,CAAA,KAAA,CAAM,8CAA8C,CAAA,CAC5D,MACD,CACA,IAAIJ,CAAOF,CAAAA,CAAAA,CAAYM,CAAM,CAAA,CAC7B,GAAI,CAACJ,EAAM,CACV,OAAA,CAAQ,KAAM,CAAA,CAAA,oBAAA,EAAuBI,CAAM,CAAA,UAAA,CAAY,EACvD,MACD,CACA,OAAOJ,CACR,CACA,IAAI,YAAYA,CAAqB,CAAA,CAEpC,GAAI,CADkBF,CAAYE,CAAAA,CAAAA,CAAK,EAAE,CACnB,CAAA,CACrB,OAAQ,CAAA,KAAA,CAAM,CAAmBA,gBAAAA,EAAAA,CAAAA,CAAK,EAAE,CAAwD,sDAAA,CAAA,CAAA,CAChG,MACD,CACAK,OAAQ,CAAA,WAAA,CAAYJ,EAAyBD,CAAK,CAAA,EAAE,EACrD,CACA,IAAI,eAAA,EAAiD,CACpD,OAAO,IAAA,CAAK,WAAa,EAAA,QAC1B,CACA,IAAI,YAAuC,CAC1C,OAAO,IAAK,CAAA,WAAA,EAAa,QAAS,CAAA,GACnC,CAIA,sBAAyB,EAAA,CACxB,MAAO,CAAA,OAAA,CAAQH,CAAe,CAAA,CAAE,QAAQ,CAAC,CAACS,CAAGN,CAAAA,CAAI,CAAM,GAAA,CACtDA,EAAK,sBAAuB,GAC7B,CAAC,EACF,CACD","file":"NavigatorManager.mjs","sourcesContent":["import { RoomInterface } from \"../interface\";\n\nexport const registeredRooms: { [id: string]: RoomInterface } = {};\n\n/**\n * Save a room in the registered rooms. If the room already exists, it will be overwritten.\n * @param room The room to save.\n * @returns\n * @example\n * ```ts\n * saveRoom([mcRoom, aliceRoom, annRoom, bathroom, lounge, terrace, gymRoom]);\n * ```\n */\nexport function saveRoom(room: RoomInterface | RoomInterface[]) {\n\tif (Array.isArray(room)) {\n\t\troom.forEach((c) => saveRoom(c));\n\t\treturn;\n\t}\n\tif (registeredRooms[room.id]) {\n\t\tconsole.warn(`[NQTR] Room id ${room.id} already exists, it will be overwritten`);\n\t}\n\tregisteredRooms[room.id] = room;\n}\n\n/**\n * Get a room by its id.\n * @param id The id of the room.\n * @returns The room or undefined if not found.\n */\nexport function getRoomById(id: string): RoomInterface | undefined {\n\ttry {\n\t\tlet room = registeredRooms[id];\n\t\tif (!room) {\n\t\t\tconsole.error(`[NQTR] Room ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn room;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Room ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { getRoomById, registeredRooms } from \"../decorators/RoomDecorator\";\nimport { LocationInterface, MapInterface, RoomInterface } from \"../interface\";\n\nconst CURRENT_ROOM_MEMORY_KEY = \"___nqtr-current_room_memory___\";\nexport default class NavigatorManager {\n\tget rooms() {\n\t\treturn Object.values(registeredRooms);\n\t}\n\tget locations() {\n\t\tlet result: { [id: string]: LocationInterface } = {};\n\t\tObject.values(registeredRooms).forEach((room) => {\n\t\t\tresult[room.location.id] = room.location;\n\t\t});\n\t\treturn Object.values(result);\n\t}\n\tget maps() {\n\t\tlet result: { [id: string]: MapInterface } = {};\n\t\tObject.values(registeredRooms).forEach((room) => {\n\t\t\tresult[room.location.map.id] = room.location.map;\n\t\t});\n\t\treturn Object.values(result);\n\t}\n\tget currentRoom(): RoomInterface | undefined {\n\t\tlet roomId = storage.getVariable<string>(CURRENT_ROOM_MEMORY_KEY);\n\t\tif (!roomId) {\n\t\t\tconsole.error(`[NQTR] The current room has not yet been set`);\n\t\t\treturn;\n\t\t}\n\t\tlet room = getRoomById(roomId);\n\t\tif (!room) {\n\t\t\tconsole.error(`[NQTR] Current room ${roomId} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn room;\n\t}\n\tset currentRoom(room: RoomInterface) {\n\t\tlet roomRegistrated = getRoomById(room.id);\n\t\tif (!roomRegistrated) {\n\t\t\tconsole.error(`[NQTR] The room ${room.id} is not registered, so it can't be set as current room`);\n\t\t\treturn;\n\t\t}\n\t\tstorage.setVariable(CURRENT_ROOM_MEMORY_KEY, room.id);\n\t}\n\tget currentLocation(): LocationInterface | undefined {\n\t\treturn this.currentRoom?.location;\n\t}\n\tget currentMap(): MapInterface | undefined {\n\t\treturn this.currentRoom?.location.map;\n\t}\n\t/**\n\t * Clear all the expired activities.\n\t */\n\tclearExpiredActivities() {\n\t\tObject.entries(registeredRooms).forEach(([_, room]) => {\n\t\t\troom.clearExpiredActivities();\n\t\t});\n\t}\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OnStartEndStageQuest } from '@drincs/nqtr/dist/override';
|
|
2
|
+
import { Q as QuestBaseInterface } from '../StageInterface-DgeEtkqv.mjs';
|
|
3
|
+
|
|
4
|
+
declare class QuestManager {
|
|
5
|
+
get quests(): QuestBaseInterface[];
|
|
6
|
+
get startedQuests(): QuestBaseInterface[];
|
|
7
|
+
get completedQuests(): QuestBaseInterface[];
|
|
8
|
+
get failedQuests(): QuestBaseInterface[];
|
|
9
|
+
get notStartedQuests(): QuestBaseInterface[];
|
|
10
|
+
find(id: string): QuestBaseInterface | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Start the quests that must start on the current stage.
|
|
13
|
+
*/
|
|
14
|
+
startsStageMustBeStarted(props: OnStartEndStageQuest): void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { QuestManager as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OnStartEndStageQuest } from '@drincs/nqtr/dist/override';
|
|
2
|
+
import { Q as QuestBaseInterface } from '../StageInterface-DgeEtkqv.js';
|
|
3
|
+
|
|
4
|
+
declare class QuestManager {
|
|
5
|
+
get quests(): QuestBaseInterface[];
|
|
6
|
+
get startedQuests(): QuestBaseInterface[];
|
|
7
|
+
get completedQuests(): QuestBaseInterface[];
|
|
8
|
+
get failedQuests(): QuestBaseInterface[];
|
|
9
|
+
get notStartedQuests(): QuestBaseInterface[];
|
|
10
|
+
find(id: string): QuestBaseInterface | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Start the quests that must start on the current stage.
|
|
13
|
+
*/
|
|
14
|
+
startsStageMustBeStarted(props: OnStartEndStageQuest): void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { QuestManager as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var r={};function u(e){try{let t=r[e];if(!t){console.error(`[NQTR] Quest ${e} not found`);return}return t}catch(t){console.error(`[NQTR] Error while getting Quest ${e}`,t);return}}var s=class{get quests(){return Object.values(r)}get startedQuests(){return this.quests.filter(t=>t.started)}get completedQuests(){return this.quests.filter(t=>t.completed)}get failedQuests(){return this.quests.filter(t=>t.failed)}get notStartedQuests(){return this.quests.filter(t=>!t.started)}find(t){return u(t)}startsStageMustBeStarted(t){Object.values(r).forEach(n=>{n.currentStageMustStart&&n.startCurrentStage(t);});}};module.exports=s;//# sourceMappingURL=QuestManager.js.map
|
|
2
|
+
//# sourceMappingURL=QuestManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/decorators/QuestDecorator.ts","../../src/managers/QuestManager.ts"],"names":["registeredQuests","getQuestById","id","quest","e","QuestManager","props"],"mappings":"aAEO,IAAMA,CAAqD,CAAA,EAyB3D,CAAA,SAASC,CAAaC,CAAAA,CAAAA,CAAwC,CACpE,GAAI,CACH,IAAIC,CAAQH,CAAAA,CAAAA,CAAiBE,CAAE,CAAA,CAC/B,GAAI,CAACC,CAAO,CAAA,CACX,OAAQ,CAAA,KAAA,CAAM,CAAgBD,aAAAA,EAAAA,CAAE,CAAY,UAAA,CAAA,CAAA,CAC5C,MACD,CACA,OAAOC,CACR,OAASC,CAAG,CAAA,CACX,OAAQ,CAAA,KAAA,CAAM,CAAoCF,iCAAAA,EAAAA,CAAE,CAAIE,CAAAA,CAAAA,CAAC,CACzD,CAAA,MACD,CACD,CCnCqBC,IAAAA,CAAAA,CAArB,KAAkC,CACjC,IAAI,MAAA,EAA2B,CAC9B,OAAO,MAAO,CAAA,MAAA,CAAOL,CAAgB,CACtC,CACA,IAAI,aAAkC,EAAA,CACrC,OAAO,IAAA,CAAK,MAAO,CAAA,MAAA,CAAQG,GAAUA,CAAM,CAAA,OAAO,CACnD,CACA,IAAI,eAAA,EAAoC,CACvC,OAAO,IAAK,CAAA,MAAA,CAAO,MAAQA,CAAAA,CAAAA,EAAUA,CAAM,CAAA,SAAS,CACrD,CACA,IAAI,YAAA,EAAiC,CACpC,OAAO,IAAK,CAAA,MAAA,CAAO,MAAQA,CAAAA,CAAAA,EAAUA,CAAM,CAAA,MAAM,CAClD,CACA,IAAI,gBAAA,EAAqC,CACxC,OAAO,KAAK,MAAO,CAAA,MAAA,CAAQA,CAAU,EAAA,CAACA,CAAM,CAAA,OAAO,CACpD,CAEA,IAAKD,CAAAA,CAAAA,CAAwC,CAC5C,OAAOD,CAAaC,CAAAA,CAAE,CACvB,CAKA,yBAAyBI,CAA6B,CAAA,CACrD,MAAO,CAAA,MAAA,CAAON,CAAgB,CAAA,CAAE,OAASG,CAAAA,CAAAA,EAAU,CAC9CA,CAAAA,CAAM,qBACTA,EAAAA,CAAAA,CAAM,iBAAkBG,CAAAA,CAAK,EAE/B,CAAC,EACF,CACD","file":"QuestManager.js","sourcesContent":["import { QuestInterface } from \"../interface\";\n\nexport const registeredQuests: { [id: string]: QuestInterface } = {};\n\n/**\n * Save a quest in the registered quests. If the quest already exists, it will be overwritten.\n * @param id The id of the quest, it must be unique\n * @param stages The stages of the quest\n * @param props The quest properties\n * @returns The created quest\n */\nexport function saveQuest(quest: QuestInterface | QuestInterface[]) {\n\tif (Array.isArray(quest)) {\n\t\tquest.forEach((c) => saveQuest(c));\n\t\treturn;\n\t}\n\tif (registeredQuests[quest.id]) {\n\t\tconsole.warn(`[NQTR] Quest id ${quest.id} already exists, it will be overwritten`);\n\t}\n\tregisteredQuests[quest.id] = quest;\n}\n\n/**\n * Get a quest by its id.\n * @param id The id of the quest.\n * @returns The quest or undefined if not found.\n */\nexport function getQuestById(id: string): QuestInterface | undefined {\n\ttry {\n\t\tlet quest = registeredQuests[id];\n\t\tif (!quest) {\n\t\t\tconsole.error(`[NQTR] Quest ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn quest;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Quest ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { OnStartEndStageQuest } from \"@drincs/nqtr/dist/override\";\nimport { getQuestById, registeredQuests } from \"../decorators/QuestDecorator\";\nimport { QuestInterface } from \"../interface\";\n\nexport default class QuestManager {\n\tget quests(): QuestInterface[] {\n\t\treturn Object.values(registeredQuests);\n\t}\n\tget startedQuests(): QuestInterface[] {\n\t\treturn this.quests.filter((quest) => quest.started);\n\t}\n\tget completedQuests(): QuestInterface[] {\n\t\treturn this.quests.filter((quest) => quest.completed);\n\t}\n\tget failedQuests(): QuestInterface[] {\n\t\treturn this.quests.filter((quest) => quest.failed);\n\t}\n\tget notStartedQuests(): QuestInterface[] {\n\t\treturn this.quests.filter((quest) => !quest.started);\n\t}\n\n\tfind(id: string): QuestInterface | undefined {\n\t\treturn getQuestById(id);\n\t}\n\n\t/**\n\t * Start the quests that must start on the current stage.\n\t */\n\tstartsStageMustBeStarted(props: OnStartEndStageQuest) {\n\t\tObject.values(registeredQuests).forEach((quest) => {\n\t\t\tif (quest.currentStageMustStart) {\n\t\t\t\tquest.startCurrentStage(props);\n\t\t\t}\n\t\t});\n\t}\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var r={};function u(e){try{let t=r[e];if(!t){console.error(`[NQTR] Quest ${e} not found`);return}return t}catch(t){console.error(`[NQTR] Error while getting Quest ${e}`,t);return}}var s=class{get quests(){return Object.values(r)}get startedQuests(){return this.quests.filter(t=>t.started)}get completedQuests(){return this.quests.filter(t=>t.completed)}get failedQuests(){return this.quests.filter(t=>t.failed)}get notStartedQuests(){return this.quests.filter(t=>!t.started)}find(t){return u(t)}startsStageMustBeStarted(t){Object.values(r).forEach(n=>{n.currentStageMustStart&&n.startCurrentStage(t);});}};export{s as default};//# sourceMappingURL=QuestManager.mjs.map
|
|
2
|
+
//# sourceMappingURL=QuestManager.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/decorators/QuestDecorator.ts","../../src/managers/QuestManager.ts"],"names":["registeredQuests","getQuestById","id","quest","e","QuestManager","props"],"mappings":"AAEO,IAAMA,CAAqD,CAAA,EAyB3D,CAAA,SAASC,CAAaC,CAAAA,CAAAA,CAAwC,CACpE,GAAI,CACH,IAAIC,CAAQH,CAAAA,CAAAA,CAAiBE,CAAE,CAAA,CAC/B,GAAI,CAACC,CAAO,CAAA,CACX,OAAQ,CAAA,KAAA,CAAM,CAAgBD,aAAAA,EAAAA,CAAE,CAAY,UAAA,CAAA,CAAA,CAC5C,MACD,CACA,OAAOC,CACR,OAASC,CAAG,CAAA,CACX,OAAQ,CAAA,KAAA,CAAM,CAAoCF,iCAAAA,EAAAA,CAAE,CAAIE,CAAAA,CAAAA,CAAC,CACzD,CAAA,MACD,CACD,CCnCqBC,IAAAA,CAAAA,CAArB,KAAkC,CACjC,IAAI,MAAA,EAA2B,CAC9B,OAAO,MAAO,CAAA,MAAA,CAAOL,CAAgB,CACtC,CACA,IAAI,aAAkC,EAAA,CACrC,OAAO,IAAA,CAAK,MAAO,CAAA,MAAA,CAAQG,GAAUA,CAAM,CAAA,OAAO,CACnD,CACA,IAAI,eAAA,EAAoC,CACvC,OAAO,IAAK,CAAA,MAAA,CAAO,MAAQA,CAAAA,CAAAA,EAAUA,CAAM,CAAA,SAAS,CACrD,CACA,IAAI,YAAA,EAAiC,CACpC,OAAO,IAAK,CAAA,MAAA,CAAO,MAAQA,CAAAA,CAAAA,EAAUA,CAAM,CAAA,MAAM,CAClD,CACA,IAAI,gBAAA,EAAqC,CACxC,OAAO,KAAK,MAAO,CAAA,MAAA,CAAQA,CAAU,EAAA,CAACA,CAAM,CAAA,OAAO,CACpD,CAEA,IAAKD,CAAAA,CAAAA,CAAwC,CAC5C,OAAOD,CAAaC,CAAAA,CAAE,CACvB,CAKA,yBAAyBI,CAA6B,CAAA,CACrD,MAAO,CAAA,MAAA,CAAON,CAAgB,CAAA,CAAE,OAASG,CAAAA,CAAAA,EAAU,CAC9CA,CAAAA,CAAM,qBACTA,EAAAA,CAAAA,CAAM,iBAAkBG,CAAAA,CAAK,EAE/B,CAAC,EACF,CACD","file":"QuestManager.mjs","sourcesContent":["import { QuestInterface } from \"../interface\";\n\nexport const registeredQuests: { [id: string]: QuestInterface } = {};\n\n/**\n * Save a quest in the registered quests. If the quest already exists, it will be overwritten.\n * @param id The id of the quest, it must be unique\n * @param stages The stages of the quest\n * @param props The quest properties\n * @returns The created quest\n */\nexport function saveQuest(quest: QuestInterface | QuestInterface[]) {\n\tif (Array.isArray(quest)) {\n\t\tquest.forEach((c) => saveQuest(c));\n\t\treturn;\n\t}\n\tif (registeredQuests[quest.id]) {\n\t\tconsole.warn(`[NQTR] Quest id ${quest.id} already exists, it will be overwritten`);\n\t}\n\tregisteredQuests[quest.id] = quest;\n}\n\n/**\n * Get a quest by its id.\n * @param id The id of the quest.\n * @returns The quest or undefined if not found.\n */\nexport function getQuestById(id: string): QuestInterface | undefined {\n\ttry {\n\t\tlet quest = registeredQuests[id];\n\t\tif (!quest) {\n\t\t\tconsole.error(`[NQTR] Quest ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn quest;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Quest ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { OnStartEndStageQuest } from \"@drincs/nqtr/dist/override\";\nimport { getQuestById, registeredQuests } from \"../decorators/QuestDecorator\";\nimport { QuestInterface } from \"../interface\";\n\nexport default class QuestManager {\n\tget quests(): QuestInterface[] {\n\t\treturn Object.values(registeredQuests);\n\t}\n\tget startedQuests(): QuestInterface[] {\n\t\treturn this.quests.filter((quest) => quest.started);\n\t}\n\tget completedQuests(): QuestInterface[] {\n\t\treturn this.quests.filter((quest) => quest.completed);\n\t}\n\tget failedQuests(): QuestInterface[] {\n\t\treturn this.quests.filter((quest) => quest.failed);\n\t}\n\tget notStartedQuests(): QuestInterface[] {\n\t\treturn this.quests.filter((quest) => !quest.started);\n\t}\n\n\tfind(id: string): QuestInterface | undefined {\n\t\treturn getQuestById(id);\n\t}\n\n\t/**\n\t * Start the quests that must start on the current stage.\n\t */\n\tstartsStageMustBeStarted(props: OnStartEndStageQuest) {\n\t\tObject.values(registeredQuests).forEach((quest) => {\n\t\t\tif (quest.currentStageMustStart) {\n\t\t\t\tquest.startCurrentStage(props);\n\t\t\t}\n\t\t});\n\t}\n}\n"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CharacterInterface } from '@drincs/pixi-vn';
|
|
2
|
+
import { C as CommitmentBaseInterface } from '../RoomInterface-BOE1uacE.mjs';
|
|
3
|
+
import '../interface/ActivityInterface.mjs';
|
|
4
|
+
import '@drincs/nqtr/dist/override';
|
|
5
|
+
import '../types/ExecutionType.mjs';
|
|
6
|
+
import '../interface/navigation/NavigationAbstractClass.mjs';
|
|
7
|
+
|
|
8
|
+
declare class RoutineManager {
|
|
9
|
+
get fixedRoutine(): CommitmentBaseInterface[];
|
|
10
|
+
/**
|
|
11
|
+
* Set a commitment as fixed, it will be always available. They cannot be deleted or edit during the game session.
|
|
12
|
+
*/
|
|
13
|
+
set fixedRoutine(commitments: CommitmentBaseInterface[]);
|
|
14
|
+
/**
|
|
15
|
+
* Get the temporary commitments by its id.
|
|
16
|
+
* @returns The temporary commitments.
|
|
17
|
+
*/
|
|
18
|
+
get temporaryRoutine(): CommitmentBaseInterface[];
|
|
19
|
+
get allRoutine(): CommitmentBaseInterface[];
|
|
20
|
+
/**
|
|
21
|
+
* This feature adds the commitments during the game session.
|
|
22
|
+
* @param commitment The commitment or commitments to add.
|
|
23
|
+
*/
|
|
24
|
+
add(commitment: CommitmentBaseInterface[] | CommitmentBaseInterface): void;
|
|
25
|
+
/**
|
|
26
|
+
* Get the commitments added during the game session.
|
|
27
|
+
* @param id The id of the commitment.
|
|
28
|
+
* @returns The commitment or undefined if not found.
|
|
29
|
+
*/
|
|
30
|
+
find(id: string): CommitmentBaseInterface | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Remove the commitments added during the game session.
|
|
33
|
+
* @param commitment The commitment or commitments to remove.
|
|
34
|
+
*/
|
|
35
|
+
remove(commitment: CommitmentBaseInterface[] | CommitmentBaseInterface): void;
|
|
36
|
+
/**
|
|
37
|
+
* Clear all the expired commitments.
|
|
38
|
+
*/
|
|
39
|
+
clearExpiredRoutine(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Get the current commitments. The hidden commitments are not included.
|
|
42
|
+
* In case there is a character who has two or more commitments at the same time, will be selected the commitment with the highest priority.
|
|
43
|
+
* Higher priority commitments are calculated using the following steps:
|
|
44
|
+
* 1. The commitments that have Commitments BaseModel.priority set to a higher value will be selected first.
|
|
45
|
+
* 2. If there are commitments with the same priority, the commitments that are not fixed will be selected first.
|
|
46
|
+
* 3. If there are commitments with the same priority and the same fixed status, priority will be given to the commitment with a lower index.
|
|
47
|
+
* @returns The current commitments.
|
|
48
|
+
*/
|
|
49
|
+
get currentRoutine(): CommitmentBaseInterface[];
|
|
50
|
+
get currentRoomRoutine(): CommitmentBaseInterface[];
|
|
51
|
+
/**
|
|
52
|
+
* Get the character commitment.
|
|
53
|
+
* @param character The character.
|
|
54
|
+
* @returns The commitment or undefined if not found.
|
|
55
|
+
*/
|
|
56
|
+
getCommitmentByCharacter(character: CharacterInterface): CommitmentBaseInterface | undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { RoutineManager as default };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CharacterInterface } from '@drincs/pixi-vn';
|
|
2
|
+
import { C as CommitmentBaseInterface } from '../RoomInterface-BswqipsF.js';
|
|
3
|
+
import '../interface/ActivityInterface.js';
|
|
4
|
+
import '@drincs/nqtr/dist/override';
|
|
5
|
+
import '../types/ExecutionType.js';
|
|
6
|
+
import '../interface/navigation/NavigationAbstractClass.js';
|
|
7
|
+
|
|
8
|
+
declare class RoutineManager {
|
|
9
|
+
get fixedRoutine(): CommitmentBaseInterface[];
|
|
10
|
+
/**
|
|
11
|
+
* Set a commitment as fixed, it will be always available. They cannot be deleted or edit during the game session.
|
|
12
|
+
*/
|
|
13
|
+
set fixedRoutine(commitments: CommitmentBaseInterface[]);
|
|
14
|
+
/**
|
|
15
|
+
* Get the temporary commitments by its id.
|
|
16
|
+
* @returns The temporary commitments.
|
|
17
|
+
*/
|
|
18
|
+
get temporaryRoutine(): CommitmentBaseInterface[];
|
|
19
|
+
get allRoutine(): CommitmentBaseInterface[];
|
|
20
|
+
/**
|
|
21
|
+
* This feature adds the commitments during the game session.
|
|
22
|
+
* @param commitment The commitment or commitments to add.
|
|
23
|
+
*/
|
|
24
|
+
add(commitment: CommitmentBaseInterface[] | CommitmentBaseInterface): void;
|
|
25
|
+
/**
|
|
26
|
+
* Get the commitments added during the game session.
|
|
27
|
+
* @param id The id of the commitment.
|
|
28
|
+
* @returns The commitment or undefined if not found.
|
|
29
|
+
*/
|
|
30
|
+
find(id: string): CommitmentBaseInterface | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Remove the commitments added during the game session.
|
|
33
|
+
* @param commitment The commitment or commitments to remove.
|
|
34
|
+
*/
|
|
35
|
+
remove(commitment: CommitmentBaseInterface[] | CommitmentBaseInterface): void;
|
|
36
|
+
/**
|
|
37
|
+
* Clear all the expired commitments.
|
|
38
|
+
*/
|
|
39
|
+
clearExpiredRoutine(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Get the current commitments. The hidden commitments are not included.
|
|
42
|
+
* In case there is a character who has two or more commitments at the same time, will be selected the commitment with the highest priority.
|
|
43
|
+
* Higher priority commitments are calculated using the following steps:
|
|
44
|
+
* 1. The commitments that have Commitments BaseModel.priority set to a higher value will be selected first.
|
|
45
|
+
* 2. If there are commitments with the same priority, the commitments that are not fixed will be selected first.
|
|
46
|
+
* 3. If there are commitments with the same priority and the same fixed status, priority will be given to the commitment with a lower index.
|
|
47
|
+
* @returns The current commitments.
|
|
48
|
+
*/
|
|
49
|
+
get currentRoutine(): CommitmentBaseInterface[];
|
|
50
|
+
get currentRoomRoutine(): CommitmentBaseInterface[];
|
|
51
|
+
/**
|
|
52
|
+
* Get the character commitment.
|
|
53
|
+
* @param character The character.
|
|
54
|
+
* @returns The commitment or undefined if not found.
|
|
55
|
+
*/
|
|
56
|
+
getCommitmentByCharacter(character: CharacterInterface): CommitmentBaseInterface | undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { RoutineManager as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var pixiVn=require('@drincs/pixi-vn');var s={};function R(i){try{let e=s[i];if(!e){console.error(`[NQTR] Room ${i} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${i}`,e);return}}var _="___nqtr-current_room_memory___",c=class{get rooms(){return Object.values(s)}get locations(){let e={};return Object.values(s).forEach(t=>{e[t.location.id]=t.location;}),Object.values(e)}get maps(){let e={};return Object.values(s).forEach(t=>{e[t.location.map.id]=t.location.map;}),Object.values(e)}get currentRoom(){let e=pixiVn.storage.getVariable(_);if(!e){console.error("[NQTR] The current room has not yet been set");return}let t=R(e);if(!t){console.error(`[NQTR] Current room ${e} not found`);return}return t}set currentRoom(e){if(!R(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}pixiVn.storage.setVariable(_,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(s).forEach(([e,t])=>{t.clearExpiredActivities();});}};var S=new c;new d;var h={},y={};function p(i){try{let e=h[i];if(!e){console.error(`[NQTR] Commitment ${i} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Commitment ${i}`,e);return}}var I="___nqtr-temporary_commitment___",d=class{get fixedRoutine(){return Object.values(y)}set fixedRoutine(e){e.forEach(t=>{y[t.id]&&console.warn(`[NQTR] Commitment id ${t.id} already exists, it will be overwritten`),y[t.id]=t;});}get temporaryRoutine(){let e=pixiVn.storage.getVariable(I);return e?e.map(r=>p(r)).filter(r=>r!==undefined):[]}get allRoutine(){return [...this.fixedRoutine,...this.temporaryRoutine]}add(e){Array.isArray(e)||(e=[e]);let t=e.map(r=>{if(!p(r.id)){console.warn(`[NQTR] Commitment ${r.id} not found, it will be ignored`);return}return r.id}).filter(r=>r!==undefined);pixiVn.storage.setVariable(I,t);}find(e){return p(e)}remove(e){Array.isArray(e)||(e=[e]);let t=e.map(o=>o.id),r=pixiVn.storage.getVariable(I);r&&(r=r.filter(o=>!t.includes(o)),pixiVn.storage.setVariable(I,r));}clearExpiredRoutine(){Object.values(h).forEach(e=>{e.expired&&delete h[e.id];});}get currentRoutine(){let e={};return [...this.temporaryRoutine,...this.fixedRoutine].reverse().forEach(t=>{t.isActive&&(t.characters.length>0?t.characters.every(o=>!e[o.id]||t.priority>e[o.id].priority)&&t.characters.forEach(o=>{e[o.id]=t;}):console.error(`[NQTR] The commitment ${t.id} has no characters assigned`));}),Object.values(e)}get currentRoomRoutine(){return S.currentRoom?.routine||[]}getCommitmentByCharacter(e){this.currentRoutine.forEach(t=>{if(t.characters.map(r=>r.id).includes(e.id))return t});}};module.exports=d;//# sourceMappingURL=RoutineManager.js.map
|
|
2
|
+
//# sourceMappingURL=RoutineManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/decorators/RoomDecorator.ts","../../src/managers/NavigatorManager.ts","../../src/managers/index.ts","../../src/decorators/CommitmentDecorator.ts","../../src/managers/RoutineManager.ts"],"names":["registeredRooms","getRoomById","id","room","CURRENT_ROOM_MEMORY_KEY","NavigatorManager","result","roomId","storage","_","timeTracker","navigator","RoutineManager","questsNotebook","registeredCommitments","fixedCommitments","getCommitmentById","commitment","TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY","commitments","c","commitmentsIds","currentCommitments","character_commitments","ch","character"],"mappings":"mDAEO,IAAMA,CAAAA,CAAmD,EAAC,CA2B1D,SAASC,CAAAA,CAAYC,EAAuC,CAClE,GAAI,CACH,IAAIC,CAAOH,CAAAA,CAAAA,CAAgBE,CAAE,CAAA,CAC7B,GAAI,CAACC,CAAAA,CAAM,CACV,OAAA,CAAQ,KAAM,CAAA,CAAA,YAAA,EAAeD,CAAE,CAAA,UAAA,CAAY,EAC3C,MACD,CACA,OAAOC,CACR,CAAS,MAAA,CAAA,CAAG,CACX,OAAA,CAAQ,MAAM,CAAmCD,gCAAAA,EAAAA,CAAE,CAAI,CAAA,CAAA,CAAC,CACxD,CAAA,MACD,CACD,CCrCA,IAAME,CAA0B,CAAA,gCAAA,CACXC,CAArB,CAAA,KAAsC,CACrC,IAAI,KAAQ,EAAA,CACX,OAAO,MAAO,CAAA,MAAA,CAAOL,CAAe,CACrC,CACA,IAAI,SAAY,EAAA,CACf,IAAIM,CAA8C,CAAA,EAClD,CAAA,OAAA,MAAA,CAAO,MAAON,CAAAA,CAAe,CAAE,CAAA,OAAA,CAASG,GAAS,CAChDG,CAAAA,CAAOH,CAAK,CAAA,QAAA,CAAS,EAAE,CAAA,CAAIA,CAAK,CAAA,SACjC,CAAC,CACM,CAAA,MAAA,CAAO,MAAOG,CAAAA,CAAM,CAC5B,CACA,IAAI,IAAA,EAAO,CACV,IAAIA,CAAAA,CAAyC,EAAC,CAC9C,OAAO,MAAA,CAAA,MAAA,CAAON,CAAe,CAAA,CAAE,QAASG,CAAS,EAAA,CAChDG,CAAOH,CAAAA,CAAAA,CAAK,QAAS,CAAA,GAAA,CAAI,EAAE,CAAA,CAAIA,EAAK,QAAS,CAAA,IAC9C,CAAC,CAAA,CACM,MAAO,CAAA,MAAA,CAAOG,CAAM,CAC5B,CACA,IA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E,CAAA,QAAA,GACDA,CAAE,CAAA,UAAA,CAAW,OAAS,CAENA,CAAAA,CAAAA,CAAE,UAAW,CAAA,KAAA,CAC9BI,GAAO,CAACD,CAAAA,CAAsBC,CAAG,CAAA,EAAE,CAAKJ,EAAAA,CAAAA,CAAE,QAAWG,CAAAA,CAAAA,CAAsBC,EAAG,EAAE,CAAA,CAAE,QACpF,CAAA,EAECJ,CAAE,CAAA,UAAA,CAAW,OAASI,CAAAA,CAAAA,EAAO,CAC5BD,CAAsBC,CAAAA,CAAAA,CAAG,EAAE,CAAA,CAAIJ,EAChC,CAAC,CAGF,CAAA,OAAA,CAAQ,MAAM,CAAyBA,sBAAAA,EAAAA,CAAAA,CAAE,EAAE,CAAA,2BAAA,CAA6B,CAG3E,EAAA,CAAC,CACM,CAAA,MAAA,CAAO,OAAOG,CAAqB,CAC3C,CAEA,IAAI,kBAA4C,EAAA,CAC/C,OAAOZ,CAAAA,CAAU,aAAa,OAAW,EAAA,EAC1C,CAOA,wBAAyBc,CAAAA,CAAAA,CAAgE,CACxF,IAAA,CAAK,eAAe,OAASL,CAAAA,CAAAA,EAAM,CAClC,GAAIA,CAAE,CAAA,UAAA,CAAW,GAAKI,CAAAA,CAAAA,EAAOA,EAAG,EAAE,CAAA,CAAE,QAASC,CAAAA,CAAAA,CAAU,EAAE,CACxD,CAAA,OAAOL,CAET,CAAC,EAEF,CACD","file":"RoutineManager.js","sourcesContent":["import { RoomInterface } from \"../interface\";\n\nexport const registeredRooms: { [id: string]: RoomInterface } = {};\n\n/**\n * Save a room in the registered rooms. If the room already exists, it will be overwritten.\n * @param room The room to save.\n * @returns\n * @example\n * ```ts\n * saveRoom([mcRoom, aliceRoom, annRoom, bathroom, lounge, terrace, gymRoom]);\n * ```\n */\nexport function saveRoom(room: RoomInterface | RoomInterface[]) {\n\tif (Array.isArray(room)) {\n\t\troom.forEach((c) => saveRoom(c));\n\t\treturn;\n\t}\n\tif (registeredRooms[room.id]) {\n\t\tconsole.warn(`[NQTR] Room id ${room.id} already exists, it will be overwritten`);\n\t}\n\tregisteredRooms[room.id] = room;\n}\n\n/**\n * Get a room by its id.\n * @param id The id of the room.\n * @returns The room or undefined if not found.\n */\nexport function getRoomById(id: string): RoomInterface | undefined {\n\ttry {\n\t\tlet room = registeredRooms[id];\n\t\tif (!room) {\n\t\t\tconsole.error(`[NQTR] Room ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn room;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Room ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { getRoomById, registeredRooms } from \"../decorators/RoomDecorator\";\nimport { LocationInterface, MapInterface, RoomInterface } from \"../interface\";\n\nconst CURRENT_ROOM_MEMORY_KEY = \"___nqtr-current_room_memory___\";\nexport default class NavigatorManager {\n\tget rooms() {\n\t\treturn Object.values(registeredRooms);\n\t}\n\tget locations() {\n\t\tlet result: { [id: string]: LocationInterface } = {};\n\t\tObject.values(registeredRooms).forEach((room) => {\n\t\t\tresult[room.location.id] = room.location;\n\t\t});\n\t\treturn Object.values(result);\n\t}\n\tget maps() {\n\t\tlet result: { [id: string]: MapInterface } = {};\n\t\tObject.values(registeredRooms).forEach((room) => {\n\t\t\tresult[room.location.map.id] = room.location.map;\n\t\t});\n\t\treturn Object.values(result);\n\t}\n\tget currentRoom(): RoomInterface | undefined {\n\t\tlet roomId = storage.getVariable<string>(CURRENT_ROOM_MEMORY_KEY);\n\t\tif (!roomId) {\n\t\t\tconsole.error(`[NQTR] The current room has not yet been set`);\n\t\t\treturn;\n\t\t}\n\t\tlet room = getRoomById(roomId);\n\t\tif (!room) {\n\t\t\tconsole.error(`[NQTR] Current room ${roomId} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn room;\n\t}\n\tset currentRoom(room: RoomInterface) {\n\t\tlet roomRegistrated = getRoomById(room.id);\n\t\tif (!roomRegistrated) {\n\t\t\tconsole.error(`[NQTR] The room ${room.id} is not registered, so it can't be set as current room`);\n\t\t\treturn;\n\t\t}\n\t\tstorage.setVariable(CURRENT_ROOM_MEMORY_KEY, room.id);\n\t}\n\tget currentLocation(): LocationInterface | undefined {\n\t\treturn this.currentRoom?.location;\n\t}\n\tget currentMap(): MapInterface | undefined {\n\t\treturn this.currentRoom?.location.map;\n\t}\n\t/**\n\t * Clear all the expired activities.\n\t */\n\tclearExpiredActivities() {\n\t\tObject.entries(registeredRooms).forEach(([_, room]) => {\n\t\t\troom.clearExpiredActivities();\n\t\t});\n\t}\n}\n","import 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 { CommitmentInterface } from \"../interface\";\n\nexport const registeredCommitments: { [id: string]: CommitmentInterface } = {};\nexport const fixedCommitments: { [id: string]: CommitmentInterface } = {};\n\n/**\n * Save a commitment in the registered commitments. If the commitment already exists, it will be overwritten.\n * @param commitment The commitment or commitments to save.\n * @returns\n */\nexport function saveCommitment(commitment: CommitmentInterface | CommitmentInterface[]) {\n\tif (Array.isArray(commitment)) {\n\t\tcommitment.forEach((c) => saveCommitment(c));\n\t\treturn;\n\t}\n\tif (registeredCommitments[commitment.id]) {\n\t\tconsole.warn(`[NQTR] Commitment id ${commitment.id} already exists, it will be overwritten`);\n\t}\n\tregisteredCommitments[commitment.id] = commitment;\n}\n\n/**\n * Get a commitment by its id.\n * @param id The id of the commitment.\n * @returns The commitment or undefined if not found.\n */\nexport function getCommitmentById(id: string): CommitmentInterface | undefined {\n\ttry {\n\t\tlet commitment = registeredCommitments[id];\n\t\tif (!commitment) {\n\t\t\tconsole.error(`[NQTR] Commitment ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn commitment;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Commitment ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { CharacterInterface, storage } from \"@drincs/pixi-vn\";\nimport { navigator } from \".\";\nimport { fixedCommitments, getCommitmentById, registeredCommitments } from \"../decorators/CommitmentDecorator\";\nimport { CommitmentInterface } from \"../interface\";\n\nconst TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY = \"___nqtr-temporary_commitment___\";\nexport default class RoutineManager {\n\tget fixedRoutine(): CommitmentInterface[] {\n\t\treturn Object.values(fixedCommitments);\n\t}\n\t/**\n\t * Set a commitment as fixed, it will be always available. They cannot be deleted or edit during the game session.\n\t */\n\tset fixedRoutine(commitments: CommitmentInterface[]) {\n\t\tcommitments.forEach((c) => {\n\t\t\tif (fixedCommitments[c.id]) {\n\t\t\t\tconsole.warn(`[NQTR] Commitment id ${c.id} already exists, it will be overwritten`);\n\t\t\t}\n\t\t\tfixedCommitments[c.id] = c;\n\t\t});\n\t}\n\n\t/**\n\t * Get the temporary commitments by its id.\n\t * @returns The temporary commitments.\n\t */\n\tget temporaryRoutine(): CommitmentInterface[] {\n\t\tlet commitmentsIds = storage.getVariable<string[]>(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY);\n\t\tif (!commitmentsIds) {\n\t\t\treturn [];\n\t\t}\n\t\tlet commitments = commitmentsIds\n\t\t\t.map((id) => getCommitmentById(id))\n\t\t\t.filter((commitment) => commitment !== undefined);\n\t\treturn commitments;\n\t}\n\n\tget allRoutine(): CommitmentInterface[] {\n\t\treturn [...this.fixedRoutine, ...this.temporaryRoutine];\n\t}\n\n\t/**\n\t * This feature adds the commitments during the game session.\n\t * @param commitment The commitment or commitments to add.\n\t */\n\tadd(commitment: CommitmentInterface[] | CommitmentInterface) {\n\t\tif (!Array.isArray(commitment)) {\n\t\t\tcommitment = [commitment];\n\t\t}\n\t\tlet commitmentsIds = commitment\n\t\t\t.map((commitment) => {\n\t\t\t\tlet commitmentTest = getCommitmentById(commitment.id);\n\t\t\t\tif (!commitmentTest) {\n\t\t\t\t\tconsole.warn(`[NQTR] Commitment ${commitment.id} not found, it will be ignored`);\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn commitment.id;\n\t\t\t})\n\t\t\t.filter((id) => id !== undefined);\n\n\t\tstorage.setVariable(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY, commitmentsIds);\n\t}\n\n\t/**\n\t * Get the commitments added during the game session.\n\t * @param id The id of the commitment.\n\t * @returns The commitment or undefined if not found.\n\t */\n\tfind(id: string): CommitmentInterface | undefined {\n\t\treturn getCommitmentById(id);\n\t}\n\n\t/**\n\t * Remove the commitments added during the game session.\n\t * @param commitment The commitment or commitments to remove.\n\t */\n\tremove(commitment: CommitmentInterface[] | CommitmentInterface) {\n\t\tif (!Array.isArray(commitment)) {\n\t\t\tcommitment = [commitment];\n\t\t}\n\t\tlet commitmentsIds = commitment.map((commitment) => {\n\t\t\treturn commitment.id;\n\t\t});\n\n\t\tlet currentCommitments = storage.getVariable<string[]>(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY);\n\t\tif (!currentCommitments) {\n\t\t\treturn;\n\t\t}\n\t\tcurrentCommitments = currentCommitments.filter((id) => !commitmentsIds.includes(id));\n\t\tstorage.setVariable(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY, currentCommitments);\n\t}\n\n\t/**\n\t * Clear all the expired commitments.\n\t */\n\tclearExpiredRoutine() {\n\t\tObject.values(registeredCommitments).forEach((commitment) => {\n\t\t\tif (commitment.expired) {\n\t\t\t\tdelete registeredCommitments[commitment.id];\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Get the current commitments. The hidden commitments are not included.\n\t * In case there is a character who has two or more commitments at the same time, will be selected the commitment with the highest priority.\n\t * Higher priority commitments are calculated using the following steps:\n\t * 1. The commitments that have Commitments BaseModel.priority set to a higher value will be selected first.\n\t * 2. If there are commitments with the same priority, the commitments that are not fixed will be selected first.\n\t * 3. If there are commitments with the same priority and the same fixed status, priority will be given to the commitment with a lower index.\n\t * @returns The current commitments.\n\t */\n\tget currentRoutine(): CommitmentInterface[] {\n\t\tlet character_commitments: { [character: string]: CommitmentInterface } = {};\n\t\t[...this.temporaryRoutine, ...this.fixedRoutine].reverse().forEach((c) => {\n\t\t\tif (c.isActive) {\n\t\t\t\tif (c.characters.length > 0) {\n\t\t\t\t\t// all the characters don't already have commitments or the commitment has a higher priority\n\t\t\t\t\tlet allAvailable = c.characters.every(\n\t\t\t\t\t\t(ch) => !character_commitments[ch.id] || c.priority > character_commitments[ch.id].priority\n\t\t\t\t\t);\n\t\t\t\t\tif (allAvailable) {\n\t\t\t\t\t\tc.characters.forEach((ch) => {\n\t\t\t\t\t\t\tcharacter_commitments[ch.id] = c;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(`[NQTR] The commitment ${c.id} has no characters assigned`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn Object.values(character_commitments);\n\t}\n\n\tget currentRoomRoutine(): CommitmentInterface[] {\n\t\treturn navigator.currentRoom?.routine || [];\n\t}\n\n\t/**\n\t * Get the character commitment.\n\t * @param character The character.\n\t * @returns The commitment or undefined if not found.\n\t */\n\tgetCommitmentByCharacter(character: CharacterInterface): CommitmentInterface | undefined {\n\t\tthis.currentRoutine.forEach((c) => {\n\t\t\tif (c.characters.map((ch) => ch.id).includes(character.id)) {\n\t\t\t\treturn c;\n\t\t\t}\n\t\t});\n\t\treturn undefined;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {storage}from'@drincs/pixi-vn';var s={};function R(i){try{let e=s[i];if(!e){console.error(`[NQTR] Room ${i} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${i}`,e);return}}var _="___nqtr-current_room_memory___",c=class{get rooms(){return Object.values(s)}get locations(){let e={};return Object.values(s).forEach(t=>{e[t.location.id]=t.location;}),Object.values(e)}get maps(){let e={};return Object.values(s).forEach(t=>{e[t.location.map.id]=t.location.map;}),Object.values(e)}get currentRoom(){let e=storage.getVariable(_);if(!e){console.error("[NQTR] The current room has not yet been set");return}let t=R(e);if(!t){console.error(`[NQTR] Current room ${e} not found`);return}return t}set currentRoom(e){if(!R(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}storage.setVariable(_,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(s).forEach(([e,t])=>{t.clearExpiredActivities();});}};var S=new c;new d;var h={},y={};function p(i){try{let e=h[i];if(!e){console.error(`[NQTR] Commitment ${i} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Commitment ${i}`,e);return}}var I="___nqtr-temporary_commitment___",d=class{get fixedRoutine(){return Object.values(y)}set fixedRoutine(e){e.forEach(t=>{y[t.id]&&console.warn(`[NQTR] Commitment id ${t.id} already exists, it will be overwritten`),y[t.id]=t;});}get temporaryRoutine(){let e=storage.getVariable(I);return e?e.map(r=>p(r)).filter(r=>r!==undefined):[]}get allRoutine(){return [...this.fixedRoutine,...this.temporaryRoutine]}add(e){Array.isArray(e)||(e=[e]);let t=e.map(r=>{if(!p(r.id)){console.warn(`[NQTR] Commitment ${r.id} not found, it will be ignored`);return}return r.id}).filter(r=>r!==undefined);storage.setVariable(I,t);}find(e){return p(e)}remove(e){Array.isArray(e)||(e=[e]);let t=e.map(o=>o.id),r=storage.getVariable(I);r&&(r=r.filter(o=>!t.includes(o)),storage.setVariable(I,r));}clearExpiredRoutine(){Object.values(h).forEach(e=>{e.expired&&delete h[e.id];});}get currentRoutine(){let e={};return [...this.temporaryRoutine,...this.fixedRoutine].reverse().forEach(t=>{t.isActive&&(t.characters.length>0?t.characters.every(o=>!e[o.id]||t.priority>e[o.id].priority)&&t.characters.forEach(o=>{e[o.id]=t;}):console.error(`[NQTR] The commitment ${t.id} has no characters assigned`));}),Object.values(e)}get currentRoomRoutine(){return S.currentRoom?.routine||[]}getCommitmentByCharacter(e){this.currentRoutine.forEach(t=>{if(t.characters.map(r=>r.id).includes(e.id))return t});}};export{d as default};//# sourceMappingURL=RoutineManager.mjs.map
|
|
2
|
+
//# sourceMappingURL=RoutineManager.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/decorators/RoomDecorator.ts","../../src/managers/NavigatorManager.ts","../../src/managers/index.ts","../../src/decorators/CommitmentDecorator.ts","../../src/managers/RoutineManager.ts"],"names":["registeredRooms","getRoomById","id","room","CURRENT_ROOM_MEMORY_KEY","NavigatorManager","result","roomId","storage","_","timeTracker","navigator","RoutineManager","questsNotebook","registeredCommitments","fixedCommitments","getCommitmentById","commitment","TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY","commitments","c","commitmentsIds","currentCommitments","character_commitments","ch","character"],"mappings":"sCAEO,IAAMA,CAAAA,CAAmD,EAAC,CA2B1D,SAASC,CAAAA,CAAYC,EAAuC,CAClE,GAAI,CACH,IAAIC,CAAOH,CAAAA,CAAAA,CAAgBE,CAAE,CAAA,CAC7B,GAAI,CAACC,CAAAA,CAAM,CACV,OAAA,CAAQ,KAAM,CAAA,CAAA,YAAA,EAAeD,CAAE,CAAA,UAAA,CAAY,EAC3C,MACD,CACA,OAAOC,CACR,CAAS,MAAA,CAAA,CAAG,CACX,OAAA,CAAQ,MAAM,CAAmCD,gCAAAA,EAAAA,CAAE,CAAI,CAAA,CAAA,CAAC,CACxD,CAAA,MACD,CACD,CCrCA,IAAME,CAA0B,CAAA,gCAAA,CACXC,CAArB,CAAA,KAAsC,CACrC,IAAI,KAAQ,EAAA,CACX,OAAO,MAAO,CAAA,MAAA,CAAOL,CAAe,CACrC,CACA,IAAI,SAAY,EAAA,CACf,IAAIM,CAA8C,CAAA,EAClD,CAAA,OAAA,MAAA,CAAO,MAAON,CAAAA,CAAe,CAAE,CAAA,OAAA,CAASG,GAAS,CAChDG,CAAAA,CAAOH,CAAK,CAAA,QAAA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AOL,CAET,CAAC,EAEF,CACD","file":"RoutineManager.mjs","sourcesContent":["import { RoomInterface } from \"../interface\";\n\nexport const registeredRooms: { [id: string]: RoomInterface } = {};\n\n/**\n * Save a room in the registered rooms. If the room already exists, it will be overwritten.\n * @param room The room to save.\n * @returns\n * @example\n * ```ts\n * saveRoom([mcRoom, aliceRoom, annRoom, bathroom, lounge, terrace, gymRoom]);\n * ```\n */\nexport function saveRoom(room: RoomInterface | RoomInterface[]) {\n\tif (Array.isArray(room)) {\n\t\troom.forEach((c) => saveRoom(c));\n\t\treturn;\n\t}\n\tif (registeredRooms[room.id]) {\n\t\tconsole.warn(`[NQTR] Room id ${room.id} already exists, it will be overwritten`);\n\t}\n\tregisteredRooms[room.id] = room;\n}\n\n/**\n * Get a room by its id.\n * @param id The id of the room.\n * @returns The room or undefined if not found.\n */\nexport function getRoomById(id: string): RoomInterface | undefined {\n\ttry {\n\t\tlet room = registeredRooms[id];\n\t\tif (!room) {\n\t\t\tconsole.error(`[NQTR] Room ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn room;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Room ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { getRoomById, registeredRooms } from \"../decorators/RoomDecorator\";\nimport { LocationInterface, MapInterface, RoomInterface } from \"../interface\";\n\nconst CURRENT_ROOM_MEMORY_KEY = \"___nqtr-current_room_memory___\";\nexport default class NavigatorManager {\n\tget rooms() {\n\t\treturn Object.values(registeredRooms);\n\t}\n\tget locations() {\n\t\tlet result: { [id: string]: LocationInterface } = {};\n\t\tObject.values(registeredRooms).forEach((room) => {\n\t\t\tresult[room.location.id] = room.location;\n\t\t});\n\t\treturn Object.values(result);\n\t}\n\tget maps() {\n\t\tlet result: { [id: string]: MapInterface } = {};\n\t\tObject.values(registeredRooms).forEach((room) => {\n\t\t\tresult[room.location.map.id] = room.location.map;\n\t\t});\n\t\treturn Object.values(result);\n\t}\n\tget currentRoom(): RoomInterface | undefined {\n\t\tlet roomId = storage.getVariable<string>(CURRENT_ROOM_MEMORY_KEY);\n\t\tif (!roomId) {\n\t\t\tconsole.error(`[NQTR] The current room has not yet been set`);\n\t\t\treturn;\n\t\t}\n\t\tlet room = getRoomById(roomId);\n\t\tif (!room) {\n\t\t\tconsole.error(`[NQTR] Current room ${roomId} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn room;\n\t}\n\tset currentRoom(room: RoomInterface) {\n\t\tlet roomRegistrated = getRoomById(room.id);\n\t\tif (!roomRegistrated) {\n\t\t\tconsole.error(`[NQTR] The room ${room.id} is not registered, so it can't be set as current room`);\n\t\t\treturn;\n\t\t}\n\t\tstorage.setVariable(CURRENT_ROOM_MEMORY_KEY, room.id);\n\t}\n\tget currentLocation(): LocationInterface | undefined {\n\t\treturn this.currentRoom?.location;\n\t}\n\tget currentMap(): MapInterface | undefined {\n\t\treturn this.currentRoom?.location.map;\n\t}\n\t/**\n\t * Clear all the expired activities.\n\t */\n\tclearExpiredActivities() {\n\t\tObject.entries(registeredRooms).forEach(([_, room]) => {\n\t\t\troom.clearExpiredActivities();\n\t\t});\n\t}\n}\n","import 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 { CommitmentInterface } from \"../interface\";\n\nexport const registeredCommitments: { [id: string]: CommitmentInterface } = {};\nexport const fixedCommitments: { [id: string]: CommitmentInterface } = {};\n\n/**\n * Save a commitment in the registered commitments. If the commitment already exists, it will be overwritten.\n * @param commitment The commitment or commitments to save.\n * @returns\n */\nexport function saveCommitment(commitment: CommitmentInterface | CommitmentInterface[]) {\n\tif (Array.isArray(commitment)) {\n\t\tcommitment.forEach((c) => saveCommitment(c));\n\t\treturn;\n\t}\n\tif (registeredCommitments[commitment.id]) {\n\t\tconsole.warn(`[NQTR] Commitment id ${commitment.id} already exists, it will be overwritten`);\n\t}\n\tregisteredCommitments[commitment.id] = commitment;\n}\n\n/**\n * Get a commitment by its id.\n * @param id The id of the commitment.\n * @returns The commitment or undefined if not found.\n */\nexport function getCommitmentById(id: string): CommitmentInterface | undefined {\n\ttry {\n\t\tlet commitment = registeredCommitments[id];\n\t\tif (!commitment) {\n\t\t\tconsole.error(`[NQTR] Commitment ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn commitment;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Commitment ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { CharacterInterface, storage } from \"@drincs/pixi-vn\";\nimport { navigator } from \".\";\nimport { fixedCommitments, getCommitmentById, registeredCommitments } from \"../decorators/CommitmentDecorator\";\nimport { CommitmentInterface } from \"../interface\";\n\nconst TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY = \"___nqtr-temporary_commitment___\";\nexport default class RoutineManager {\n\tget fixedRoutine(): CommitmentInterface[] {\n\t\treturn Object.values(fixedCommitments);\n\t}\n\t/**\n\t * Set a commitment as fixed, it will be always available. They cannot be deleted or edit during the game session.\n\t */\n\tset fixedRoutine(commitments: CommitmentInterface[]) {\n\t\tcommitments.forEach((c) => {\n\t\t\tif (fixedCommitments[c.id]) {\n\t\t\t\tconsole.warn(`[NQTR] Commitment id ${c.id} already exists, it will be overwritten`);\n\t\t\t}\n\t\t\tfixedCommitments[c.id] = c;\n\t\t});\n\t}\n\n\t/**\n\t * Get the temporary commitments by its id.\n\t * @returns The temporary commitments.\n\t */\n\tget temporaryRoutine(): CommitmentInterface[] {\n\t\tlet commitmentsIds = storage.getVariable<string[]>(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY);\n\t\tif (!commitmentsIds) {\n\t\t\treturn [];\n\t\t}\n\t\tlet commitments = commitmentsIds\n\t\t\t.map((id) => getCommitmentById(id))\n\t\t\t.filter((commitment) => commitment !== undefined);\n\t\treturn commitments;\n\t}\n\n\tget allRoutine(): CommitmentInterface[] {\n\t\treturn [...this.fixedRoutine, ...this.temporaryRoutine];\n\t}\n\n\t/**\n\t * This feature adds the commitments during the game session.\n\t * @param commitment The commitment or commitments to add.\n\t */\n\tadd(commitment: CommitmentInterface[] | CommitmentInterface) {\n\t\tif (!Array.isArray(commitment)) {\n\t\t\tcommitment = [commitment];\n\t\t}\n\t\tlet commitmentsIds = commitment\n\t\t\t.map((commitment) => {\n\t\t\t\tlet commitmentTest = getCommitmentById(commitment.id);\n\t\t\t\tif (!commitmentTest) {\n\t\t\t\t\tconsole.warn(`[NQTR] Commitment ${commitment.id} not found, it will be ignored`);\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn commitment.id;\n\t\t\t})\n\t\t\t.filter((id) => id !== undefined);\n\n\t\tstorage.setVariable(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY, commitmentsIds);\n\t}\n\n\t/**\n\t * Get the commitments added during the game session.\n\t * @param id The id of the commitment.\n\t * @returns The commitment or undefined if not found.\n\t */\n\tfind(id: string): CommitmentInterface | undefined {\n\t\treturn getCommitmentById(id);\n\t}\n\n\t/**\n\t * Remove the commitments added during the game session.\n\t * @param commitment The commitment or commitments to remove.\n\t */\n\tremove(commitment: CommitmentInterface[] | CommitmentInterface) {\n\t\tif (!Array.isArray(commitment)) {\n\t\t\tcommitment = [commitment];\n\t\t}\n\t\tlet commitmentsIds = commitment.map((commitment) => {\n\t\t\treturn commitment.id;\n\t\t});\n\n\t\tlet currentCommitments = storage.getVariable<string[]>(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY);\n\t\tif (!currentCommitments) {\n\t\t\treturn;\n\t\t}\n\t\tcurrentCommitments = currentCommitments.filter((id) => !commitmentsIds.includes(id));\n\t\tstorage.setVariable(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY, currentCommitments);\n\t}\n\n\t/**\n\t * Clear all the expired commitments.\n\t */\n\tclearExpiredRoutine() {\n\t\tObject.values(registeredCommitments).forEach((commitment) => {\n\t\t\tif (commitment.expired) {\n\t\t\t\tdelete registeredCommitments[commitment.id];\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Get the current commitments. The hidden commitments are not included.\n\t * In case there is a character who has two or more commitments at the same time, will be selected the commitment with the highest priority.\n\t * Higher priority commitments are calculated using the following steps:\n\t * 1. The commitments that have Commitments BaseModel.priority set to a higher value will be selected first.\n\t * 2. If there are commitments with the same priority, the commitments that are not fixed will be selected first.\n\t * 3. If there are commitments with the same priority and the same fixed status, priority will be given to the commitment with a lower index.\n\t * @returns The current commitments.\n\t */\n\tget currentRoutine(): CommitmentInterface[] {\n\t\tlet character_commitments: { [character: string]: CommitmentInterface } = {};\n\t\t[...this.temporaryRoutine, ...this.fixedRoutine].reverse().forEach((c) => {\n\t\t\tif (c.isActive) {\n\t\t\t\tif (c.characters.length > 0) {\n\t\t\t\t\t// all the characters don't already have commitments or the commitment has a higher priority\n\t\t\t\t\tlet allAvailable = c.characters.every(\n\t\t\t\t\t\t(ch) => !character_commitments[ch.id] || c.priority > character_commitments[ch.id].priority\n\t\t\t\t\t);\n\t\t\t\t\tif (allAvailable) {\n\t\t\t\t\t\tc.characters.forEach((ch) => {\n\t\t\t\t\t\t\tcharacter_commitments[ch.id] = c;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(`[NQTR] The commitment ${c.id} has no characters assigned`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn Object.values(character_commitments);\n\t}\n\n\tget currentRoomRoutine(): CommitmentInterface[] {\n\t\treturn navigator.currentRoom?.routine || [];\n\t}\n\n\t/**\n\t * Get the character commitment.\n\t * @param character The character.\n\t * @returns The commitment or undefined if not found.\n\t */\n\tgetCommitmentByCharacter(character: CharacterInterface): CommitmentInterface | undefined {\n\t\tthis.currentRoutine.forEach((c) => {\n\t\t\tif (c.characters.map((ch) => ch.id).includes(character.id)) {\n\t\t\t\treturn c;\n\t\t\t}\n\t\t});\n\t\treturn undefined;\n\t}\n}\n"]}
|
|
@@ -1,84 +1,74 @@
|
|
|
1
1
|
import { TimeSettings, ITimeStlot } from '../types/TimeSettings.mjs';
|
|
2
2
|
|
|
3
3
|
declare class TimeManager {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* Set time settings, Is very important to set the settings before using the nqtr library, bacause more of the features are based on the time settings.
|
|
13
|
-
*/
|
|
14
|
-
static set settings(value: TimeSettings);
|
|
15
|
-
static get minDayHours(): number;
|
|
16
|
-
static get maxDayHours(): number;
|
|
17
|
-
static get defaultTimeSpent(): number;
|
|
18
|
-
static get timeSlots(): ITimeStlot[];
|
|
19
|
-
static get weekLength(): number;
|
|
20
|
-
static get weekendStartDay(): number;
|
|
21
|
-
static get weekDaysNames(): string[];
|
|
4
|
+
initialize(settings: TimeSettings): void;
|
|
5
|
+
get minDayHours(): number;
|
|
6
|
+
get maxDayHours(): number;
|
|
7
|
+
get defaultTimeSpent(): number;
|
|
8
|
+
get timeSlots(): ITimeStlot[];
|
|
9
|
+
get weekLength(): number;
|
|
10
|
+
get weekendStartDay(): number;
|
|
11
|
+
get weekDaysNames(): string[];
|
|
22
12
|
/**
|
|
23
13
|
* Get the current hour
|
|
24
14
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
get currentHour(): number;
|
|
16
|
+
set currentHour(value: number | undefined);
|
|
27
17
|
/**
|
|
28
18
|
* Get the current day
|
|
29
19
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
get currentDay(): number;
|
|
21
|
+
set currentDay(value: number | undefined);
|
|
32
22
|
/**
|
|
33
23
|
* If the current day is greater than or equal to the weekend start day, then it will return true.
|
|
34
24
|
*/
|
|
35
|
-
|
|
25
|
+
get isWeekend(): boolean;
|
|
36
26
|
/**
|
|
37
|
-
* Get the current week day number (1-
|
|
27
|
+
* Get the current week day number (1 - {@link weekLength}).
|
|
38
28
|
* For example, if the week length is 7 and the current day is 10, then the result will be 4.
|
|
39
29
|
*/
|
|
40
|
-
|
|
30
|
+
get currentWeekDayNumber(): number;
|
|
41
31
|
/**
|
|
42
32
|
* Get the current week day name. If the week days names are not defined, then it will return undefined.
|
|
43
33
|
* 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'.
|
|
44
34
|
* @default ""
|
|
45
35
|
*/
|
|
46
|
-
|
|
36
|
+
get currentDayName(): string;
|
|
47
37
|
/**
|
|
48
|
-
* Get the current
|
|
38
|
+
* Get the current {@link timeSlots} index.
|
|
49
39
|
* You can use this property to create "Image that changes based on the time period":
|
|
50
40
|
* @example
|
|
51
41
|
* ```tsx
|
|
52
|
-
* import {
|
|
42
|
+
* import { weekLength } from '@drincs/nqtr';
|
|
53
43
|
*
|
|
54
44
|
* function changeBackground() {
|
|
55
45
|
* return (
|
|
56
|
-
* <img src={`background
|
|
46
|
+
* <img src={`background-currentTimeSlot.currentTimeSlot.png`} />
|
|
57
47
|
* )
|
|
58
48
|
* }
|
|
59
49
|
*/
|
|
60
|
-
|
|
50
|
+
get currentTimeSlot(): number;
|
|
61
51
|
/**
|
|
62
52
|
* This function will increase the current hour by the given time spent.
|
|
63
53
|
* 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.
|
|
64
|
-
* @param timeSpent is the time spent in hours (default:
|
|
65
|
-
* @returns
|
|
54
|
+
* @param timeSpent is the time spent in hours (default: {@link defaultTimeSpent})
|
|
55
|
+
* @returns currentTimeSlot.currentHour
|
|
66
56
|
*/
|
|
67
|
-
|
|
57
|
+
increaseHour(timeSpent?: number): number;
|
|
68
58
|
/**
|
|
69
59
|
* This function will increase the current day by the given days.
|
|
70
|
-
* @param newDayHour is the hour of the new day (default:
|
|
60
|
+
* @param newDayHour is the hour of the new day (default: {@link minDayHours})
|
|
71
61
|
* @param days is the number of days to increase (default: 1)
|
|
72
|
-
* @returns
|
|
62
|
+
* @returns timeTracker.currentDay
|
|
73
63
|
*/
|
|
74
|
-
|
|
64
|
+
increaseDay(newDayHour?: number, days?: number): number;
|
|
75
65
|
/**
|
|
76
66
|
* This function will check if the current hour is between the given hours.
|
|
77
|
-
* @param fromHour the starting hour. If the
|
|
67
|
+
* @param fromHour the starting hour. If the {@link currentHour} is equal to this hour, the function will return true.
|
|
78
68
|
* @param toHour the ending hour.
|
|
79
69
|
* @returns true if the current hour is between the given hours, otherwise false.
|
|
80
70
|
*/
|
|
81
|
-
|
|
71
|
+
nowIsBetween(fromHour: number | undefined, toHour: number | undefined): boolean;
|
|
82
72
|
}
|
|
83
73
|
|
|
84
74
|
export { TimeManager as default };
|