diff --git a/CAPI/API/include/API.h b/CAPI/API/include/API.h index 3ecc565..6ca9437 100644 --- a/CAPI/API/include/API.h +++ b/CAPI/API/include/API.h @@ -33,7 +33,7 @@ public: virtual std::shared_ptr HumanGetSelfInfo() const = 0; virtual std::shared_ptr ButcherGetSelfInfo() const = 0; - virtual std::array, 50> GetFullMap() const = 0; + virtual std::vector> GetFullMap() const = 0; // 供IAPI使用的操作相关的部分 virtual bool Move(protobuf::MoveMsg) = 0; @@ -99,7 +99,7 @@ public: [[nodiscard]] virtual std::vector> GetProps() const = 0; // 获取地图信息,视野外的地图统一为Land - [[nodiscard]] virtual std::array, 50> GetFullMap() const = 0; + [[nodiscard]] virtual std::vector> GetFullMap() const = 0; [[nodiscard]] virtual THUAI6::PlaceType GetPlaceType(int32_t CellX, int32_t CellY) const = 0; // 获取所有玩家的GUID @@ -229,7 +229,7 @@ public: { } - [[nodiscard]] std::array, 50> GetFullMap() const override + [[nodiscard]] std::vector> GetFullMap() const override { } [[nodiscard]] THUAI6::PlaceType GetPlaceType(int32_t CellX, int32_t CellY) const override @@ -340,7 +340,7 @@ public: { } - [[nodiscard]] std::array, 50> GetFullMap() const override + [[nodiscard]] std::vector> GetFullMap() const override { } [[nodiscard]] THUAI6::PlaceType GetPlaceType(int32_t CellX, int32_t CellY) const override @@ -442,7 +442,7 @@ public: { } - [[nodiscard]] std::array, 50> GetFullMap() const override + [[nodiscard]] std::vector> GetFullMap() const override { } [[nodiscard]] THUAI6::PlaceType GetPlaceType(int32_t CellX, int32_t CellY) const override @@ -553,7 +553,7 @@ public: { } - [[nodiscard]] std::array, 50> GetFullMap() const override + [[nodiscard]] std::vector> GetFullMap() const override { } [[nodiscard]] THUAI6::PlaceType GetPlaceType(int32_t CellX, int32_t CellY) const override diff --git a/CAPI/API/include/logic.h b/CAPI/API/include/logic.h index 4de8101..f59b555 100644 --- a/CAPI/API/include/logic.h +++ b/CAPI/API/include/logic.h @@ -99,7 +99,7 @@ private: { } - std::array, 50> GetFullMap() const override + std::vector> GetFullMap() const override { } diff --git a/CAPI/API/include/state.h b/CAPI/API/include/state.h index 84c6018..e449fa0 100644 --- a/CAPI/API/include/state.h +++ b/CAPI/API/include/state.h @@ -20,7 +20,7 @@ struct State std::vector> butchers; std::vector> props; - std::array, 51> gamemap; + std::vector> gamemap; std::vector guids; }; diff --git a/CAPI/API/include/utils.hpp b/CAPI/API/include/utils.hpp index c46caac..362cdd4 100644 --- a/CAPI/API/include/utils.hpp +++ b/CAPI/API/include/utils.hpp @@ -142,13 +142,17 @@ namespace Proto2THUAI6 return prop; } - inline std::array, 51> Protobuf2THUAI6Map(const protobuf::MessageOfMap& mapMsg) + inline std::vector> Protobuf2THUAI6Map(const protobuf::MessageOfMap& mapMsg) { - std::array, 51> map; - for (int i = 0; i < 51; i++) + std::vector> map; + for (int i = 0; i < mapMsg.row_size(); i++) { - for (int j = 0; j < 51; j++) - map[i][j] = placeTypeDict[mapMsg.row(i).col(j)]; + std::vector row; + for (int j = 0; j < mapMsg.row(i).col_size(); j++) + { + row.push_back(placeTypeDict[mapMsg.row(i).col(j)]); + } + map.push_back(row); } return map; }