DDraceNetwork Docs
CVoting Class Reference

#include <voting.h>

Inheritance diagram for CVoting:
[legend]
Collaboration diagram for CVoting:
[legend]

Public Member Functions

 CVoting ()
 
virtual int Sizeof () const override
 
virtual void OnReset () override
 
virtual void OnConsoleInit () override
 
virtual void OnMessage (int Msgtype, void *pRawMsg) override
 
void Render ()
 
void CallvoteSpectate (int ClientId, const char *pReason, bool ForceVote=false)
 
void CallvoteKick (int ClientId, const char *pReason, bool ForceVote=false)
 
void CallvoteOption (int OptionId, const char *pReason, bool ForceVote=false)
 
void RemovevoteOption (int OptionId)
 
void AddvoteOption (const char *pDescription, const char *pCommand)
 
void AddOption (const char *pDescription)
 
void Vote (int v)
 
int SecondsLeft () const
 
bool IsVoting () const
 
int TakenChoice () const
 
const char * VoteDescription () const
 
const char * VoteReason () const
 
bool IsReceivingOptions () const
 
- Public Member Functions inherited from CComponent
virtual ~CComponent ()
 
virtual int Sizeof () const =0
 
class CGameClientGameClient () const
 
class IClientClient () const
 
virtual void OnStateChange (int NewState, int OldState)
 
virtual void OnConsoleInit ()
 
virtual void OnInit ()
 
virtual void OnShutdown ()
 
virtual void OnReset ()
 
virtual void OnWindowResize ()
 
virtual void OnRefreshSkins ()
 
virtual void OnRender ()
 
virtual void OnNewSnapshot ()
 
virtual void OnRelease ()
 
virtual void OnMapLoad ()
 
virtual void OnMessage (int Msg, void *pRawMsg)
 
virtual bool OnCursorMove (float x, float y, IInput::ECursorType CursorType)
 
virtual bool OnInput (const IInput::CEvent &Event)
 

Public Attributes

int m_NumVoteOptions
 
CVoteOptionClientm_pFirst
 
CVoteOptionClientm_pLast
 
CVoteOptionClientm_pRecycleFirst
 
CVoteOptionClientm_pRecycleLast
 

Private Member Functions

void RemoveOption (const char *pDescription)
 
void ClearOptions ()
 
void Callvote (const char *pType, const char *pValue, const char *pReason)
 
void RenderBars (CUIRect Bars) const
 

Static Private Member Functions

static void ConCallvote (IConsole::IResult *pResult, void *pUserData)
 
static void ConVote (IConsole::IResult *pResult, void *pUserData)
 

Private Attributes

CHeap m_Heap
 
int64_t m_Opentime
 
int64_t m_Closetime
 
char m_aDescription [VOTE_DESC_LENGTH]
 
char m_aReason [VOTE_REASON_LENGTH]
 
int m_Voted
 
int m_Yes
 
int m_No
 
int m_Pass
 
int m_Total
 
bool m_ReceivingOptions
 

Additional Inherited Members

- Protected Member Functions inherited from CComponent
class IKernelKernel () const
 
class IEngineEngine () const
 
class IGraphicsGraphics () const
 
class ITextRenderTextRender () const
 
class IInputInput () const
 
class IStorageStorage () const
 
class CUiUi () const
 
class ISoundSound () const
 
class CRenderToolsRenderTools () const
 
class IConfigManagerConfigManager () const
 
class CConfigConfig () const
 
class IConsoleConsole () const
 
class IDemoPlayerDemoPlayer () const
 
class IDemoRecorderDemoRecorder (int Recorder) const
 
class IFavoritesFavorites () const
 
class IServerBrowserServerBrowser () const
 
class CLayersLayers () const
 
class CCollisionCollision () const
 
int64_t time () const
 
float LocalTime () const
 
class IHttpHttp () const
 
- Protected Attributes inherited from CComponent
CGameClientm_pClient
 

Constructor & Destructor Documentation

◆ CVoting()

CVoting::CVoting ( )

Member Function Documentation

◆ AddOption()

void CVoting::AddOption ( const char *  pDescription)

