YCLIMP
Yandex Command Line Interface Music Player
Loading...
Searching...
No Matches
include
Primitives.hpp
1
#pragma once
2
3
#include <ncurses.h>
4
#undef OK
5
6
template
<
typename
T>
7
struct
Vector2
8
{
9
public
:
10
Vector2(T x, T y)
11
: x(x)
12
, y(y)
13
{
14
}
15
16
public
:
17
T x;
18
T y;
19
};
20
21
template
<
typename
T>
22
struct
Rect
23
{
24
public
:
25
Rect() =
default
;
26
Rect(T left, T top, T width, T height)
27
: left(left)
28
, top(top)
29
, width(width)
30
, height(height)
31
{
32
}
33
34
public
:
35
T left;
36
T top;
37
T width;
38
T height;
39
};
40
41
using
Vector2f =
Vector2<float>
;
42
using
Vector2i =
Vector2<int>
;
43
using
Rectf =
Rect<float>
;
44
using
Recti =
Rect<int>
;
45
46
struct
Time
47
{
48
Time(
int
sec);
49
Time(
int
min,
int
sec);
50
int
min;
51
int
sec;
52
};
53
54
enum class
EEventKey
55
{
56
Unknown = -1,
57
A =
'a'
,
58
B,
59
C,
60
D,
61
E,
62
F,
63
G,
64
H,
65
I,
66
J,
67
K,
68
L,
69
M,
70
N,
71
O,
72
P,
73
Q,
74
R,
75
S,
76
T,
77
U,
78
V,
79
W,
80
X,
81
Y,
82
Z,
83
EnumEnd,
84
KeyResize = KEY_RESIZE
85
};
86
87
struct
Event
88
{
89
public
:
90
Event(
int
eventKey);
91
92
public
:
93
EEventKey key;
94
95
int
GetRawKey()
const
;
96
97
private
:
98
int
rawKey;
99
};
100
101
bool
isEventKeyValid(EEventKey eventKey);
102
bool
isEventKeyValid(
int
eventKey);
103
bool
isEventValid(
const
Event
& event);
Event
Definition
Primitives.hpp:88
Rect
Definition
Primitives.hpp:23
Vector2
Definition
Primitives.hpp:8
Generated by
1.14.0