-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDevice.hpp
125 lines (104 loc) · 2.42 KB
/
Device.hpp
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
//
// Device.hpp
// Maw Kit
//
// Created by Lluís Ulzurrun de Asanza Sàez on 18/02/16.
//
//
#ifndef Device_hpp
#define Device_hpp
#include <string>
#include "cocos2d.h"
namespace MK {
/**
* `Device` namespace features method to get information about this device's
* hardware.
*/
namespace Device {
/// `Platform::Supported` enum represents possible platforms where a MawKit
/// game runs.
enum class Platform { Android = 0, iOS = 1, OSX = 2 };
/**
* Returns current platform.
*
* @return Platform currently running this game.
*/
const Platform currentPlatform();
/**
* Returns whether this device is running Android or not.
*
* @return `true` is this device is running Android.
*/
const bool isAndroid();
/**
* Returns whether this device is running iOS or not.
*
* @return `true` is this device is running iOS.
*/
const bool isiOS();
/**
* Returns whether this device is running OS X or not.
*
* @return `true` is this device is running OS X.
*/
const bool isOSX();
/**
* Returns whether this device has powerful hardware or not.
*
* @return `true` if this device's hardware can run Hop Raider at 60 fps.
*/
const bool hasPowerfulHardware();
/**
* Returns UUID of this device.
*
* @note Current implementation of this method returns a fixed string.
*
* @native
*
* @return UUID of this device.
*/
const std::string UUID();
/**
* Retuns this device's screen size, in points.
*
* @native
*
* @return Size of this device's screen in points.
*/
const cocos2d::Size screenSize();
/**
* Retuns this device's screen size, in pixel.
*
* @native
*
* @return Size of this device's screen in pixels.
*/
const cocos2d::Size pxScreenSize();
/**
* Returns whether internet is currently available or not.
*
* @return `true` if internet is currently reachable.
*/
const bool isInternetAvailable();
/**
* Returns whether internet is currently reachable via Wifi or not.
*
* @return `true` if this device is connected to the internet through Wifi.
*/
const bool isUsingWifi();
/**
* Returns whether internet is currently reachable via cellular data or not.
*
* @return `true` if this device is connected to the internet through cellular
* data.
*/
const bool isUsingCellularData();
/**
* Returns this device's language code.
*
* @return This device's language code.
*/
const std::string language();
}; // namespace Device
}; // namespace MK
#endif /* Device_hpp */