-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVector2.h
More file actions
50 lines (42 loc) · 817 Bytes
/
Vector2.h
File metadata and controls
50 lines (42 loc) · 817 Bytes
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
#ifndef _VECTOR2_H_
#define _VECTOR2_H_
#include "Trackable.h"
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
struct Vector2
{
public:
Vector2();
Vector2(float x_, float y_);
~Vector2();
float x,
y;
int getDistanceTo(Vector2 vector2);
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive &ar, const unsigned version)
{
ar & x;
ar & y;
}
};
struct Rect : public Trackable
{
public:
Rect();
Rect(Vector2 pos, Vector2 size);
~Rect();
Vector2 mPosition;
Vector2 mSize; // Width and Height
bool checkCollision(Rect otherRect);
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive &ar, const unsigned version)
{
ar & mPosition;
ar & mSize;
}
};
#endif