Librcsc阅读笔记:WorldModel

player's internal field status 常量,世界模型,球员在球场的状态

Structure

  • InterceptTable 拦截表
  • list, vector:PlayerObject 球员对象(包括列表和向量)
    • 队友、敌人
    • 和球靠近的队友、敌人
    • 视线内队友、敌人
  • AbstractPlayerObject 抽象球员对象
  • SelfObject 自己
    • StaminaModel 体力模型
    • ViewQuality
    • ViewWidth
  • BallObject 足球
  • Localization
  • ViewArea 视角
  • GameMode
  • GameTime
  • PenaltyKickState

InterceptTable

interception info holder for all players 所有球员关于拦截信息的唯一变量

 InterceptTable (const WorldModel &world)
//  init member variables, reserve cache vector memory
 ~InterceptTable ()
//  destructor. nothing to do
void update ()
//  recreate all interception info
void hearTeammate (const int unum, const int cycle)
//  set teammate intercept info mainly by heard info
void hearOpponent (const int unum, const int cycle)
//  set opponent intercept info mainly by heard info

上面两个函数的参数:unum(uniform number 球衣号码),cycle(interception cycle 拦截周期)

[!NOTE] 关于拦截表的周期有待后续研究,特别是interception cycle的用途

int selfReachCycle () const
//  get minimal ball gettable cycle for self without stamina exhaust
int selfExhaustReachCycle () const
//  get minimal ball gettable cycle for self with stamina exhaust
int teammateReachCycle () const
//  get minimal ball gettable cycle for teammate
int secondTeammateReachCycle () const
//  get the ball access cycle for the second teammate
int goalieReachCycle () const
//  get the ball access cycle for the teammate goalie
int opponentReachCycle () const
//  get minimal ball gettable cycle for opponent
int secondOpponentReachCycle () const
//  get the ball access cycle for the second opponent

Functions and Affiliated Typedef

本部分把worldmodel类下主要的函数和其返回值表达变量所需的结构体类型进行的定义。

GameTime

主要记录两种时间:一是从开球至现在的时间(记录为cycle的循环)、二是比赛暂停状态至现在的时间(例如进球)

调用函数

const GameTime& rcsc::WorldModel::time()

类成员函数

const long & cycle ()

比赛运行时间

const long & stopped ()

比赛停止时间

SelfObject

类成员函数

PlayerType& playerType ()

获得球员类型

[!DANGER]

在研究self的球队角色时,发现sample_player.cpp有以下写法,和这个函数功能上是冲突的:

wm.self().goalie()
bool isKickable()

能不能踢到球

bool isFrozen ()

check if body is freezed by tackle effect

bool返回值函数

Copyright@Njupt-Apollo-2d-2021 all right reserved,powered by Gitbook该文件最新修订时间: 2022-02-26 09:05:41

results matching ""

    No results matching ""