LeviLamina
Loading...
Searching...
No Matches
Event.h
1#pragma once
2
3#include <concepts>
4
5#include "ll/api/base/Macro.h"
6#include "ll/api/event/EventId.h"
7
8class CompoundTag;
9
10namespace ll::event {
11template <class T>
13class CallbackStream;
14
15class Event {
16private:
17 template <class T>
18 friend class ::ll::event::Cancellable;
19
20 friend class CallbackStream;
21
22 bool mCancelled{false};
23
24 LLAPI void serializeWithCancel(CompoundTag&) const;
25 LLAPI void deserializeWithCancel(CompoundTag const&);
26
27protected:
28 constexpr Event() = default;
29
30public:
31 LLAPI virtual ~Event() = default;
32
33 LLAPI virtual void serialize(CompoundTag&) const;
34 LLAPI virtual void deserialize(CompoundTag const&);
35
36 LLAPI virtual EventId getId() const;
37
38 static constexpr EventIdView CustomEventId{EmptyEventId};
39};
40} // namespace ll::event
Definition CompoundTag.h:13
Definition Event.h:12
Definition EventId.h:17
Definition EventId.h:8
Definition Event.h:15
Definition serialize.h:11