diff --git a/src/Base/Enums/AbstractProcessEventType.php b/src/Base/Enums/AbstractProcessEventType.php new file mode 100644 index 0000000..b89e457 --- /dev/null +++ b/src/Base/Enums/AbstractProcessEventType.php @@ -0,0 +1,9 @@ + + */ +class AccessFailedHandler implements EventInStateHandlerInterface +{ + + function isResponsibleFor(AbstractProcessEventType $processEvent) + { + // TODO: Implement isResponsibleFor() method. + } + + function handle( + AbstractProcessState $processState, + Event $event, + string $eventType, + EventDispatcherInterface $eventDispatcher + ) { + // TODO: Implement handle() method. + } + +} diff --git a/src/Process/Handlers/Quest/AccessProcessingHandler.php b/src/Process/Handlers/Quest/AccessProcessingHandler.php new file mode 100644 index 0000000..2e4a579 --- /dev/null +++ b/src/Process/Handlers/Quest/AccessProcessingHandler.php @@ -0,0 +1,33 @@ + + */ +class AccessProcessingHandler implements EventInStateHandlerInterface +{ + + function isResponsibleFor(AbstractProcessEventType $processEvent) + { + // TODO: Implement isResponsibleFor() method. + } + + function handle( + AbstractProcessState $processState, + Event $event, + string $eventType, + EventDispatcherInterface $eventDispatcher + ) { + // TODO: Implement handle() method. + } + +} diff --git a/src/Process/Handlers/Quest/CompletedHandler.php b/src/Process/Handlers/Quest/CompletedHandler.php new file mode 100644 index 0000000..18719e4 --- /dev/null +++ b/src/Process/Handlers/Quest/CompletedHandler.php @@ -0,0 +1,33 @@ + + */ +class CompletedHandler implements EventInStateHandlerInterface +{ + + function isResponsibleFor(AbstractProcessEventType $processEvent) + { + // TODO: Implement isResponsibleFor() method. + } + + function handle( + AbstractProcessState $processState, + Event $event, + string $eventType, + EventDispatcherInterface $eventDispatcher + ) { + // TODO: Implement handle() method. + } + +} diff --git a/src/Process/Handlers/Quest/Completion/empty b/src/Process/Handlers/Quest/Completion/empty new file mode 100644 index 0000000..e69de29 diff --git a/src/Process/Handlers/Quest/FinishedHandler.php b/src/Process/Handlers/Quest/FinishedHandler.php new file mode 100644 index 0000000..877ddf3 --- /dev/null +++ b/src/Process/Handlers/Quest/FinishedHandler.php @@ -0,0 +1,33 @@ + + */ +class FinishedHandler implements EventInStateHandlerInterface +{ + + function isResponsibleFor(AbstractProcessEventType $processEvent) + { + // TODO: Implement isResponsibleFor() method. + } + + function handle( + AbstractProcessState $processState, + Event $event, + string $eventType, + EventDispatcherInterface $eventDispatcher + ) { + // TODO: Implement handle() method. + } + +} diff --git a/src/Process/Handlers/Quest/PlayingHandler.php b/src/Process/Handlers/Quest/PlayingHandler.php new file mode 100644 index 0000000..d17b4fd --- /dev/null +++ b/src/Process/Handlers/Quest/PlayingHandler.php @@ -0,0 +1,33 @@ + + */ +class PlayingHandler implements EventInStateHandlerInterface +{ + + function isResponsibleFor(AbstractProcessEventType $processEvent) + { + // TODO: Implement isResponsibleFor() method. + } + + function handle( + AbstractProcessState $processState, + Event $event, + string $eventType, + EventDispatcherInterface $eventDispatcher + ) { + // TODO: Implement handle() method. + } + +} diff --git a/src/Process/Handlers/Quest/Poi/StartedHandler.php b/src/Process/Handlers/Quest/Poi/StartedHandler.php new file mode 100644 index 0000000..78966bf --- /dev/null +++ b/src/Process/Handlers/Quest/Poi/StartedHandler.php @@ -0,0 +1,33 @@ + + */ +class StartedHandler implements EventInStateHandlerInterface +{ + + function isResponsibleFor(AbstractProcessEventType $processEvent) + { + // TODO: Implement isResponsibleFor() method. + } + + function handle( + AbstractProcessState $processState, + Event $event, + string $eventName, + EventDispatcherInterface $eventDispatcher + ) { + // TODO: Implement handle() method. + } + +} diff --git a/src/Process/Handlers/Quest/Poi/Step/StartedHandler.php b/src/Process/Handlers/Quest/Poi/Step/StartedHandler.php new file mode 100644 index 0000000..78966bf --- /dev/null +++ b/src/Process/Handlers/Quest/Poi/Step/StartedHandler.php @@ -0,0 +1,33 @@ + + */ +class StartedHandler implements EventInStateHandlerInterface +{ + + function isResponsibleFor(AbstractProcessEventType $processEvent) + { + // TODO: Implement isResponsibleFor() method. + } + + function handle( + AbstractProcessState $processState, + Event $event, + string $eventName, + EventDispatcherInterface $eventDispatcher + ) { + // TODO: Implement handle() method. + } + +} diff --git a/src/Process/Handlers/Quest/StartedHandler.php b/src/Process/Handlers/Quest/StartedHandler.php new file mode 100644 index 0000000..f3ee8ed --- /dev/null +++ b/src/Process/Handlers/Quest/StartedHandler.php @@ -0,0 +1,33 @@ + + */ +class StartedHandler implements EventInStateHandlerInterface +{ + + function isResponsibleFor(AbstractProcessEventType $processEvent) + { + // TODO: Implement isResponsibleFor() method. + } + + function handle( + AbstractProcessState $processState, + Event $event, + string $eventType, + EventDispatcherInterface $eventDispatcher + ) { + // TODO: Implement handle() method. + } + +} diff --git a/src/Process/Listeners/PoiHandler.php b/src/Process/Listeners/PoiHandler.php new file mode 100644 index 0000000..f9becb0 --- /dev/null +++ b/src/Process/Listeners/PoiHandler.php @@ -0,0 +1,18 @@ +eventInStateHandlers as $handler) { + if ($handler->isResponsibleFor($eventType)) { + $handler->handle($processState, $event, $eventType, $eventDispatcher); + } + } + } + +} diff --git a/src/Process/ProcessHandler.php b/src/Process/ProcessHandler.php new file mode 100644 index 0000000..9a21e4e --- /dev/null +++ b/src/Process/ProcessHandler.php @@ -0,0 +1,47 @@ +stateManagingService = $stateManagingService; + + $this->handlers = [ + 'step' => new StepHandler(), + 'poi' => new PoiHandler(), + 'quest' => new QuestHandler(), + ]; + } + + public function handle(Event $event, string $eventName, EventDispatcherInterface $eventDispatcher) + { + $eventType = AbstractProcessEventType::search($eventName); + + $currentStepState = $this->stateManagingService->detectStepState(); + $currentPoiState = $this->stateManagingService->detectPoiState(); + $currentQuestState = $this->stateManagingService->detectQuestState(); + $currentFullState = $this->stateManagingService->detectFullState(); + + $this->handlers['step']->handle($currentStepState, $event, $eventType, $eventDispatcher); + $this->handlers['poi']->handle($currentPoiState, $event, $eventType, $eventDispatcher); + $this->handlers['quest']->handle($currentQuestState, $event, $eventType, $eventDispatcher); + + } + + +} \ No newline at end of file diff --git a/src/Process/ResponsibleForEventInerface.php b/src/Process/ResponsibleForEventInerface.php new file mode 100644 index 0000000..9dfdb3a --- /dev/null +++ b/src/Process/ResponsibleForEventInerface.php @@ -0,0 +1,11 @@ +