Browse Source

Merge pull request #444 from DragonAura/dev

fix(CAPI): 🐛 fix windows get message define
tags/0.1.0
shangfengh GitHub 3 years ago
parent
commit
cd39400efc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 61 additions and 3 deletions
  1. +4
    -0
      CAPI/cpp/API/include/AI.h
  2. +4
    -0
      CAPI/cpp/API/include/API.h
  3. +4
    -0
      CAPI/cpp/API/include/Communication.h
  4. +4
    -0
      CAPI/cpp/API/include/ConcurrentQueue.hpp
  5. +4
    -0
      CAPI/cpp/API/include/constants.h
  6. +4
    -0
      CAPI/cpp/API/include/logic.h
  7. +4
    -0
      CAPI/cpp/API/include/state.h
  8. +4
    -0
      CAPI/cpp/API/include/structures.h
  9. +4
    -0
      CAPI/cpp/API/include/utils.hpp
  10. +5
    -0
      CAPI/cpp/API/src/API.cpp
  11. +4
    -0
      CAPI/cpp/API/src/Communication.cpp
  12. +5
    -0
      CAPI/cpp/API/src/DebugAPI.cpp
  13. +4
    -0
      CAPI/cpp/API/src/logic.cpp
  14. +4
    -0
      CAPI/cpp/API/src/main.cpp
  15. +3
    -3
      CAPI/python/run.sh

+ 4
- 0
CAPI/cpp/API/include/AI.h View File

@@ -4,6 +4,10 @@


#include "API.h" #include "API.h"


#undef GetMessage
#undef SendMessage
#undef PeekMessage

class IAI class IAI
{ {
public: public:


+ 4
- 0
CAPI/cpp/API/include/API.h View File

@@ -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;


+ 4
- 0
CAPI/cpp/API/include/Communication.h View File

@@ -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


+ 4
- 0
CAPI/cpp/API/include/ConcurrentQueue.hpp View File

@@ -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
{ {


+ 4
- 0
CAPI/cpp/API/include/constants.h View File

@@ -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; // 每帧毫秒数


+ 4
- 0
CAPI/cpp/API/include/logic.h View File

@@ -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
{ {


+ 4
- 0
CAPI/cpp/API/include/state.h View File

@@ -9,6 +9,10 @@


#include "structures.h" #include "structures.h"


#undef GetMessage
#undef SendMessage
#undef PeekMessage

// 存储场上的状态 // 存储场上的状态
struct State struct State
{ {


+ 4
- 0
CAPI/cpp/API/include/structures.h View File

@@ -8,6 +8,10 @@
#include <vector> #include <vector>
#include <string> #include <string>


#undef GetMessage
#undef SendMessage
#undef PeekMessage

namespace THUAI6 namespace THUAI6
{ {




+ 4
- 0
CAPI/cpp/API/include/utils.hpp View File

@@ -13,6 +13,10 @@


#include "structures.h" #include "structures.h"


#undef GetMessage
#undef SendMessage
#undef PeekMessage

namespace AssistFunction namespace AssistFunction
{ {




+ 5
- 0
CAPI/cpp/API/src/API.cpp View File

@@ -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


+ 4
- 0
CAPI/cpp/API/src/Communication.cpp View File

@@ -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)


+ 5
- 0
CAPI/cpp/API/src/DebugAPI.cpp View File

@@ -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) :


+ 4
- 0
CAPI/cpp/API/src/logic.cpp View File

@@ -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
- 0
CAPI/cpp/API/src/main.cpp View File

@@ -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


+ 3
- 3
CAPI/python/run.sh View File

@@ -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&

Loading…
Cancel
Save