-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDLLStrategy.cpp
78 lines (70 loc) · 1.44 KB
/
DLLStrategy.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// DLLStrategy.cpp : 定义 DLL 应用程序的导出函数。
//
#include <cstring>
#include "platform.h"
using namespace Simuro;
extern "C" {
#ifndef __GNUG__
_declspec(dllexport)
#endif
void OnEvent(EventType type, void* argument) {
switch (type) {
case EventType::FirstHalfStart: {
break;
}
case EventType::SecondHalfStart: {
break;
}
case EventType::OvertimeStart: {
break;
}
case EventType::PenaltyShootoutStart: {
break;
}
case EventType::JudgeResult: {
JudgeResultEvent* judgeResult = static_cast<JudgeResultEvent*>(argument);
switch (judgeResult->type) {
case JudgeType::PlaceKick:
break;
case JudgeType::PenaltyKick:
break;
case JudgeType::GoalKick:
break;
case JudgeType::FreeKickLeftBot:
case JudgeType::FreeKickLeftTop:
case JudgeType::FreeKickRightBot:
case JudgeType::FreeKickRightTop:
break;
}
break;
}
default:
break;
}
}
#ifndef __GNUG__
_declspec(dllexport)
#endif
void GetTeamInfo(TeamInfo* teamInfo) {
static const wchar_t teamName[] = L"公诚勇毅,永矢毋忘";
static constexpr size_t len = sizeof(teamName);
memcpy(teamInfo->teamName, teamName, len);
}
#ifndef __GNUG__
_declspec(dllexport)
#endif
void GetInstruction(Field* field) {
for (auto& r : field->selfRobots) {
r.wheel = { 125,-125 };
}
}
#ifndef __GNUG__
_declspec(dllexport)
#endif
void GetPlacement(Field* field) {
for (auto& r : field->selfRobots) {
r.position = { 42,42 };
r.rotation = 180;
}
}
}