-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputComponent.h
More file actions
34 lines (24 loc) · 799 Bytes
/
InputComponent.h
File metadata and controls
34 lines (24 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef INPUT_COMPONENT_H
#define INPUT_COMPONENT_H
#include "Component.h"
#include "data structures/Vector.h"
#ifdef FAST_DELEGATES
#include "fast delegates/connection.hpp"
#else
#include "delegates/connection.hpp"
#endif // FAST_DELEGATES
class PositionComponent;
class InputComponent : public Component
{
public:
InputComponent(PositionComponent *positionComponent);
~InputComponent() { for (ConnectionBase *connection : mConnections) { connection->Disconnect(); delete connection; } }
void Init() override;
void Connect(ConnectionBase *connection) { mConnections.InsertLast(connection); }
virtual void OnKeyDown(int key);
void OnMouseMove(int x, int y);
protected:
PositionComponent *mPositionComponent;
Vector<ConnectionBase*> mConnections;
};
#endif // INPUT_COMPONENT_H