HoverRace  2.0
Public Member Functions | Private Types | Private Attributes | List of all members
HoverRace::Control::Action< T, Val > Class Template Reference

Actions are effectively signals that can be triggered by both the InputEventController and other things such as UI buttons. More...

#include <Action.h>

+ Inheritance diagram for HoverRace::Control::Action< T, Val >:

Public Member Functions

 Action ()
 
 Action (const std::string &name, int listOrder)
 
virtual ~Action ()
 
template<class U >
boost::signals2::connection Connect (U &&del)
 Connect a slot to the signal. More...
 
int GetPrimaryTrigger () const
 Retrieve the hash of the key or button assigned to this action by the InputEventController. More...
 
T & GetSignal ()
 
virtual void operator() (Val value)
 
void SetPrimaryTrigger (int hash)
 Set the hash of the key or button assigned to this action. More...
 
- Public Member Functions inherited from HoverRace::Control::ControlAction< Val >
 ControlAction ()
 
 ControlAction (const std::string &name, int listOrder)
 
virtual ~ControlAction ()
 
int GetListOrder () const noexcept
 
const std::string & GetName () const noexcept
 

Private Types

using SUPER = ControlAction< Val >
 

Private Attributes

int primaryTrigger
 
signal
 

Additional Inherited Members

- Protected Attributes inherited from HoverRace::Control::ControlAction< Val >
int listOrder
 
std::string name
 

Detailed Description

template<class T, class Val = int>
class HoverRace::Control::Action< T, Val >

Actions are effectively signals that can be triggered by both the InputEventController and other things such as UI buttons.

Actions also keep track of what key/button is assigned to it for UI components to display to the user.

Template Parameters
TThe signal type.
ValThe type of the value passed to the signal.
Author
Michael Imamura

Member Typedef Documentation

template<class T , class Val = int>
using HoverRace::Control::Action< T, Val >::SUPER = ControlAction<Val>
private

Constructor & Destructor Documentation

template<class T , class Val = int>
HoverRace::Control::Action< T, Val >::Action ( )
inline
template<class T , class Val = int>
HoverRace::Control::Action< T, Val >::Action ( const std::string &  name,
int  listOrder 
)
inline
template<class T , class Val = int>
virtual HoverRace::Control::Action< T, Val >::~Action ( )
inlinevirtual

Member Function Documentation

template<class T , class Val = int>
template<class U >
boost::signals2::connection HoverRace::Control::Action< T, Val >::Connect ( U &&  del)
inline

Connect a slot to the signal.

This is a convenience function. To access the signal directly, see GetSignal().

template<class T , class Val = int>
int HoverRace::Control::Action< T, Val >::GetPrimaryTrigger ( ) const
inline

Retrieve the hash of the key or button assigned to this action by the InputEventController.

Returns
The hash (see InputEventController::HashToString) or 0 if no key or button has been assigned.
template<class T , class Val = int>
T& HoverRace::Control::Action< T, Val >::GetSignal ( )
inline
template<class T , class Val = int>
virtual void HoverRace::Control::Action< T, Val >::operator() ( Val  value)
inlinevirtual
template<class T , class Val = int>
void HoverRace::Control::Action< T, Val >::SetPrimaryTrigger ( int  hash)
inline

Set the hash of the key or button assigned to this action.

This should only be called by the InputEventController that owns this Action (if any).

Parameters
hashThe input hash or 0 if none is assigned.

Member Data Documentation

template<class T , class Val = int>
int HoverRace::Control::Action< T, Val >::primaryTrigger
private
template<class T , class Val = int>
T HoverRace::Control::Action< T, Val >::signal
private

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