DDraceNetwork Documentation
Loading...
Searching...
No Matches
CComponent Class Referenceabstract

#include <component.h>

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

Public Member Functions

virtual ~CComponent ()=default
 
virtual int Sizeof () const =0
 
virtual void OnStateChange (int NewState, int OldState)
 
virtual void OnConsoleInit ()
 
virtual void OnInit ()
 
virtual void OnShutdown ()
 
virtual void OnReset ()
 
virtual void OnWindowResize ()
 
virtual void OnUpdate ()
 
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)
 
virtual bool OnTouchState (const std::vector< IInput::CTouchFingerState > &vTouchFingerStates)
 
- Public Member Functions inherited from CComponentInterfaces
virtual void OnInterfacesInit (CGameClient *pClient)
 
virtual ~CComponentInterfaces ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from CComponentInterfaces
class CGameClientGameClient () const
 
class IClientClient () const
 
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 CRenderMapRenderMap () 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
 

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 ( )
virtualdefault

The component virtual destructor.

Member Function Documentation

◆ OnConsoleInit()

virtual void CComponent::OnConsoleInit ( )
inlinevirtual

Called to let the components register their console commands.

Reimplemented in CBinds, CCamera, CChat, CGameConsole, CControls, CEmoticon, CGhost, CScoreboard, CSkins, 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

◆ 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.

◆ 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, CTouchControls, 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.

◆ OnTouchState()

virtual bool CComponent::OnTouchState ( const std::vector< IInput::CTouchFingerState > &  vTouchFingerStates)
inlinevirtual

Called with all current touch finger states.

Parameters
vTouchFingerStatesThe touch finger states to be handled.
Returns
true if the component used the touch events, false otherwise.

Reimplemented in CTouchControls.

◆ OnUpdate()

virtual void CComponent::OnUpdate ( )
inlinevirtual

Called when the component should get updated.

The update order depends on the component insertion order.

Reimplemented in CSkins.

◆ OnWindowResize()

virtual void CComponent::OnWindowResize ( )
inlinevirtual

Called when the window has been resized.

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

◆ Sizeof()


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