#include <C4RankSystem.h>
Public Types | |
enum | { EXP_NoPromotion = -1 } |
Public Member Functions | |
C4RankSystem () | |
~C4RankSystem () | |
void | Default () |
void | Clear () |
int | Init (const char *szRegister, const char *szDefRanks, int iRankBase) |
bool | Load (C4Group &hGroup, const char *szFilenames, int DefRankBase, const char *szLanguage) |
int | Experience (int iRank) |
int | RankByExperience (int iExp) |
StdStrBuf | GetRankName (int iRank, bool fReturnLastIfOver) |
bool | Check (int iRank, const char *szDefRankName) |
int32_t | GetExtendedRankNum () const |
int32_t | GetBaseRankNum () const |
Static Public Member Functions | |
static bool | DrawRankSymbol (C4FacetSurface *fctSymbol, int32_t iRank, C4Facet *pfctRankSymbols, int32_t iRankSymbolCount, bool fOwnSurface, int32_t iXOff=0, C4Facet *cgoDrawDirect=nullptr) |
Protected Attributes | |
char | Register [256+1] |
char | RankName [C4MaxName+1] |
int | RankBase |
char ** | pszRankNames {nullptr} |
char * | szRankNames {nullptr} |
int | iRankNum |
char ** | pszRankExtensions {nullptr} |
int | iRankExtNum |
Definition at line 25 of file C4RankSystem.h.
anonymous enum |
C4RankSystem::C4RankSystem | ( | ) |
Definition at line 30 of file C4RankSystem.cpp.
References Default().
|
inline |
Definition at line 29 of file C4RankSystem.h.
References Clear().
bool C4RankSystem::Check | ( | int | iRank, |
const char * | szDefRankName | ||
) |
void C4RankSystem::Clear | ( | ) |
Definition at line 260 of file C4RankSystem.cpp.
References iRankExtNum, iRankNum, pszRankExtensions, pszRankNames, and szRankNames.
Referenced by Default(), Init(), Load(), and ~C4RankSystem().
void C4RankSystem::Default | ( | ) |
Definition at line 271 of file C4RankSystem.cpp.
References Clear(), iRankExtNum, RankBase, RankName, and Register.
Referenced by C4RankSystem(), and C4Game::Default().
|
static |
Definition at line 280 of file C4RankSystem.cpp.
References C4FacetSurface::Create(), C4Facet::Draw(), C4Facet::DrawX(), C4GraphicsResource::fctCaptain, C4Facet::GetPhase(), C4Facet::GetPhaseNum(), GraphicsResource, iSize, C4FacetSurface::Set(), C4Facet::Surface, C4Facet::Wdt, C4Facet::X, and C4Facet::Y.
Referenced by C4GraphicsOverlay::DrawRankSymbol(), and C4ObjectInfo::Save().
int C4RankSystem::Experience | ( | int | iRank | ) |
Definition at line 232 of file C4RankSystem.cpp.
References RankBase.
Referenced by C4PlayerInfoCore::CheckPromotion(), C4Object::DoExperience(), C4ObjectInfoCore::GetNextRankInfo(), RankByExperience(), and C4ObjectInfoCore::UpdateCustomRanks().
|
inline |
Definition at line 52 of file C4RankSystem.h.
References iRankNum.
Referenced by C4GraphicsOverlay::DrawRankSymbol().
|
inline |
StdStrBuf C4RankSystem::GetRankName | ( | int | iRank, |
bool | fReturnLastIfOver | ||
) |
Definition at line 186 of file C4RankSystem.cpp.
References StdStrBuf::Format(), iRankExtNum, iRankNum, StdStrBuf::isNull(), pszRankExtensions, pszRankNames, StdStrBuf::Ref(), Register, and sprintf.
Referenced by C4PlayerInfoCore::Default(), C4ObjectInfoCore::GetNextRankInfo(), C4PlayerInfoCore::Promote(), C4ObjectInfoCore::Promote(), C4Object::Promote(), C4ObjectInfo::Recruit(), and C4ObjectInfoCore::UpdateCustomRanks().
int C4RankSystem::Init | ( | const char * | szRegister, |
const char * | szDefRanks, | ||
int | iRankBase | ||
) |
Definition at line 35 of file C4RankSystem.cpp.
References StdStrBuf::AppendChars(), C4MaxName, Clear(), StdStrBuf::getData(), StdStrBuf::getMData(), iRankNum, StdStrBuf::isNull(), pszRankNames, RankBase, Register, SCopy(), SCopySegment(), sprintf, and szRankNames.
Referenced by C4Game::PreInit().
bool C4RankSystem::Load | ( | C4Group & | hGroup, |
const char * | szFilenames, | ||
int | DefRankBase, | ||
const char * | szLanguage | ||
) |
Definition at line 97 of file C4RankSystem.cpp.
References Clear(), C4ComponentHost::GetData(), C4ComponentHost::GetDataSize(), iRankExtNum, iRankNum, iSize, C4Language::LoadComponentHost(), pszRankExtensions, pszRankNames, RankBase, SCharPos(), SEqual(), and szRankNames.
int C4RankSystem::RankByExperience | ( | int | iExp | ) |
Definition at line 238 of file C4RankSystem.cpp.
References Experience().
|
protected |
Definition at line 41 of file C4RankSystem.h.
Referenced by Clear(), Default(), GetExtendedRankNum(), GetRankName(), and Load().
|
protected |
Definition at line 39 of file C4RankSystem.h.
Referenced by Clear(), GetBaseRankNum(), GetRankName(), Init(), and Load().
|
protected |
Definition at line 40 of file C4RankSystem.h.
Referenced by Clear(), GetRankName(), and Load().
|
protected |
Definition at line 37 of file C4RankSystem.h.
Referenced by Clear(), GetRankName(), Init(), and Load().
|
protected |
Definition at line 36 of file C4RankSystem.h.
Referenced by Default(), Experience(), Init(), and Load().
|
protected |
Definition at line 35 of file C4RankSystem.h.
Referenced by Default().
|
protected |
Definition at line 34 of file C4RankSystem.h.
Referenced by Check(), Default(), GetRankName(), and Init().
|
protected |
Definition at line 38 of file C4RankSystem.h.