OpenClonk
C4GameControlClient Class Reference

#include <C4GameControlNetwork.h>

Collaboration diagram for C4GameControlClient:
[legend]

Public Member Functions

 C4GameControlClient ()
 
int32_t getClientID () const
 
const char * getName () const
 
int32_t getNextControl () const
 
int32_t getPerfStat () const
 
void Set (int32_t iClientID, const char *szName)
 
void SetNextControl (int32_t inNextControl)
 
void AddPerf (int32_t iTime)
 

Protected Attributes

int32_t iClientID
 
char szName [C4MaxName+1]
 
int32_t iNextControl {0}
 
int32_t iPerformance {0}
 
C4GameControlClientpNext
 

Friends

class C4GameControlNetwork
 

Detailed Description

Definition at line 206 of file C4GameControlNetwork.h.

Constructor & Destructor Documentation

◆ C4GameControlClient()

C4GameControlClient::C4GameControlClient ( )

Definition at line 897 of file C4GameControlNetwork.cpp.

899 {
900  szName[0] = '\0';
901 }
const int32_t C4ClientIDUnknown
Definition: C4Client.h:24
char szName[C4MaxName+1]

References szName.

Member Function Documentation

◆ AddPerf()

void C4GameControlClient::AddPerf ( int32_t  iTime)

Definition at line 914 of file C4GameControlNetwork.cpp.

915 {
916  iPerformance += (iTime * 100 - iPerformance) / 100;
917 }

References iPerformance.

◆ getClientID()

int32_t C4GameControlClient::getClientID ( ) const
inline

Definition at line 227 of file C4GameControlNetwork.h.

227 { return iClientID; }

References iClientID.

Referenced by C4GameControlNetwork::AddClient(), and C4GameControlNetwork::PackCompleteCtrl().

Here is the caller graph for this function:

◆ getName()

const char* C4GameControlClient::getName ( ) const
inline

Definition at line 228 of file C4GameControlNetwork.h.

228 { return szName; }

References szName.

◆ getNextControl()

int32_t C4GameControlClient::getNextControl ( ) const
inline

Definition at line 229 of file C4GameControlNetwork.h.

229 { return iNextControl; }

References iNextControl.

Referenced by C4GameControlNetwork::ClientNextControl(), and C4GameControlNetwork::PackCompleteCtrl().

Here is the caller graph for this function:

◆ getPerfStat()

int32_t C4GameControlClient::getPerfStat ( ) const

Definition at line 903 of file C4GameControlNetwork.cpp.

904 {
905  return iPerformance / 100;
906 }

References iPerformance.

Referenced by C4GameControlNetwork::ClientPerfStat().

Here is the caller graph for this function:

◆ Set()

void C4GameControlClient::Set ( int32_t  iClientID,
const char *  szName 
)

Definition at line 908 of file C4GameControlNetwork.cpp.

909 {
910  iClientID = inClientID;
911  SCopy(sznName, szName, sizeof(szName)-1);
912 }
void SCopy(const char *szSource, char *sTarget, size_t iMaxL)
Definition: Standard.cpp:152

References iClientID, SCopy(), and szName.

Referenced by C4GameControlNetwork::AddClient().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetNextControl()

void C4GameControlClient::SetNextControl ( int32_t  inNextControl)
inline

Definition at line 233 of file C4GameControlNetwork.h.

233 { iNextControl = inNextControl; }

References iNextControl.

Referenced by C4GameControlNetwork::AddClient(), and C4GameControlNetwork::PackCompleteCtrl().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ C4GameControlNetwork

friend class C4GameControlNetwork
friend

Definition at line 208 of file C4GameControlNetwork.h.

Member Data Documentation

◆ iClientID

int32_t C4GameControlClient::iClientID
protected

Definition at line 214 of file C4GameControlNetwork.h.

Referenced by getClientID(), and Set().

◆ iNextControl

int32_t C4GameControlClient::iNextControl {0}
protected

Definition at line 218 of file C4GameControlNetwork.h.

Referenced by getNextControl(), and SetNextControl().

◆ iPerformance

int32_t C4GameControlClient::iPerformance {0}
protected

Definition at line 221 of file C4GameControlNetwork.h.

Referenced by AddPerf(), and getPerfStat().

◆ pNext

◆ szName

char C4GameControlClient::szName[C4MaxName+1]
protected

Definition at line 215 of file C4GameControlNetwork.h.

Referenced by C4GameControlClient(), getName(), and Set().


The documentation for this class was generated from the following files: