From 6d077eca10f19c97b3af89d10f36d9f443596211 Mon Sep 17 00:00:00 2001 From: DragonAura Date: Tue, 24 Jan 2023 01:05:29 +0800 Subject: [PATCH] style(CAPI): :art: change some different naming styles --- CAPI/API/include/API.h | 28 ++++++++++++++-------------- CAPI/API/src/API.cpp | 16 ++++++++-------- CAPI/API/src/DebugAPI.cpp | 16 ++++++++-------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/CAPI/API/include/API.h b/CAPI/API/include/API.h index baf7db7..170266b 100644 --- a/CAPI/API/include/API.h +++ b/CAPI/API/include/API.h @@ -22,7 +22,7 @@ #include "structures.h" -const constexpr int num_of_grid_per_cell = 1000; +const constexpr int numOfGridPerCell = 1000; class IAI; @@ -39,7 +39,7 @@ public: virtual std::shared_ptr ButcherGetSelfInfo() const = 0; virtual std::vector> GetFullMap() const = 0; - virtual THUAI6::PlaceType GetPlaceType(int32_t CellX, int32_t CellY) const = 0; + virtual THUAI6::PlaceType GetPlaceType(int32_t cellX, int32_t cellY) const = 0; // 供IAPI使用的操作相关的部分 virtual bool Move(int64_t time, double angle) = 0; @@ -99,8 +99,8 @@ public: virtual std::future Wait() = 0; // 获取视野内可见的人类/屠夫的信息 - [[nodiscard]] virtual std::vector> GetHuman() const = 0; - [[nodiscard]] virtual std::vector> GetButcher() const = 0; + [[nodiscard]] virtual std::vector> GetHumans() const = 0; + [[nodiscard]] virtual std::vector> GetButchers() const = 0; // 获取视野内可见的道具信息 [[nodiscard]] virtual std::vector> GetProps() const = 0; @@ -120,13 +120,13 @@ public: // 获取指定格子中心的坐标 [[nodiscard]] static inline int CellToGrid(int cell) noexcept { - return cell * num_of_grid_per_cell + num_of_grid_per_cell / 2; + return cell * numOfGridPerCell + numOfGridPerCell / 2; } // 获取指定坐标点所位于的格子的 X 序号 [[nodiscard]] static inline int GridToCell(int grid) noexcept { - return grid / num_of_grid_per_cell; + return grid / numOfGridPerCell; } // 用于DEBUG的输出函数,选手仅在开启Debug模式的情况下可以使用 @@ -205,8 +205,8 @@ public: std::future Wait() override; - [[nodiscard]] std::vector> GetHuman() const override; - [[nodiscard]] std::vector> GetButcher() const override; + [[nodiscard]] std::vector> GetHumans() const override; + [[nodiscard]] std::vector> GetButchers() const override; [[nodiscard]] std::vector> GetProps() const override; @@ -272,8 +272,8 @@ public: std::future Wait() override; - [[nodiscard]] std::vector> GetHuman() const override; - [[nodiscard]] std::vector> GetButcher() const override; + [[nodiscard]] std::vector> GetHumans() const override; + [[nodiscard]] std::vector> GetButchers() const override; [[nodiscard]] std::vector> GetProps() const override; @@ -331,8 +331,8 @@ public: std::future Wait() override; - [[nodiscard]] std::vector> GetHuman() const override; - [[nodiscard]] std::vector> GetButcher() const override; + [[nodiscard]] std::vector> GetHumans() const override; + [[nodiscard]] std::vector> GetButchers() const override; [[nodiscard]] std::vector> GetProps() const override; @@ -385,8 +385,8 @@ public: std::future Wait() override; - [[nodiscard]] std::vector> GetHuman() const override; - [[nodiscard]] std::vector> GetButcher() const override; + [[nodiscard]] std::vector> GetHumans() const override; + [[nodiscard]] std::vector> GetButchers() const override; [[nodiscard]] std::vector> GetProps() const override; diff --git a/CAPI/API/src/API.cpp b/CAPI/API/src/API.cpp index 6702afd..3dec9df 100644 --- a/CAPI/API/src/API.cpp +++ b/CAPI/API/src/API.cpp @@ -157,22 +157,22 @@ std::future ButcherAPI::Wait() { return logic.WaitThread(); }); } -std::vector> HumanAPI::GetButcher() const +std::vector> HumanAPI::GetButchers() const { return logic.GetButchers(); } -std::vector> HumanAPI::GetHuman() const +std::vector> HumanAPI::GetHumans() const { return logic.GetHumans(); } -std::vector> ButcherAPI::GetButcher() const +std::vector> ButcherAPI::GetButchers() const { return logic.GetButchers(); } -std::vector> ButcherAPI::GetHuman() const +std::vector> ButcherAPI::GetHumans() const { return logic.GetHumans(); } @@ -192,14 +192,14 @@ std::vector> HumanAPI::GetFullMap() const return logic.GetFullMap(); } -THUAI6::PlaceType HumanAPI::GetPlaceType(int32_t CellX, int32_t CellY) const +THUAI6::PlaceType HumanAPI::GetPlaceType(int32_t cellX, int32_t cellY) const { - return logic.GetPlaceType(CellX, CellY); + return logic.GetPlaceType(cellX, cellY); } -THUAI6::PlaceType ButcherAPI::GetPlaceType(int32_t CellX, int32_t CellY) const +THUAI6::PlaceType ButcherAPI::GetPlaceType(int32_t cellX, int32_t cellY) const { - return logic.GetPlaceType(CellX, CellY); + return logic.GetPlaceType(cellX, cellY); } std::vector> ButcherAPI::GetFullMap() const diff --git a/CAPI/API/src/DebugAPI.cpp b/CAPI/API/src/DebugAPI.cpp index 25ca799..a3b68b4 100644 --- a/CAPI/API/src/DebugAPI.cpp +++ b/CAPI/API/src/DebugAPI.cpp @@ -288,22 +288,22 @@ std::future ButcherDebugAPI::Wait() { return logic.WaitThread(); }); } -std::vector> HumanDebugAPI::GetButcher() const +std::vector> HumanDebugAPI::GetButchers() const { return logic.GetButchers(); } -std::vector> HumanDebugAPI::GetHuman() const +std::vector> HumanDebugAPI::GetHumans() const { return logic.GetHumans(); } -std::vector> ButcherDebugAPI::GetButcher() const +std::vector> ButcherDebugAPI::GetButchers() const { return logic.GetButchers(); } -std::vector> ButcherDebugAPI::GetHuman() const +std::vector> ButcherDebugAPI::GetHumans() const { return logic.GetHumans(); } @@ -323,14 +323,14 @@ std::vector> HumanDebugAPI::GetFullMap() const return logic.GetFullMap(); } -THUAI6::PlaceType HumanDebugAPI::GetPlaceType(int32_t CellX, int32_t CellY) const +THUAI6::PlaceType HumanDebugAPI::GetPlaceType(int32_t cellX, int32_t cellY) const { - return logic.GetPlaceType(CellX, CellY); + return logic.GetPlaceType(cellX, cellY); } -THUAI6::PlaceType ButcherDebugAPI::GetPlaceType(int32_t CellX, int32_t CellY) const +THUAI6::PlaceType ButcherDebugAPI::GetPlaceType(int32_t cellX, int32_t cellY) const { - return logic.GetPlaceType(CellX, CellY); + return logic.GetPlaceType(cellX, cellY); } std::vector> ButcherDebugAPI::GetFullMap() const