ETrobocon2017 - 片山研究所モデルベース開発推進事業部
str
apps
explorer
TargetFigure.cpp
[詳解]
1
#include "
TargetFigure.h
"
2
3
4
TargetFigure::TargetFigure
()
5
{
6
7
}
8
9
TargetFigure::~TargetFigure
()
10
{
11
12
}
13
14
// �u���b�N�̏����ʒu�ݒ�
15
void
TargetFigure::set
(
int
* positions)
16
{
17
for
(
int
i=0; i<5; i++){
18
initPositions[i] = positions[i];
19
}
20
}
21
22
// �����ʒu��]�����A�ڕW�Ƃ���}�`��肷��
23
void
TargetFigure::evaluate
()
24
{
25
26
if
(
getNumberInLeftSquare
(initPositions) )
27
28
for
(
int
i=0; i<5; i++){
29
targets[i] = leftSquare[i];
30
}
31
32
}
33
34
int
TargetFigure::getNumberInLeftSquare
(
int
initPositions[])
35
{
36
int
num = 0;
37
38
39
40
return
0;
41
}
42
43
int
TargetFigure::getTargetNum
(
BlockColor
color)
44
{
45
int
targetNum = 0;
46
47
switch
(color)
48
{
49
case
BlockColor::Black
:
50
targetNum = targets[0];
51
break
;
52
53
case
BlockColor::Red
:
54
targetNum = targets[1];
55
break
;
56
57
case
BlockColor::Yellow
:
58
targetNum = targets[2];
59
break
;
60
61
case
BlockColor::Blue
:
62
targetNum = targets[3];
63
break
;
64
65
case
BlockColor::Green
:
66
targetNum = targets[4];
67
break
;
68
}
69
70
return
targetNum;
71
}
72
TargetFigure::getNumberInLeftSquare
int getNumberInLeftSquare(int[])
Definition:
TargetFigure.cpp:34
BlockColor::Blue
BlockColor::Red
TargetFigure::evaluate
void evaluate()
Definition:
TargetFigure.cpp:23
BlockColor
BlockColor
Definition:
BlockColor.h:5
TargetFigure::~TargetFigure
~TargetFigure()
Definition:
TargetFigure.cpp:9
TargetFigure::set
void set(int positions[5])
TargetFigure::TargetFigure
TargetFigure()
Definition:
TargetFigure.cpp:4
TargetFigure::getTargetNum
int getTargetNum(BlockColor color)
Definition:
TargetFigure.cpp:43
BlockColor::Black
BlockColor::Yellow
BlockColor::Green
TargetFigure.h
構築:
1.8.13