Annwvyn::AnnEventListener Class Reference

Base class for all event listener. More...

#include <AnnEventListener.hpp>

Inheritance diagram for Annwvyn::AnnEventListener:
Collaboration diagram for Annwvyn::AnnEventListener:

Public Member Functions

 AnnEventListener (const AnnEventListener &)=delete
 
AnnEventListeneroperator= (AnnEventListener &)=delete
 
 AnnEventListener (const AnnEventListener &&o) noexcept
 
AnnEventListeneroperator= (AnnEventListener &&o) noexcept
 
virtual ~AnnEventListener ()=default
 
 AnnEventListener ()
 Construct a listener. More...
 
virtual void KeyEvent (AnnKeyEvent e)
 Event from the keyboard. More...
 
virtual void MouseEvent (AnnMouseEvent e)
 Event from the mouse. More...
 
virtual void ControllerEvent (AnnControllerEvent e)
 Event for a Joystick. More...
 
virtual void TimeEvent (AnnTimeEvent e)
 Event from a timer. More...
 
virtual void TriggerEvent (AnnTriggerEvent e)
 Event from a trigger. More...
 
virtual void HandControllerEvent (AnnHandControllerEvent e)
 Event from an HandController. More...
 
virtual void CollisionEvent (AnnCollisionEvent e)
 Event from detected collisions. More...
 
virtual void PlayerCollisionEvent (AnnPlayerCollisionEvent e)
 Event from detected player collisions. More...
 
virtual void EventFromUserSubsystem (AnnUserSpaceEvent &e, AnnUserSpaceEventLauncher *origin)
 Events from code outside of Annwvyn itself. More...
 
virtual void tick ()
 This method is called at each frame. Useful for updating player's movement command for example. More...
 
std::shared_ptr< AnnEventListenergetSharedListener ()
 return a shared_ptr to this listener More...
 
- Public Member Functions inherited from std::enable_shared_from_this< AnnEventListener >
enable_shared_from_this (T... args)
 
operator= (T... args)
 
shared_from_this (T... args)
 
~enable_shared_from_this (T... args)
 

Static Public Member Functions

static float trim (float value, float deadzone)
 Utility function for applying a dead-zone on a joystick axis. More...
 

Protected Attributes

AnnPlayerBodyplayer
 Pointer to the player. Set by the constructor, provide easy access to the AnnPlayerBody. More...
 

Detailed Description

Base class for all event listener.

Definition at line 11 of file AnnEventListener.hpp.

Constructor & Destructor Documentation

◆ AnnEventListener() [1/3]

Annwvyn::AnnEventListener::AnnEventListener ( const AnnEventListener )
delete

◆ AnnEventListener() [2/3]

AnnEventListener::AnnEventListener ( const AnnEventListener &&  o)
noexcept

Definition at line 9 of file AnnEventListener.cpp.

◆ ~AnnEventListener()

virtual Annwvyn::AnnEventListener::~AnnEventListener ( )
virtualdefault

◆ AnnEventListener() [3/3]

AnnEventListener::AnnEventListener ( )

Construct a listener.

Definition at line 20 of file AnnEventListener.cpp.

Member Function Documentation

◆ CollisionEvent()

virtual void Annwvyn::AnnEventListener::CollisionEvent ( AnnCollisionEvent  e)
inlinevirtual

Event from detected collisions.

Definition at line 40 of file AnnEventListener.hpp.

◆ ControllerEvent()

virtual void Annwvyn::AnnEventListener::ControllerEvent ( AnnControllerEvent  e)
inlinevirtual

Event for a Joystick.

Reimplemented in Annwvyn::AnnDefaultEventListener.

Definition at line 32 of file AnnEventListener.hpp.

◆ EventFromUserSubsystem()

virtual void Annwvyn::AnnEventListener::EventFromUserSubsystem ( AnnUserSpaceEvent e,
AnnUserSpaceEventLauncher origin 
)
inlinevirtual

Events from code outside of Annwvyn itself.

Definition at line 44 of file AnnEventListener.hpp.

◆ getSharedListener()

std::shared_ptr< AnnEventListener > AnnEventListener::getSharedListener ( )

return a shared_ptr to this listener

Definition at line 32 of file AnnEventListener.cpp.

Here is the call graph for this function:

◆ HandControllerEvent()

virtual void Annwvyn::AnnEventListener::HandControllerEvent ( AnnHandControllerEvent  e)
inlinevirtual

Event from an HandController.

Reimplemented in Annwvyn::AnnDefaultEventListener.

Definition at line 38 of file AnnEventListener.hpp.

◆ KeyEvent()

virtual void Annwvyn::AnnEventListener::KeyEvent ( AnnKeyEvent  e)
inlinevirtual

Event from the keyboard.

Reimplemented in Annwvyn::AnnDefaultEventListener.

Definition at line 28 of file AnnEventListener.hpp.

◆ MouseEvent()

virtual void Annwvyn::AnnEventListener::MouseEvent ( AnnMouseEvent  e)
inlinevirtual

Event from the mouse.

Reimplemented in Annwvyn::AnnDefaultEventListener.

Definition at line 30 of file AnnEventListener.hpp.

◆ operator=() [1/2]

AnnEventListener& Annwvyn::AnnEventListener::operator= ( AnnEventListener )
delete

◆ operator=() [2/2]

AnnEventListener & AnnEventListener::operator= ( AnnEventListener &&  o)
noexcept

Definition at line 14 of file AnnEventListener.cpp.

◆ PlayerCollisionEvent()

virtual void Annwvyn::AnnEventListener::PlayerCollisionEvent ( AnnPlayerCollisionEvent  e)
inlinevirtual

Event from detected player collisions.

Definition at line 42 of file AnnEventListener.hpp.

◆ tick()

virtual void Annwvyn::AnnEventListener::tick ( )
inlinevirtual

This method is called at each frame. Useful for updating player's movement command for example.

Definition at line 46 of file AnnEventListener.hpp.

◆ TimeEvent()

virtual void Annwvyn::AnnEventListener::TimeEvent ( AnnTimeEvent  e)
inlinevirtual

Event from a timer.

Definition at line 34 of file AnnEventListener.hpp.

◆ TriggerEvent()

virtual void Annwvyn::AnnEventListener::TriggerEvent ( AnnTriggerEvent  e)
inlinevirtual

Event from a trigger.

Definition at line 36 of file AnnEventListener.hpp.

◆ trim()

float AnnEventListener::trim ( float  value,
float  deadzone 
)
static

Utility function for applying a dead-zone on a joystick axis.

Definition at line 25 of file AnnEventListener.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ player

AnnPlayerBody* Annwvyn::AnnEventListener::player
protected

Pointer to the player. Set by the constructor, provide easy access to the AnnPlayerBody.

Definition at line 54 of file AnnEventListener.hpp.


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