-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInteractable.h
80 lines (73 loc) · 2.48 KB
/
Interactable.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
//Interactable.h
#ifndef NEOOBJECTS_INTERACTABLE_H
#define NEOOBJECTS_INTERACTABLE_H
#include <sdlUtility/Vector2.h>
#include <string>
#include <vector>
using namespace sdlUtility;
namespace Axis {
static const int None = 0;
static const int X = 1;
static const int Y = 2;
static const int XY = 3;
}
namespace sdlObjects {
namespace Shapes {
static const int Rectangle = 1;
static const int Disk = 2;
static const int Triangle = 3;
}
class Interactable {
//Members
public:
int Shape;
protected:
bool Collision, Interactive, Movable, Resizable;
float Sector;
Vector2 AcquiredPosition, AcquiredSize, CollisionSize, InputSize, Position, Size, TargetPosition, TargetSize;
std::vector<int> CollisionMap;
//Access Methods
public:
Interactable();
~Interactable();
float CollisionHeight();
float CollisionWidth();
float dHeight();
float dWidth();
float dX();
float dY();
float Section();
float Height(int State = 1);
bool IsCollidable(int Tile = 0);
bool IsDriven();
bool IsInteractive();
bool IsMovable();
bool IsResizable();
float InputHeight();
float InputWidth();
float Radius();
float Width(int State = 1);
float X(int State = 1);
float Y(int State = 1);
//Process Methods
public:
void AcquireSize(float Width, float Height);
void DropAt(float X, float Y);
void EnableCollision(bool State, std::string CollisionMap = "");
void EnableInteraction(bool State);
void EnableMoving(bool State);
void EnableResizing(bool State);
void MoveBy(float X, float Y);
void MoveTo(float X, float Y);
void NudgeBy(float X, float Y);
void Relax(int Axis = Axis::XY);
void RelaxSize();
void ResizeCollisionTo(float Width, float Height);
void ResizeInputTo(float Width, float Height);
void ResizeTo(float Width, float Height);
void Section(float Sector);
void StretchBy(float Width, float Height);
void StretchTo(float Width, float Height);
};
}
#endif