RedCore
Loading...
Searching...
No Matches
ResourceLoadEvent.h
Go to the documentation of this file.
1#pragma once
2
3#include <red/event_sys/EventBase.h>
4#include <red/event_sys/EventDelegator.h>
5#include <heap/seadHeap.h>
6
7namespace red {
8
10 public:
11 enum class Stage {
15 };
16
17 template <Stage S>
18 class Listener {
19 public:
20 Listener(ListenerFunc f, s32 priority = 0)
22 {
23 ResourceLoadEvent::subscribe<S>(mListener);
24 }
25
26 private:
27 EventDelegator<ResourceLoadEvent>::Listener mListener;
28 };
29
30 private:
31 explicit ResourceLoadEvent(sead::Heap* heap)
32 : mHeap(heap)
33 { }
34
35 public:
36 [[nodiscard]]
37 sead::Heap* getHeap() const { return mHeap; }
38
39 private:
40 template <Stage S>
41 [[nodiscard]]
42 static Delegator& getDelegator();
43
44 template <Stage S>
45 static void subscribe(EventDelegator<ResourceLoadEvent>::Listener& listener) {
46 getDelegator<S>().connect(listener);
47 }
48
49 public: //! TODO: Make private
50 // 0x0200A8FC
51 static void emitCSBoot(sead::Heap* heap, Stage type);
52 // 0x0200A884
53 static void emitCourse(sead::Heap* heap);
54
55 private:
56 sead::Heap* mHeap;
57 };
58
59}
Definition ResourceLoadEvent.h:18
Listener(ListenerFunc f, s32 priority=0)
Definition ResourceLoadEvent.h:20
Definition ResourceLoadEvent.h:9
static void emitCSBoot(sead::Heap *heap, Stage type)
TODO: Make private.
static void emitCourse(sead::Heap *heap)
sead::Heap * getHeap() const
Definition ResourceLoadEvent.h:37
Stage
Definition ResourceLoadEvent.h:11
@ CourseSelect
Definition ResourceLoadEvent.h:14
@ Course
Definition ResourceLoadEvent.h:13
@ Boot
Definition ResourceLoadEvent.h:12
Definition ActorDonutBlock.h:5