cp_rank.c File Reference

#include "../cl_shared.h"
#include "../../shared/parse.h"
#include "cp_rank.h"
#include "cp_campaign.h"
Include dependency graph for cp_rank.c:

Go to the source code of this file.

Functions

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

Variables

static const value_t rankValues []

Detailed Description

Definition in file cp_rank.c.


Function Documentation

rank_t* CL_GetRankByIdx ( const int  index  ) 

Returns a rank at an index.

Parameters:
[in] index Index of rank in ccs.ranks
Returns:
NULL on invalid index
pointer to the rank definition otherwise

Definition at line 53 of file cp_rank.c.

References ccs, ccs_s::numRanks, and ccs_s::ranks.

Referenced by CL_UpdateCharacterStats(), CP_GetWinProbabilty(), GAME_CP_CharacterCvars(), HOS_UpdateMenu(), TR_CargoList(), TR_CheckEmployee(), and TR_TransferSelect().

int CL_GetRankIdx ( const char *  rankID  ) 

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

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

Definition at line 35 of file cp_rank.c.

References ccs, i, rank_s::id, ccs_s::numRanks, and ccs_s::ranks.

Referenced by E_CreateEmployeeAtIndex().

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

Variable Documentation

const value_t rankValues[] [static]
Initial value:
 {
    {"name", V_TRANSLATION_STRING, offsetof(rank_t, name), 0},
    {"shortname", V_TRANSLATION_STRING, offsetof(rank_t, shortname), 0},
    {"image", V_CLIENT_HUNK_STRING, offsetof(rank_t, image), 0},
    {"mind", V_INT, offsetof(rank_t, mind), MEMBER_SIZEOF(rank_t, mind)},
    {"killed_enemies", V_INT, offsetof(rank_t, killedEnemies), MEMBER_SIZEOF(rank_t, killedEnemies)},
    {"killed_others", V_INT, offsetof(rank_t, killedOthers), MEMBER_SIZEOF(rank_t, killedOthers)},
    {"factor", V_FLOAT, offsetof(rank_t, factor), MEMBER_SIZEOF(rank_t, factor)},
    {NULL, 0, 0, 0}
}

Definition at line 61 of file cp_rank.c.


Generated by  doxygen 1.6.2