@@ -75,6 +75,7 @@ class ILogic
7575 virtual bool BuildCharacter (THUAI9 ::CharacterType CharacterType, int32_t playerID) = 0;
7676 virtual bool ProduceGoods (THUAI9 ::GoodsType goodsType, int32_t maxProduceNum) = 0;
7777 virtual bool UplevelTech (THUAI9 ::TechType techType) = 0;
78+ virtual std::string AskAI (int64_t currentGameTime, std::string prompt, std::string apiKey) = 0;
7879};
7980
8081class IAPI
@@ -93,6 +94,7 @@ class IAPI
9394 // 等待下一帧
9495 virtual bool Wait () = 0;
9596 virtual std::future<bool > EndAllAction () = 0;
97+ virtual std::future<std::string> AskAI (int64_t currentGameTime, std::string prompt, std::string apiKey = " " ) = 0;
9698 [[nodiscard]] virtual std::vector<std::shared_ptr<const THUAI9 ::Character>> GetCharacters () const = 0;
9799 [[nodiscard]] virtual std::vector<std::shared_ptr<const THUAI9 ::Character>> GetEnemyCharacters () const = 0;
98100 [[nodiscard]] virtual std::vector<std::vector<THUAI9 ::PlaceType>> GetFullMap () const = 0;
@@ -190,6 +192,7 @@ class CharacterAPI : public ICharacterAPI, public IGameTimer
190192 [[nodiscard]] int32_t GetFrameCount () const override ;
191193 bool Wait () override ;
192194 std::future<bool > EndAllAction () override ;
195+ std::future<std::string> AskAI (int64_t currentGameTime, std::string prompt, std::string apiKey = " " ) override ;
193196
194197 std::future<bool > Move (int64_t moveTimeInMilliseconds, double angle) override ;
195198 std::future<bool > MoveRight (int64_t timeInMilliseconds) override ;
@@ -258,6 +261,7 @@ class TeamAPI : public ITeamAPI, public IGameTimer
258261 [[nodiscard]] int32_t GetFrameCount () const override ;
259262 bool Wait () override ;
260263 std::future<bool > EndAllAction () override ;
264+ std::future<std::string> AskAI (int64_t currentGameTime, std::string prompt, std::string apiKey = " " ) override ;
261265
262266 [[nodiscard]] std::vector<std::shared_ptr<const THUAI9 ::Character>> GetCharacters () const override ;
263267 [[nodiscard]] std::vector<std::shared_ptr<const THUAI9 ::Character>> GetEnemyCharacters () const override ;
@@ -307,6 +311,7 @@ class CharacterDebugAPI : public ICharacterAPI, public IGameTimer
307311 bool Wait () override ;
308312 [[nodiscard]] int32_t GetFrameCount () const override ;
309313 std::future<bool > EndAllAction () override ;
314+ std::future<std::string> AskAI (int64_t currentGameTime, std::string prompt, std::string apiKey = " " ) override ;
310315
311316 std::future<bool > Move (int64_t moveTimeInMilliseconds, double angle) override ;
312317 std::future<bool > MoveRight (int64_t timeInMilliseconds) override ;
@@ -366,6 +371,7 @@ class TeamDebugAPI : public ITeamAPI, public IGameTimer
366371 [[nodiscard]] int32_t GetFrameCount () const override ;
367372 bool Wait () override ;
368373 std::future<bool > EndAllAction () override ;
374+ std::future<std::string> AskAI (int64_t currentGameTime, std::string prompt, std::string apiKey = " " ) override ;
369375
370376 [[nodiscard]] std::vector<std::shared_ptr<const THUAI9 ::Character>> GetCharacters () const override ;
371377 [[nodiscard]] std::vector<std::shared_ptr<const THUAI9 ::Character>> GetEnemyCharacters () const override ;
0 commit comments