RedCore
Loading...
Searching...
No Matches
red::ProfileBuilder< Derived > Class Template Reference

Base class for builder objects that operate on profiles. Tracks which fields were set and holds their data. More...

#include <ProfileBuilder.h>

Public Member Functions

Derived & createInfo (const ActorCreateInfo *createInfo)
 Set the ActorCreateInfo field in the profile.
Derived & flag (const Profile::Flag flag)
 Set the Flag field in the profile.
Derived & drawPriority (const s16 drawPriority)
 Set the drawPriority field in the profile.
Derived & executePriority (const s16 executePriority)
 Set the executePriority field in the profile.
template<ComptimeFixedString... Args>
requires (sizeof...(Args) > 0)
Derived & resources (ProfileInfo::ResType type)
 Set the resources field in the profile.

Protected Attributes

const ActorCreateInfomCreateInfo = nullptr
 The createInfo data for the profile we are building.
Profile::Flag mFlag = Profile::cFlag_None
 The flag data for the profile we are building.
s16 mDrawPriority = ProfileInfo::cProfileID_Max
 The drawPriority data for the profile we are building.
s16 mExecutePriority = ProfileInfo::cProfileID_Max
 The createInfo data for the profile we are building. This is a custom field added by RedCore.
u8 mResourceCount = 0
 The entry for ProfileInfo::cResNum for the profile we are building. This is stored separately for custom profiles.
sead::SafeStringmResources = nullptr
 The entry for ProfileInfo::cResList for the profile we are building. This is stored separately for custom profiles.
ProfileInfo::ResType mResourceType = ProfileInfo::cResType_Course
 The entry for ProfileInfo::cResType for the profile we are building. This is stored separately for custom profiles.
bool mCreateInfoModified = false
 Whether mCreateInfo was modified. Used for validation and partial application in red::ProfileEditBuilder.
bool mFlagModified = false
 Whether mFlag was modified. Used for validation and partial application in red::ProfileEditBuilder.
bool mDrawPriorityModified = false
 Whether mDrawPriority was modified. Used for validation and partial application in red::ProfileEditBuilder.
bool mExecutePriorityModified = false
 Whether mExecutePriority was modified. Used for validation and partial application in red::ProfileEditBuilder.
bool mResourcesModified = false
 Whether mResources was modified. Used for validation and partial application in red::ProfileEditBuilder.

Detailed Description

template<typename Derived>
class red::ProfileBuilder< Derived >

Base class for builder objects that operate on profiles. Tracks which fields were set and holds their data.

Template Parameters
DerivedThe type of builder which inherits this one. Used for casting for the builder pattern.

Member Function Documentation

◆ createInfo()

template<typename Derived>
Derived & red::ProfileBuilder< Derived >::createInfo ( const ActorCreateInfo * createInfo)
inlinenodiscard

Set the ActorCreateInfo field in the profile.

Returns
The builder object for chaining calls.

◆ flag()

template<typename Derived>
Derived & red::ProfileBuilder< Derived >::flag ( const Profile::Flag flag)
inlinenodiscard

Set the Flag field in the profile.

Returns
The builder object for chaining calls.

◆ drawPriority()

template<typename Derived>
Derived & red::ProfileBuilder< Derived >::drawPriority ( const s16 drawPriority)
inlinenodiscard

Set the drawPriority field in the profile.

Returns
The builder object for chaining calls.

◆ executePriority()

template<typename Derived>
Derived & red::ProfileBuilder< Derived >::executePriority ( const s16 executePriority)
inlinenodiscard

Set the executePriority field in the profile.

Note
This is a custom field added by RedCore.
Returns
The builder object for chaining calls.

◆ resources()

template<typename Derived>
template<ComptimeFixedString... Args>
requires (sizeof...(Args) > 0)
Derived & red::ProfileBuilder< Derived >::resources ( ProfileInfo::ResType type)
inlinenodiscard

Set the resources field in the profile.

Template Parameters
ArgsComma-separated list of string literals representing which resources to load.
Parameters
typeAt what stage of the game to load these resources.
Returns
The builder object for chaining calls.

Member Data Documentation

◆ mCreateInfo

template<typename Derived>
const ActorCreateInfo* red::ProfileBuilder< Derived >::mCreateInfo = nullptr
protected

The createInfo data for the profile we are building.

◆ mFlag

template<typename Derived>
Profile::Flag red::ProfileBuilder< Derived >::mFlag = Profile::cFlag_None
protected

The flag data for the profile we are building.

◆ mDrawPriority

template<typename Derived>
s16 red::ProfileBuilder< Derived >::mDrawPriority = ProfileInfo::cProfileID_Max
protected

The drawPriority data for the profile we are building.

◆ mExecutePriority

template<typename Derived>
s16 red::ProfileBuilder< Derived >::mExecutePriority = ProfileInfo::cProfileID_Max
protected

The createInfo data for the profile we are building. This is a custom field added by RedCore.

◆ mResourceCount

template<typename Derived>
u8 red::ProfileBuilder< Derived >::mResourceCount = 0
protected

The entry for ProfileInfo::cResNum for the profile we are building. This is stored separately for custom profiles.

◆ mResources

template<typename Derived>
sead::SafeString* red::ProfileBuilder< Derived >::mResources = nullptr
protected

The entry for ProfileInfo::cResList for the profile we are building. This is stored separately for custom profiles.

◆ mResourceType

template<typename Derived>
ProfileInfo::ResType red::ProfileBuilder< Derived >::mResourceType = ProfileInfo::cResType_Course
protected

The entry for ProfileInfo::cResType for the profile we are building. This is stored separately for custom profiles.

◆ mCreateInfoModified

template<typename Derived>
bool red::ProfileBuilder< Derived >::mCreateInfoModified = false
protected

Whether mCreateInfo was modified. Used for validation and partial application in red::ProfileEditBuilder.

◆ mFlagModified

template<typename Derived>
bool red::ProfileBuilder< Derived >::mFlagModified = false
protected

Whether mFlag was modified. Used for validation and partial application in red::ProfileEditBuilder.

◆ mDrawPriorityModified

template<typename Derived>
bool red::ProfileBuilder< Derived >::mDrawPriorityModified = false
protected

Whether mDrawPriority was modified. Used for validation and partial application in red::ProfileEditBuilder.

◆ mExecutePriorityModified

template<typename Derived>
bool red::ProfileBuilder< Derived >::mExecutePriorityModified = false
protected

Whether mExecutePriority was modified. Used for validation and partial application in red::ProfileEditBuilder.

◆ mResourcesModified

template<typename Derived>
bool red::ProfileBuilder< Derived >::mResourcesModified = false
protected

Whether mResources was modified. Used for validation and partial application in red::ProfileEditBuilder.