forked from rickyrombo/TileBox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Conditions.cpp
40 lines (37 loc) · 1.05 KB
/
Conditions.cpp
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
#include "Common.h"
bool Extension::LeftTop(int type)
{
return currentX[type] == 0 && currentY[type] == 0;
}
bool Extension::LeftMiddle(int type)
{
return currentX[type] == 0 && currentY[type] > 0 && currentY[type] < boxHeight;
}
bool Extension::LeftBottom(int type)
{
return currentX[type] == 0 && currentY[type] == boxHeight;
}
bool Extension::MiddleTop(int type)
{
return currentX[type] > 0 && currentY[type] == 0 && currentX[type] < boxWidth;
}
bool Extension::MiddleMiddle(int type)
{
return currentX[type] > 0 && currentY[type] > 0 && currentY[type] < boxHeight && currentX[type] < boxWidth;
}
bool Extension::MiddleBottom(int type)
{
return currentX[type] > 0 && currentY[type] == boxHeight && currentX[type] < boxWidth;
}
bool Extension::RightTop(int type)
{
return currentY[type] == 0 && currentX[type] == boxWidth;
}
bool Extension::RightMiddle(int type)
{
return currentY[type] > 0 && currentY[type] < boxHeight && currentX[type] == boxWidth;
}
bool Extension::RightBottom(int type)
{
return currentY[type] == boxHeight && currentX[type] == boxWidth;
}