DDraceNetwork Docs
CComponent Class Referenceabstract

#include <component.h>

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

Public Member Functions

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)
 

Protected Member Functions

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

CGameClientm_pClient
 

Friends

class CGameClient
 

Detailed Description

This class is inherited by all the client components.

These components can implement the virtual methods such as OnInit(), OnMessage(int Msg, void *pRawMsg) to provide their functionality.

Constructor & Destructor Documentation

◆ ~CComponent()

virtual CComponent::~CComponent ( )
inlinevirtual

The component virtual destructor.

Member Function Documentation

◆ Client()

class IClient * CComponent::Client ( ) const

Get the client interface.

◆ Collision()

class CCollision * CComponent::Collision ( ) const
protected

Get the collision interface.

◆ Config()

class CConfig * CComponent::Config ( ) const
protected

Get the config interface.

◆ ConfigManager()

class IConfigManager * CComponent::ConfigManager ( ) const
protected

Get the config manager interface.

◆ Console()

class IConsole * CComponent::Console ( ) const
protected

Get the console interface.

◆ DemoPlayer()

class IDemoPlayer * CComponent::DemoPlayer ( ) const
protected

Get the demo player interface.

◆ DemoRecorder()

class IDemoRecorder * CComponent::DemoRecorder ( int  Recorder) const
protected

Get the demo recorder interface.

Parameters
RecorderA member of the RECORDER_x enum
See also
RECORDER_MANUAL
RECORDER_AUTO
RECORDER_RACE
RECORDER_REPLAYS

◆ Engine()

class IEngine * CComponent::Engine ( ) const
protected

◆ Favorites()

class IFavorites * CComponent::Favorites ( ) const
protected

◆ GameClient()

class CGameClient * CComponent::GameClient ( ) const
inline

Get a pointer to the game client.

◆ Graphics()

class IGraphics * CComponent::Graphics ( ) const
protected

Get the graphics interface.

◆ Http()

class IHttp * CComponent::Http ( ) const
protected

Get the http interface

◆ Input()

class IInput * CComponent::Input ( ) const
protected

Get the input interface.

◆ Kernel()

class IKernel * CComponent::Kernel ( ) const
protected

Get the kernel interface.

◆ Layers()

class CLayers * CComponent::Layers ( ) const
protected

Get the layers interface.

◆ LocalTime()

float CComponent::LocalTime ( ) const
protected

Gets the local time.

◆ OnConsoleInit()

virtual void CComponent::OnConsoleInit ( )
inlinevirtual

Called to let the components register their console commands.

Reimplemented in CBinds, CCamera, CChat, CGameConsole, CControls, CEmoticon, CGhost, CMenus, CScoreboard, CSpectator, CStatboard, and CVoting.

◆ OnCursorMove()

virtual bool CComponent::OnCursorMove ( float  x,
float  y,
IInput::ECursorType  CursorType 
)
inlinevirtual

Called on mouse movement, where the x and y values are deltas.

Parameters
xThe amount of change in the x coordinate since the last call.
yThe amount of change in the y coordinate since the last call.
CursorTypeThe type of cursor that caused the movement.

Reimplemented in CControls, CEmoticon, CMenus, and CSpectator.

◆ OnInit()

virtual void CComponent::OnInit ( )
inlinevirtual

Called to let the components run initialization code.

Reimplemented in CBackground, CChat, CGameConsole, CCountryFlags, CDamageInd, CHud, CInfoMessages, CItems, CMapImages, CMapLayers, CMenuBackground, CMenus, CNamePlates, CParticles, CPlayers, CSkins, CSkins7, and CSounds.

◆ OnInput()

virtual bool CComponent::OnInput ( const IInput::CEvent Event)
inlinevirtual

Called on a input event.

Parameters
EventThe input event.

Reimplemented in CBinds::CBindsSpecial, CBinds, CChat, CGameConsole, CEmoticon, CMenusKeyBinder, CMenus, CMotd, and CSpectator.

◆ OnMapLoad()

virtual void CComponent::OnMapLoad ( )
inlinevirtual

Called on map load.

Reimplemented in CBackground, CGhost, CMapImages, CMapLayers, CMapSounds, CMenuBackground, and CRaceDemo.

◆ OnMessage()

virtual void CComponent::OnMessage ( int  Msg,
void *  pRawMsg 
)
inlinevirtual

Called when receiving a network message.

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

Reimplemented in CBroadcast, CChat, CGameConsole, CControls, CGhost, CHud, CInfoMessages, CMotd, CRaceDemo, CScoreboard, CStatboard, and CVoting.

◆ OnNewSnapshot()

virtual void CComponent::OnNewSnapshot ( )
inlinevirtual

Called when a new snapshot is received.

Reimplemented in CGhost, CHud, and CRaceDemo.

◆ OnRefreshSkins()

virtual void CComponent::OnRefreshSkins ( )
inlinevirtual

Called when skins have been invalidated and must be updated.

Reimplemented in CChat, CGhost, CInfoMessages, and CMenus.

◆ OnRelease()

virtual void CComponent::OnRelease ( )
inlinevirtual

Called when the input gets released, for example when a text box loses focus.

Reimplemented in CChat, CEmoticon, CScoreboard, CSpectator, and CStatboard.

◆ OnRender()

◆ OnReset()

virtual void CComponent::OnReset ( )
inlinevirtual

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 in CBroadcast, CCamera, CGameConsole, CControls, CDamageInd, CEmoticon, CGhost, CHud, CInfoMessages, CMenus, CParticles, CRaceDemo, CScoreboard, CSounds, CSpectator, CStatboard, CTooltips, and CVoting.

◆ OnShutdown()

virtual void CComponent::OnShutdown ( )
inlinevirtual

Called to cleanup the component. This method is called when the client is closed.

Reimplemented in CGhost, CMenus, CRaceDemo, and CSkins.

◆ OnStateChange()

virtual void CComponent::OnStateChange ( int  NewState,
int  OldState 
)
inlinevirtual

This method is called when the client changes state, e.g from offline to online.

See also
IClient::STATE_CONNECTING
IClient::STATE_LOADING
IClient::STATE_ONLINE

Reimplemented in CChat, CGameConsole, CMapSounds, CMenus, CMotd, CRaceDemo, and CSounds.

◆ OnWindowResize()

virtual void CComponent::OnWindowResize ( )
inlinevirtual

Called when the window has been resized.

Reimplemented in CBroadcast, CChat, CHud, CInfoMessages, CMenus, CMotd, and CNamePlates.

◆ RenderTools()

class CRenderTools * CComponent::RenderTools ( ) const
protected

Get the render tools interface.

◆ ServerBrowser()

class IServerBrowser * CComponent::ServerBrowser ( ) const
protected

Get the server browser interface.

◆ Sizeof()

◆ Sound()

class ISound * CComponent::Sound ( ) const
protected

Get the sound interface.

◆ Storage()

class IStorage * CComponent::Storage ( ) const
protected

Get the storage interface.

◆ TextRender()

class ITextRender * CComponent::TextRender ( ) const
protected

Get the text rendering interface.

◆ time()

int64_t CComponent::time ( ) const
protected

Gets the current time.

See also
time_get()

◆ Ui()

class CUi * CComponent::Ui ( ) const
protected

Get the ui interface.

Friends And Related Function Documentation

◆ CGameClient

friend class CGameClient
friend

Member Data Documentation

◆ m_pClient

CGameClient* CComponent::m_pClient
protected

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