LeviLamina
Loading...
Searching...
No Matches
ConsoleOutputEvent.h
1#pragma once
2
3#include "ll/api/event/Cancellable.h"
4#include "ll/api/event/Event.h"
5
6namespace ll::event::inline io {
7
8class ConsoleOutputtingEvent final : public Cancellable<Event> {
9 std::string& mMessage;
10
11public:
12 constexpr explicit ConsoleOutputtingEvent(std::string& message) : mMessage(message) {}
13
14 LLAPI void serialize(CompoundTag&) const override;
15 LLAPI void deserialize(CompoundTag const&) override;
16
17 LLNDAPI std::string& message() const;
18};
19
20class ConsoleOutputtedEvent final : public Event {
21 std::string const& mMessage;
22 bool mIsCancelled;
23
24public:
25 constexpr explicit ConsoleOutputtedEvent(std::string const& message, bool isCancelled = false)
26 : mMessage(message),
27 mIsCancelled(isCancelled) {}
28
29 LLAPI void serialize(CompoundTag&) const override;
30
31 LLNDAPI std::string const& message() const;
32 LLNDAPI bool isCancelled() const;
33};
34
35} // namespace ll::event::inline io
Definition CompoundTag.h:23