-
Notifications
You must be signed in to change notification settings - Fork 0
/
Stars.h
119 lines (103 loc) · 1.51 KB
/
Stars.h
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
#ifndef STARS_H
#define STARS_H
#include <vector>
#include "Surface.h"
#include "Constants.h"
class Stars
{
public:
Stars(int x = 0, int y = 0, int w = 1, int h = 1, int type = 1, int speed = 1,
int r = 0, int g = 0, int b = 0)
:x_(x), y_(y), w_(w), h_(h), type_(type), speed_(speed), r_(r), g_(g), b_(b)
{}
int x() const
{
return x_;
}
int y() const
{
return y_;
}
int w() const
{
return w_;
}
int h() const
{
return h_;
}
int r() const
{
return r_;
}
int g() const
{
return g_;
}
int b() const
{
return b_;
}
int type() const
{
return type_;
}
int speed() const
{
return speed_;
}
void x(int x)
{
x_ = x;
}
void y(int y)
{
y_ = y;
}
void h(int h)
{
h_ = h;
}
void w(int w)
{
w_ = w;
}
void r(int r)
{
r_ = r;
}
void g(int g)
{
g_ = g;
}
void b(int b)
{
b_ = b;
}
void type(int type)
{
type_ = type;
}
void speed(int speed)
{
speed_ = speed;
}
void move();
private:
int x_, y_, w_, h_;
int r_, b_, g_;
int type_;
int speed_;
};
class Galaxy
{
public:
Galaxy(Surface & surface) : surface_(surface)
{}
void draw();
void build();
private:
Surface & surface_;
std::vector < Stars > stars;
};
#endif