forked from gecube/opencaesar3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oc3_positioni.h
32 lines (24 loc) · 853 Bytes
/
oc3_positioni.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
#ifndef __OPENCAESAR3_POSITION_H_INCLUDED__
#define __OPENCAESAR3_POSITION_H_INCLUDED__
#include "oc3_vector2.h"
class Point : public Vector2<int>
{
public:
Point( const int x, const int y ) : Vector2<int>( x, y ) {}
Point() : Vector2<int>( 0, 0 ) {}
Point operator+(const Point& other) const { return Point( x + other.x, y + other.y ); }
};
class PointF : public Vector2<float>
{
};
class TilePos : public Vector2<int>
{
public:
TilePos( const int i, const int j ) : Vector2<int>( i, j ) {}
TilePos() : Vector2<int>( 0, 0 ) {}
int getI() const { return x; }
int getJ() const { return y; }
TilePos& operator=(const TilePos& other) { set( other.x, other.y ); return *this; }
TilePos operator+(const TilePos& other) const { return TilePos( x + other.x, y + other.y ); }
};
#endif // __NRP_POSITION_H_INCLUDED__