Go to the documentation of this file.
1 #pragma once
3 #include "systemMacro.h"
4 #include "AnnEvents.hpp"
6 namespace Annwvyn
7 {
8  class AnnPlayerBody;
12  {
13  //Base Event listener class. Technically not abstract since it provides a default implementation for all
14  //virtual members. But theses definitions are pointless because they actually don't do anything.
15  //You need to subclass it to create an EventListener
18  public:
19  AnnEventListener(const AnnEventListener&) = delete;
20  AnnEventListener& operator=(AnnEventListener&) = delete;
21  AnnEventListener(const AnnEventListener&& o) noexcept;
22  AnnEventListener& operator=(AnnEventListener&& o) noexcept;
24  virtual ~AnnEventListener() = default;
29  virtual void KeyEvent(AnnKeyEvent e) {}
31  virtual void MouseEvent(AnnMouseEvent e) {}
35  virtual void TimeEvent(AnnTimeEvent e) {}
37  virtual void TriggerEvent(AnnTriggerEvent e) {}
47  virtual void tick() {}
49  static float trim(float value, float deadzone);
51  std::shared_ptr<AnnEventListener> getSharedListener();
53  protected:
56  };
60 }
file for defining macros used for symbol export regarding the way the OS does things.
Collision between the player and another object.
Definition: AnnEvents.hpp:395
Class that can send a user space event to the event manager.
AnnPlayerBody * player
Pointer to the player. Set by the constructor, provide easy access to the AnnPlayerBody.
virtual void KeyEvent(AnnKeyEvent e)
Event from the keyboard.
Namespace containing the totality of Annwvyn components.
Definition: AnnGetter.cpp:8
virtual void TimeEvent(AnnTimeEvent e)
Event from a timer.
A joystick event.
Definition: AnnEvents.hpp:240
A timer timeout event.
Definition: AnnEvents.hpp:342
class that represent the player. This is the user&#39;s "Virtual body" in the world. It&#39;s the object that...
A hand controller event.
Definition: AnnEvents.hpp:300
virtual void EventFromUserSubsystem(AnnUserSpaceEvent &e, AnnUserSpaceEventLauncher *origin)
Events from code outside of Annwvyn itself.
A keyboard event.
Definition: AnnEvents.hpp:37
#define AnnDllExport
Definition: systemMacro.h:24
virtual void ControllerEvent(AnnControllerEvent e)
Event for a Joystick.
virtual void CollisionEvent(AnnCollisionEvent e)
Event from detected collisions.
Base class for all event listener.
A mouse event information object.
Definition: AnnEvents.hpp:124
Trigger in/out event.
Definition: AnnEvents.hpp:409
virtual void HandControllerEvent(AnnHandControllerEvent e)
Event from an HandController.
virtual void TriggerEvent(AnnTriggerEvent e)
Event from a trigger.
Collision event between 2 game objects.
Definition: AnnEvents.hpp:362
virtual void MouseEvent(AnnMouseEvent e)
Event from the mouse.
virtual void PlayerCollisionEvent(AnnPlayerCollisionEvent e)
Event from detected player collisions.
Base class of an event created by user space code.
virtual void tick()
This method is called at each frame. Useful for updating player&#39;s movement command for example...