UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_rank.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rank_t
 Describes a rank that a recruit can gain. More...

Macros

#define MAX_RANKS   32

Functions

void CL_ParseRanks (const char *name, const char **text)
 Parse medals and ranks defined in the medals.ufo file.
int CL_GetRankIdx (const char *rankID)
 Get the index of the given rankID in ccs.ranks array.
rank_t * CL_GetRankByIdx (const int index)
 Returns a rank at an index.

Macro Definition Documentation

◆ MAX_RANKS

#define MAX_RANKS   32

Definition at line 26 of file cp_rank.h.

Referenced by CL_ParseRanks().

Function Documentation

◆ CL_GetRankByIdx()

rank_t * CL_GetRankByIdx ( const int index)

Returns a rank at an index.

Parameters
[in]indexIndex of rank in ccs.ranks
Returns
nullptr on invalid index
pointer to the rank definition otherwise

Definition at line 50 of file cp_rank.cpp.

References ccs, CL_GetRankByIdx(), index, ccs_t::numRanks, and ccs_t::ranks.

Referenced by CHAR_UpdateStats(), CL_GetRankByIdx(), CP_TEAM_FillBDEFEmployeeList_f(), GAME_CP_CharacterCvars(), HOS_GetRank(), Employee::salary(), TR_CargoList(), and TR_FillEmployees().

◆ CL_GetRankIdx()

int CL_GetRankIdx ( const char * rankID)

Get the index of the given rankID in ccs.ranks array.

Parameters
[in]rankIDScript id of the rank
Returns
-1 if no rank with rankID found

Definition at line 34 of file cp_rank.cpp.

References ccs, CL_GetRankIdx(), i, rank_t::id, ccs_t::numRanks, Q_streq, and ccs_t::ranks.

Referenced by CL_GetRankIdx(), and E_CreateEmployee().

◆ CL_ParseRanks()

void CL_ParseRanks ( const char * name,
const char ** text )