NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_base.cpp
Go to the documentation of this file.
1#include <game/bases/d_base.hpp>
2#include <game/bases/d_game_com.hpp>
4#include <constants/sjis_constants.h>
6
11
13 mpKindString(getKindString()),
14 mpNameString(dProf_getName(mProfName)) {}
15
17
19
20 // [Possibly a stripped assert? No way someone is this dumb]
21 const dBase_c* searchParent;
22 if (parent != nullptr) {
23 searchParent = parent;
24 } else {
25 searchParent = nullptr;
26 }
27
28 dBase_c* foundBase = (dBase_c*) fManager_c::searchBaseByProfName(profile, searchParent);
29
30 // [Same here]
31 if (foundBase != nullptr) {
32 return foundBase;
33 }
34 return nullptr;
35}
36
38 return (fBase_c::preCreate() != NOT_READY);
39}
40
44
46 return (fBase_c::preDelete() != NOT_READY);
47}
48
52
57
61
66
70
71const char *dBase_c::getKindString() const {
72 return D_BASE_KIND_STRING;
73}
74
76 return FAILED;
77}
78
80
85
86dBase_c *dBase_c::createBase(ProfileName profName, dBase_c *parent, unsigned long param, u8 groupType) {
87 return (dBase_c*)fBase_c::createChild(profName, parent, param, groupType);
88}
89
90dBase_c *dBase_c::createRoot(ProfileName profName, unsigned long param, u8 groupType) {
91 return (dBase_c*)fBase_c::createRoot(profName, param, groupType);
92}
The minimum required implementation for a base.
Definition d_base.hpp:41
dBase_c()
Constructs a new base.
Definition d_base.cpp:12
static void initLoader()
[Unused]. Sets the callbacks for the scrapped relocatable profile system.
Definition d_base.cpp:81
virtual int preDelete()
pre method for the delete operation.
Definition d_base.cpp:45
virtual ~dBase_c()
Destroys the base.
Definition d_base.cpp:16
virtual void postExecute(fBase_c::MAIN_STATE_e status)
post method for the execute operation.
Definition d_base.cpp:58
virtual void postDraw(fBase_c::MAIN_STATE_e status)
post method for the draw operation.
Definition d_base.cpp:67
virtual void postCreate(fBase_c::MAIN_STATE_e status)
post method for the create operation.
Definition d_base.cpp:41
virtual const char * getKindString() const
Gets the base's kind string.
Definition d_base.cpp:71
virtual int preDraw()
pre method for the draw operation.
Definition d_base.cpp:62
static dBase_c * createRoot(ProfileName profName, unsigned long param, u8 groupType)
Creates a root base.
Definition d_base.cpp:90
virtual void postDelete(fBase_c::MAIN_STATE_e status)
post method for the delete operation.
Definition d_base.cpp:49
virtual int preExecute()
pre method for the execute operation.
Definition d_base.cpp:53
virtual int preCreate()
pre method for the create operation.
Definition d_base.cpp:37
static dBase_c * createBase(ProfileName profName, dBase_c *parent, unsigned long param, u8 groupType)
Creates a child base under the given parent.
Definition d_base.cpp:86
static void unloadCallback()
[Unused]. Module unloading callback for the scrapped relocatable profile system.
Definition d_base.cpp:79
static int loadAsyncCallback()
[Unused]. Module loading callback for the scrapped relocatable profile system.
Definition d_base.cpp:75
static dBase_c * searchBaseByProfName(ProfileName profile, const dBase_c *parent)
Searches for a base with a given profile name, optionally under a given parent.
Definition d_base.cpp:18
MAIN_STATE_e
The possible operation results.
Definition f_base.hpp:137
virtual int preCreate()
pre method for the create operation.
Definition f_base.cpp:92
static int(* sLoadAsyncCallback)()
[Unused]. See Unused Content.
Definition f_base.hpp:374
virtual int preDelete()
pre method for the delete operation.
Definition f_base.cpp:126
static fBase_c * createChild(ProfileName profName, fBase_c *parent, unsigned long param, u8 groupType)
Creates a child base under the given parent.
Definition f_base.cpp:511
virtual int preExecute()
pre method for the execute operation.
Definition f_base.cpp:172
virtual void postCreate(MAIN_STATE_e state)
post method for the create operation.
Definition f_base.cpp:96
virtual void postExecute(MAIN_STATE_e state)
post method for the execute operation.
Definition f_base.cpp:180
virtual int preDraw()
pre method for the draw operation.
Definition f_base.cpp:192
static fBase_c * createRoot(ProfileName profName, unsigned long param, u8 groupType)
Creates a root base.
Definition f_base.cpp:518
virtual void postDraw(MAIN_STATE_e state)
post method for the draw operation.
Definition f_base.cpp:200
virtual void postDelete(MAIN_STATE_e state)
post method for the delete operation.
Definition f_base.cpp:142
@ NOT_READY
The step could not completed at this time.
Definition f_base.hpp:146
@ FAILED
The step could not be completed.
Definition f_base.hpp:148
static void(* sUnloadCallback)()
[Unused]. See Unused Content.
Definition f_base.hpp:375
static fBase_c * searchBaseByProfName(ProfileName profID, const fBase_c *parent)
Searches for a base with a given profile name, optionally under a given parent.
Definition f_manager.cpp:26
static u32 g_basesRandomSeed
[Unused]. Random seed written to after dBase_c::preDraw.
Definition d_base.cpp:10
char * dProf_getName(ProfileName profName)
[Unused]. Obtains a string representing the profile name.
u16 ProfileName
The name of a profile. Value is a fProfile::PROFILE_NAME_e.
Definition f_profile.hpp:32
u32 getRandomSeed()
Gets a seed used for randomness.