RedCore
Loading...
Searching...
No Matches
ProfileReplaceBuilder.h
Go to the documentation of this file.
1#pragma once
2
3#include <concepts>
4
5#include <actor/ProfileInfo.h>
6#include <actor/Actor.h>
7#include <red/registry/builder/ProfileBuilder.h>
8#include <red/public/Profile.h>
9
10namespace red {
11
12/**
13 * @brief Builder for replacing a vanilla profile with a custom one by its numeric ID.
14 * @tparam T Actor class that the profile will now instantiate.
15 */
16template <class T> requires std::derived_from<T, ActorBase>
18public:
19 /**
20 * @brief Begins replacing a vanilla profile.
21 * @param id The target profile ID to replace.
22 */
25 , mID(id)
26 {
28 tk::fatal("ERROR: Attempting to replace invalid vanilla profile ID: %i", id);
29 }
30 }
31
32 /**
33 * @brief Completes the builder by replacing the vanilla profile.
34 * @return The profile which now contains the replaced data.
35 */
38 return nullptr;
39 }
40
41 pub::Profile* profile = static_cast<pub::Profile*>(Profile::get(mID));
42
45 profile->mIsResLoaded = false;
46 profile->mFlag = this->mFlag;
47
49
50 return profile;
51 }
52
53private:
54 s32 mID; ///< The target profile ID to replace.
55};
56
57}
Definition ActorDonutBlock.h:5