-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBrainNormal.cpp
More file actions
executable file
·106 lines (87 loc) · 2.54 KB
/
BrainNormal.cpp
File metadata and controls
executable file
·106 lines (87 loc) · 2.54 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#include "Brain.h"
#define B_NormalLog gLog<< "[normal] "
#define PeocessingLog gProcessingLog<<"[normal] "
void Brain::ThinkNormal()
{
static bool ifThinkPrepared = false;
// ËÀÇò״̬
if( ( mWorldModel->mPlayMode == PM_KICK_OFF_LEFT && mWorldModel->mTeamSide == SD_RIGHT )
|| ( mWorldModel->mPlayMode == PM_KICK_OFF_RIGHT && mWorldModel->mTeamSide == SD_LEFT )
|| mWorldModel->mPlayMode == PM_KICK_IN_LEFT
|| mWorldModel->mPlayMode == PM_KICK_IN_RIGHT
|| mWorldModel->mPlayMode == PM_CORNER_KICK_LEFT
|| mWorldModel->mPlayMode == PM_CORNER_KICK_RIGHT
|| mWorldModel->mPlayMode == PM_GOAL_KICK_LEFT
|| mWorldModel->mPlayMode == PM_GOAL_KICK_RIGHT
)
{
PeocessingLog<<"domMotion deadball"<<endl;
mMotion->DoMotion( MT_DeadBallStand );
return;
}
//if( (mWorldModel->mPlayMode == PM_KICK_OFF_LEFT && /*mWorldModel->mGameTime < 20.0f &&*/ mWorldModel->mTeamSide == SD_LEFT)
// || (mWorldModel->mPlayMode == PM_KICK_OFF_RIGHT && /*mWorldModel->mGameTime < 320.0f && mWorldModel->mGameTime > 300.0f &&*/ mWorldModel->mTeamSide == SD_RIGHT) )
//{
// ThinkInitialStrategy();
// return;
//}
BasicStrategy basicStrategy = mSituation->GetBasicStrategy();
//BasicStrategy basicStrategy = BSD_Intercept;
switch ( basicStrategy )
{
case BSA_Dribble:
case BSA_Pass:
case BSA_Shoot:
case BSA_RunPosition:
ThinkNormalAttack( basicStrategy );
break;
case BSD_Intercept:
case BSD_ClearBall:
case BSD_Block:
ThinkNormalDefense( basicStrategy );
break;
default:
ThinkNormalAttack( basicStrategy );
break;
}
}
void Brain::ThinkNormalAttack( BasicStrategy basicStrategy )
{
B_NormalLog << "ThinkNormalAttack " << basicStrategy << endl;
if( basicStrategy == BSA_Dribble )
{
mMotion->DoMotion( MT_Dribble );
}
else if( basicStrategy == BSA_RunPosition )
{
mMotion->DoMotion( MT_RunPosition );
}
else if( basicStrategy == BSA_Shoot )
{
mMotion->DoMotion( MT_Shoot );
}
}
void Brain::ThinkNormalDefense( BasicStrategy basicStrategy )
{
B_NormalLog << "ThinkNormalDefense " << basicStrategy << endl;
if( basicStrategy == BSD_Intercept )
{
mMotion->DoMotion( MT_Intercept );
}
else if( basicStrategy == BSD_ClearBall )
{
mMotion->DoMotion( MT_ClearBall );
}
else if(basicStrategy ==BSA_RunPosition)
{
mMotion->DoMotion( MT_RunPosition );
}
else
{
mMotion->DoMotion( MT_StandPosition );
}
}
void Brain::ThinkInitialStrategy()
{
mMotion->DoMotion( MT_InitStrategy );
}