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>
13
14class Event {
15private:
16 template <class T>
17 friend class ::ll::event::Cancellable;
18
19 bool mCancelled{false};
20
21 LLAPI void serializeWithCancel(CompoundTag&) const;
22 LLAPI void deserializeWithCancel(CompoundTag const&);
23
24protected:
25 constexpr Event() = default;
26
27public:
28 LLAPI virtual ~Event() = default;
29
30 LLAPI virtual void serialize(CompoundTag&) const;
31 LLAPI virtual void deserialize(CompoundTag const&);
32
33 LLAPI virtual EventId getId() const;
34
35 static constexpr EventIdView CustomEventId{EmptyEventId};
36};
37} // namespace ll::event
Definition CompoundTag.h:13
Definition Event.h:12
Definition EventId.h:17
Definition EventId.h:8
Definition Event.h:14
Definition serialize.h:11