◆ AddvoteOption()

void CVoting::AddvoteOption ( const char *  pDescription,
const char *  pCommand 
)

◆ Callvote()

void CVoting::Callvote ( const char *  pType,
const char *  pValue,
const char *  pReason 
)
private

◆ CallvoteKick()

void CVoting::CallvoteKick ( int  ClientId,
const char *  pReason,
bool  ForceVote = false 
)

◆ CallvoteOption()

void CVoting::CallvoteOption ( int  OptionId,
const char *  pReason,
bool  ForceVote = false 
)

◆ CallvoteSpectate()

void CVoting::CallvoteSpectate ( int  ClientId,
const char *  pReason,
bool  ForceVote = false 
)

◆ ClearOptions()

void CVoting::ClearOptions ( )
private

◆ ConCallvote()

void CVoting::ConCallvote ( IConsole::IResult pResult,
void *  pUserData 
)
staticprivate

◆ ConVote()

void CVoting::ConVote ( IConsole::IResult pResult,
void *  pUserData 
)
staticprivate

◆ IsReceivingOptions()

bool CVoting::IsReceivingOptions ( ) const
inline

◆ IsVoting()

bool CVoting::IsVoting ( ) const
inline

◆ OnConsoleInit()

void CVoting::OnConsoleInit ( )
overridevirtual

Called to let the components register their console commands.

Reimplemented from CComponent.

◆ OnMessage()

void CVoting::OnMessage ( int  Msg,
void *  pRawMsg 
)
overridevirtual

Called when receiving a network message.

Parameters
MsgThe message type.
pRawMsgThe message data.
See also
NETMSGTYPE_SV_DDRACETIME
CNetMsg_Sv_DDRaceTime

Reimplemented from CComponent.

◆ OnReset()

void CVoting::OnReset ( )
overridevirtual

Called to reset the component. This method is usually called on your component constructor to avoid code duplication.

See also
CHud::CHud()
CHud::OnReset()

Reimplemented from CComponent.

◆ RemoveOption()

void CVoting::RemoveOption ( const char *  pDescription)
private

◆ RemovevoteOption()

void CVoting::RemovevoteOption ( int  OptionId)

◆ Render()

void CVoting::Render ( )

◆ RenderBars()

void CVoting::RenderBars ( CUIRect  Bars) const
private

◆ SecondsLeft()

int CVoting::SecondsLeft ( ) const

◆ Sizeof()

virtual int CVoting::Sizeof ( ) const
inlineoverridevirtual

Gets the size of the non-abstract component.

Implements CComponent.

◆ TakenChoice()

int CVoting::TakenChoice ( ) const
inline

◆ Vote()

void CVoting::Vote ( int  v)

◆ VoteDescription()

const char * CVoting::VoteDescription ( ) const
inline

◆ VoteReason()

const char * CVoting::VoteReason ( ) const
inline

Member Data Documentation

◆ m_aDescription

char CVoting::m_aDescription[VOTE_DESC_LENGTH]
private

◆ m_aReason

char CVoting::m_aReason[VOTE_REASON_LENGTH]
private

◆ m_Closetime

int64_t CVoting::m_Closetime
private

◆ m_Heap

CHeap CVoting::m_Heap
private

◆ m_No

int CVoting::m_No
private

◆ m_NumVoteOptions

int CVoting::m_NumVoteOptions

◆ m_Opentime

int64_t CVoting::m_Opentime
private

◆ m_Pass

int CVoting::m_Pass
private

◆ m_pFirst

CVoteOptionClient* CVoting::m_pFirst

◆ m_pLast

CVoteOptionClient* CVoting::m_pLast

◆ m_pRecycleFirst

CVoteOptionClient* CVoting::m_pRecycleFirst

◆ m_pRecycleLast

CVoteOptionClient* CVoting::m_pRecycleLast

◆ m_ReceivingOptions

bool CVoting::m_ReceivingOptions
private

◆ m_Total

int CVoting::m_Total
private

◆ m_Voted

int CVoting::m_Voted
private

◆ m_Yes

int CVoting::m_Yes
private

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