Skip to content
This repository has been archived by the owner on Apr 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #119 from BowmanChow/dev
Browse files Browse the repository at this point in the history
消息发送的时间间隔调整为稍小于50,留出一定余量
  • Loading branch information
Sweetnow authored Apr 30, 2020
2 parents 8b605bc + 6f3ff41 commit 6e04aab
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 431 deletions.
26 changes: 20 additions & 6 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,37 @@

## 玩家操作

- void THUAI3::move(Direction direction_t, int duration)
- bool THUAI3::move(Direction direction_t, int duration)

人物移动,第一个参数为移动方向,一共有8个方向,分别是右,右上,上,左上,左,左下,下,右下。
第二个参数为移动的时间(以毫秒计算),本游戏帧率为20,选手初始移动速度为每秒5个单位,如设定移动时间为1000则会在接下来的1秒内每50毫秒移动一次,每次移动距离为0.05.
第二个参数为移动的时间(以毫秒计算),本游戏帧率为20,选手初始移动速度为每秒5个单位,如设定移动时间为1000则会在接下来的1秒内每50毫秒移动一次,每次移动距离为0.25。

- void THUAI3::put(double distance, double angle, bool isThrowDish);
返回值表示消息是否发送成功。

- bool THUAI3::put(double distance, double angle, bool isThrowDish);

扔出物品,第一个参数为扔出的距离,物品的飞行速度是每秒10个单位。第二个参数为扔出时的绝对角度,单位为弧度制。第三个参数为是否扔出食材,若为true则扔出手中食材,若为false则扔出道具。

- void THUAI3::use(int type, double parameter1, double parameter2)
返回值表示消息是否发送成功。

- bool THUAI3::use(int type, double parameter1, double parameter2)

使用物品,第一个参数为使用类型,0为使用厨具或提交菜品,非0为使用手中的物品。后两个参数仅在使用传送门、锤子、弓箭时有效,parameter1为使用的距离,parameter2为使用的角度。

- void THUAI3::pick(bool isSelfPosition, ObjType pickType, int dishOrToolType);
返回值表示消息是否发送成功。

- bool THUAI3::pick(bool isSelfPosition, ObjType pickType, int dishOrToolType);

捡起物品。第一个参数为是否捡起自身所在方格的物品,若为true,则先检索自身所在方格,否则检索自己面对方向的方格。第二个参数为捡起的物品类型,可以为Block、Dish、Tool;若为Block表示捡起食物生产点或灶台里的食物,若为Dish表示捡起食物,若为Tool表示捡起道具。第三个参数为捡起的Dish或Tool类型,如果第二个参数为Dish,则这个参数必须与有效的DishType相对应,如果第二个参数为Tool,则这个参数必须与有效的ToolType相对应。若第三个参数为-1,表示随缘瞎捡。

- void THUAI3::speakToFriend(string speakText)
返回值表示消息是否发送成功。

- bool THUAI3::speakToFriend(string speakText)

向队友说话,每次最多只能发16个字符,多的截取前16个字符。

返回值表示消息是否发送成功。

- unsigned long long THUAI3::getGameTime()

获取目前距离游戏开始的时间,单位为毫秒。
Expand All @@ -34,6 +44,10 @@
- void ResumeCommunication();

继续数据更新,用于Debug。

- void wait();

等待下一次消息更新的到来。


## 数据结构
Expand Down
34 changes: 2 additions & 32 deletions CAPI/AI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,13 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
MinSizeRel|Win32 = MinSizeRel|Win32
MinSizeRel|x64 = MinSizeRel|x64
MinSizeRel|x86 = MinSizeRel|x86
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Release|x86 = Release|x86
RelWithDebInfo|Win32 = RelWithDebInfo|Win32
RelWithDebInfo|x64 = RelWithDebInfo|x64
RelWithDebInfo|x86 = RelWithDebInfo|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.Debug|Win32.ActiveCfg = Debug|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.Debug|Win32.Build.0 = Debug|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.Debug|x64.ActiveCfg = Debug|x64
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.Debug|x64.Build.0 = Debug|x64
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.Debug|x86.ActiveCfg = Debug|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.Debug|x86.Build.0 = Debug|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.MinSizeRel|Win32.Build.0 = MinSizeRel|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.MinSizeRel|x86.Build.0 = MinSizeRel|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.Debug|Win32.ActiveCfg = Release|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.Debug|Win32.Build.0 = Release|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.Release|Win32.ActiveCfg = Release|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.Release|Win32.Build.0 = Release|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.Release|x64.ActiveCfg = Release|x64
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.Release|x64.Build.0 = Release|x64
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.Release|x86.ActiveCfg = Release|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.Release|x86.Build.0 = Release|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Win32
{6D4987B3-D431-35BD-963C-E3ADA6053B41}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading

0 comments on commit 6e04aab

Please sign in to comment.