fix(CAPI): 🐛 fix windows get message define
tags/0.1.0
| @@ -4,6 +4,10 @@ | |||||
| #include "API.h" | #include "API.h" | ||||
| #undef GetMessage | |||||
| #undef SendMessage | |||||
| #undef PeekMessage | |||||
| class IAI | class IAI | ||||
| { | { | ||||
| public: | public: | ||||
| @@ -22,6 +22,10 @@ | |||||
| #include "structures.h" | #include "structures.h" | ||||
| #undef GetMessage | |||||
| #undef SendMessage | |||||
| #undef PeekMessage | |||||
| const constexpr int numOfGridPerCell = 1000; | const constexpr int numOfGridPerCell = 1000; | ||||
| class IAI; | class IAI; | ||||
| @@ -14,6 +14,10 @@ | |||||
| #include <queue> | #include <queue> | ||||
| #include <atomic> | #include <atomic> | ||||
| #undef GetMessage | |||||
| #undef SendMessage | |||||
| #undef PeekMessage | |||||
| class Logic; | class Logic; | ||||
| class Communication | class Communication | ||||
| @@ -8,6 +8,10 @@ | |||||
| #include <utility> | #include <utility> | ||||
| #include <optional> | #include <optional> | ||||
| #undef GetMessage | |||||
| #undef SendMessage | |||||
| #undef PeekMessage | |||||
| template<typename Elem> | template<typename Elem> | ||||
| class ConcurrentQueue | class ConcurrentQueue | ||||
| { | { | ||||
| @@ -6,6 +6,10 @@ | |||||
| #define SCCI static const constexpr inline | #define SCCI static const constexpr inline | ||||
| #endif | #endif | ||||
| #undef GetMessage | |||||
| #undef SendMessage | |||||
| #undef PeekMessage | |||||
| namespace Constants | namespace Constants | ||||
| { | { | ||||
| SCCI int frameDuration = 50; // 每帧毫秒数 | SCCI int frameDuration = 50; // 每帧毫秒数 | ||||
| @@ -31,6 +31,10 @@ | |||||
| #include "Communication.h" | #include "Communication.h" | ||||
| #include "ConcurrentQueue.hpp" | #include "ConcurrentQueue.hpp" | ||||
| #undef GetMessage | |||||
| #undef SendMessage | |||||
| #undef PeekMessage | |||||
| // 封装了通信组件和对AI对象进行操作 | // 封装了通信组件和对AI对象进行操作 | ||||
| class Logic : public ILogic | class Logic : public ILogic | ||||
| { | { | ||||
| @@ -9,6 +9,10 @@ | |||||
| #include "structures.h" | #include "structures.h" | ||||
| #undef GetMessage | |||||
| #undef SendMessage | |||||
| #undef PeekMessage | |||||
| // 存储场上的状态 | // 存储场上的状态 | ||||
| struct State | struct State | ||||
| { | { | ||||
| @@ -8,6 +8,10 @@ | |||||
| #include <vector> | #include <vector> | ||||
| #include <string> | #include <string> | ||||
| #undef GetMessage | |||||
| #undef SendMessage | |||||
| #undef PeekMessage | |||||
| namespace THUAI6 | namespace THUAI6 | ||||
| { | { | ||||
| @@ -13,6 +13,10 @@ | |||||
| #include "structures.h" | #include "structures.h" | ||||
| #undef GetMessage | |||||
| #undef SendMessage | |||||
| #undef PeekMessage | |||||
| namespace AssistFunction | namespace AssistFunction | ||||
| { | { | ||||
| @@ -1,6 +1,11 @@ | |||||
| #include <optional> | #include <optional> | ||||
| #include "AI.h" | #include "AI.h" | ||||
| #include "API.h" | #include "API.h" | ||||
| #undef GetMessage | |||||
| #undef SendMessage | |||||
| #undef PeekMessage | |||||
| #define PI 3.14159265358979323846 | #define PI 3.14159265358979323846 | ||||
| int StudentAPI::GetFrameCount() const | int StudentAPI::GetFrameCount() const | ||||
| @@ -5,6 +5,10 @@ | |||||
| #include <mutex> | #include <mutex> | ||||
| #include <condition_variable> | #include <condition_variable> | ||||
| #undef GetMessage | |||||
| #undef SendMessage | |||||
| #undef PeekMessage | |||||
| using grpc::ClientContext; | using grpc::ClientContext; | ||||
| Communication::Communication(std::string sIP, std::string sPort) | Communication::Communication(std::string sIP, std::string sPort) | ||||
| @@ -4,6 +4,11 @@ | |||||
| #include "API.h" | #include "API.h" | ||||
| #include "utils.hpp" | #include "utils.hpp" | ||||
| #include "structures.h" | #include "structures.h" | ||||
| #undef GetMessage | |||||
| #undef SendMessage | |||||
| #undef PeekMessage | |||||
| #define PI 3.14159265358979323846 | #define PI 3.14159265358979323846 | ||||
| StudentDebugAPI::StudentDebugAPI(ILogic& logic, bool file, bool print, bool warnOnly, int64_t playerID) : | StudentDebugAPI::StudentDebugAPI(ILogic& logic, bool file, bool print, bool warnOnly, int64_t playerID) : | ||||
| @@ -8,6 +8,10 @@ | |||||
| #include "utils.hpp" | #include "utils.hpp" | ||||
| #include "Communication.h" | #include "Communication.h" | ||||
| #undef GetMessage | |||||
| #undef SendMessage | |||||
| #undef PeekMessage | |||||
| extern const bool asynchronous; | extern const bool asynchronous; | ||||
| Logic::Logic(THUAI6::PlayerType type, int64_t ID, THUAI6::TrickerType tricker, THUAI6::StudentType student) : | Logic::Logic(THUAI6::PlayerType type, int64_t ID, THUAI6::TrickerType tricker, THUAI6::StudentType student) : | ||||
| @@ -4,6 +4,10 @@ | |||||
| #include <tclap/CmdLine.h> | #include <tclap/CmdLine.h> | ||||
| #include <array> | #include <array> | ||||
| #undef GetMessage | |||||
| #undef SendMessage | |||||
| #undef PeekMessage | |||||
| #ifdef _MSC_VER | #ifdef _MSC_VER | ||||
| #pragma warning(disable : 4996) | #pragma warning(disable : 4996) | ||||
| #endif | #endif | ||||
| @@ -1,7 +1,7 @@ | |||||
| #!/usr/bin/env bash | #!/usr/bin/env bash | ||||
| python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 0 -d -o& | |||||
| python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 1 -o& | |||||
| python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 0& | |||||
| # python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 1 -o& | |||||
| # python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 2& | # python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 2& | ||||
| # python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 3& | # python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 3& | ||||
| # python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 4& | |||||
| python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 4 -d& | |||||