-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparticle.cpp
More file actions
144 lines (120 loc) · 1.9 KB
/
particle.cpp
File metadata and controls
144 lines (120 loc) · 1.9 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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#pragma once
#include <SFML\Graphics.hpp>
struct Position
{
long x;
long y;
};
typedef struct Position position;
class Particle
{
private:
position m_position;
sf::Color m_colour;
float m_radius;
long m_colour_tag;
// Denotes the movement: 1 is positive and -1 is negative path on that particular axis
position m_path;
public:
Particle()
{
m_colour = sf::Color();
m_radius = 2.0f;
m_colour_tag = -1;
m_path.x = 0;
m_path.y = 0;
m_position.x = 0;
m_position.y = 0;
}
Particle(long i_x, long i_y, sf::Color i_colour, float i_radius, long i_colour_tag)
{
m_position.x = i_x;
m_position.y = i_y;
m_colour = i_colour;
m_radius = i_radius;
m_path.x = 0;
m_path.y = 0;
m_colour_tag = i_colour_tag;
}
Particle(long i_x, long i_y, sf::Color i_colour)
{
m_position.x = i_x;
m_position.y = i_y;
m_colour = i_colour;
m_radius = 2.0f;
m_path.x = 0;
m_path.y = 0;
m_colour_tag = -1;
}
Particle(position i_pos, sf::Color i_colour)
{
m_position = i_pos;
m_colour = i_colour;
m_radius = 2.0f;
m_path.x = 0;
m_path.y = 0;
m_colour_tag = -1;
}
long GetColourTag()
{
return m_colour_tag;
}
void SetColourTag(long i_colour)
{
m_colour_tag = i_colour;
}
position& GetPath()
{
return m_path;
}
void SetPath(position i_path)
{
m_path = i_path;
}
position& GetPosition()
{
return m_position;
}
void UpdatePath(long i_x, long i_y)
{
m_path.x = i_x;
m_path.y = i_y;
}
void UpdatePosition(long x, long y)
{
m_position.x = x;
m_position.y = y;
}
long GetX() const
{
return m_position.x;
}
long GetY() const
{
return m_position.y;
}
long GetX()
{
return m_position.x;
}
long GetY()
{
return m_position.y;
}
sf::Color GetColour() const
{
return m_colour;
}
sf::Color GetColour()
{
return m_colour;
}
float GetRadius()
{
return m_radius;
}
void SetRadius(float i_radius)
{
m_radius = i_radius;
}
};