F4MP/tiltedcode/Code/client/Services/QuestService.h
Jous99 37b16f1547 code upload
codigo original de f4mp y tilted para referencias
2026-01-06 18:45:00 +01:00

41 lines
1.1 KiB
C++

#pragma once
#include <World.h>
#include <Events/EventDispatcher.h>
#include <Games/Events.h>
struct NotifyQuestUpdate;
struct TESQuest;
/**
* @brief Handles quest sync
*
* This service is currently not in use.
*/
class QuestService final : public BSTEventSink<TESQuestStartStopEvent>, BSTEventSink<TESQuestStageEvent>
{
public:
QuestService(World&, entt::dispatcher&);
~QuestService() = default;
static bool IsNonSyncableQuest(TESQuest* apQuest);
static void DebugDumpQuests();
static bool StopQuest(uint32_t aformId);
private:
friend struct QuestEventHandler;
void OnConnected(const ConnectedEvent&) noexcept;
BSTEventResult OnEvent(const TESQuestStartStopEvent*, const EventDispatcher<TESQuestStartStopEvent>*) override;
BSTEventResult OnEvent(const TESQuestStageEvent*, const EventDispatcher<TESQuestStageEvent>*) override;
void OnQuestUpdate(const NotifyQuestUpdate&) noexcept;
World& m_world;
entt::scoped_connection m_joinedConnection;
entt::scoped_connection m_leftConnection;
entt::scoped_connection m_questUpdateConnection;
};