/
canetemplate.cpp
61 lines (53 loc) · 897 Bytes
/
canetemplate.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "canetemplate.h"
// Cane template types
namespace CaneTemplate
{
const char* names[] =
{
"Undefined",
"Base Circle",
"Base Square",
"Horizontal Line Circle",
"Horizontal Line Square",
"Tripod",
"Cross",
"Square of Circles",
"Square of Squares",
"Surrounding Circle",
"Surrounding Square",
"Custom",
};
enum Type firstSeedTemplate()
{
return BASE_CIRCLE;
}
enum Type lastSeedTemplate()
{
return SURROUNDING_SQUARE;
}
// returns true only if it's for sure
bool templateHasNoSubcanes(CaneTemplate::Type t)
{
switch (t)
{
case BASE_CIRCLE:
case BASE_SQUARE:
return true;
default:
return false;
}
}
// returns true only if it's for sure
bool templateHasSubcanes(CaneTemplate::Type t)
{
switch (t)
{
case BASE_CIRCLE:
case BASE_SQUARE:
case CUSTOM:
return false;
default:
return true;
}
}
}