add Distance function

This commit is contained in:
Xi Xu committed 2023-10-27 19:47:10 +08:00
1 parent 20951a1484
commit 17310a50c7
2 files changed
+5

No files matched your search

+4
View File
@@ -116,6 +116,10 @@ void CStrategySystem::Goalie() {
//}
}
double CStrategySystem::Distance(CPoint point1, CPoint point2) {
return sqrt(1.0 * (point1.x - point2.x) * (point1.x - point2.x) + 1.0 * (point1.y - point2.y) * (point1.y - point2.y));
}
int CStrategySystem::Status() {
if (ball.position.x <= 309 && ball.position.x >= 279 && ball.position.y >= 394 && ball.position.y <= 424)
return 0; // 罚球