![]() |
DDNet documentation
|
#include <voting.h>
Public Member Functions | |
| CVoting () | |
| int | Sizeof () const override |
| void | OnReset () override |
| void | OnConsoleInit () override |
| 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 |
| int | NumOptions () const |
| const CVoteOptionClient * | FirstOption () const |
| Public Member Functions inherited from CComponent | |
| virtual void | OnStateChange (int NewState, int OldState) |
| virtual void | OnInit () |
| virtual void | OnShutdown () |
| virtual void | OnWindowResize () |
| virtual void | OnUpdate () |
| virtual void | OnRender () |
| virtual void | OnNewSnapshot () |
| virtual void | OnRelease () |
| virtual void | OnMapLoad () |
| virtual bool | OnCursorMove (float x, float y, IInput::ECursorType CursorType) |
| virtual bool | OnInput (const IInput::CEvent &Event) |
| virtual bool | OnTouchState (std::vector< IInput::CTouchFingerState > &vTouchFingerStates) |
| Public Member Functions inherited from CComponentInterfaces | |
| virtual void | OnInterfacesInit (CGameClient *pClient) |
| virtual | ~CComponentInterfaces ()=default |
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 |
| int | m_NumVoteOptions |
| CVoteOptionClient * | m_pFirst |
| CVoteOptionClient * | m_pLast |
| CVoteOptionClient * | m_pRecycleFirst |
| CVoteOptionClient * | m_pRecycleLast |
Additional Inherited Members | |
| Protected Member Functions inherited from CComponentInterfaces | |
| class CGameClient * | GameClient () const |
| class IClient * | Client () const |
| class IKernel * | Kernel () const |
| class IEngine * | Engine () const |
| class IGraphics * | Graphics () const |
| class ITextRender * | TextRender () const |
| class IInput * | Input () const |
| class IStorage * | Storage () const |
| class CUi * | Ui () const |
| class ISound * | Sound () const |
| class CRenderTools * | RenderTools () const |
| class CRenderMap * | RenderMap () const |
| class IConfigManager * | ConfigManager () const |
| class CConfig * | Config () const |
| class IConsole * | Console () const |
| class IDemoPlayer * | DemoPlayer () const |
| class IDemoRecorder * | DemoRecorder (int Recorder) const |
| class IFavorites * | Favorites () const |
| class IServerBrowser * | ServerBrowser () const |
| class CLayers * | Layers () const |
| class CCollision * | Collision () const |
| int64_t | time () const |
| float | LocalTime () const |
| class IHttp * | Http () const |
| CVoting::CVoting | ( | ) |
| void CVoting::AddOption | ( | const char * | pDescription | ) |
| void CVoting::AddvoteOption | ( | const char * | pDescription, |
| const char * | pCommand ) |
|
private |
| void CVoting::CallvoteKick | ( | int | ClientId, |
| const char * | pReason, | ||
| bool | ForceVote = false ) |
| void CVoting::CallvoteOption | ( | int | OptionId, |
| const char * | pReason, | ||
| bool | ForceVote = false ) |
| void CVoting::CallvoteSpectate | ( | int | ClientId, |
| const char * | pReason, | ||
| bool | ForceVote = false ) |
|
private |
|
staticprivate |
|
staticprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Called to let the components register their console commands.
Reimplemented from CComponent.
|
overridevirtual |
Called when receiving a network message.
| Msg | The message type. |
| pRawMsg | The message data. |
Reimplemented from CComponent.
|
overridevirtual |
Called to reset the component. This method is usually called on your component constructor to avoid code duplication.
Reimplemented from CComponent.
|
private |
| void CVoting::RemovevoteOption | ( | int | OptionId | ) |
| void CVoting::Render | ( | ) |
|
private |
| int CVoting::SecondsLeft | ( | ) | const |
|
inlineoverridevirtual |
Gets the size of the non-abstract component.
Implements CComponent.
|
inline |
| void CVoting::Vote | ( | int | v | ) |
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |