-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSteamController.h
More file actions
68 lines (45 loc) · 1.35 KB
/
SteamController.h
File metadata and controls
68 lines (45 loc) · 1.35 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// Created by denis on 12/19/18.
//
#ifndef CCWARIO_STEAMCONTROLLER_H
#define CCWARIO_STEAMCONTROLLER_H
#include "platform/CCPlatformMacros.h"
#include <string>
#include <vector>
#include <unordered_map>
#include "SteamControllerCommons.h"
NS_CC_BEGIN
class SteamControllerImpl;
class EventListenerSteamController;
class EventSteamController;
class EventDispatcher;
class SteamController {
public:
static const int TAG_UNSET = -1;
static const char* DEVICE_UNSET;
static void startDiscoverySteamController();
static void stopDiscoverySteamController();
static SteamController* getControllerByDeviceId(const std::string& deviceId);
static SteamController* getControllerByTag(int tag);
static const std::vector<SteamController*>& getAllController();
const std::string& getDeviceId() const;
int getTag() const;
void setTag(int tag);
static void exit();
private:
std::string deviceId;
int tag;
EventDispatcher* eventDispatcher;
EventSteamController *connectEvent;
EventSteamController *updateEvent;
SteamController();
virtual ~SteamController();
void init();
void onConnected();
void onDisconnected();
friend class SteamControllerImpl;
friend class EventListenerSteamController;
void onUpdated(SteamControllerValues &values);
};
NS_CC_END
#endif //CCWARIO_STEAMCONTROLLER_H