3#include "software/geom/point.h"
4#include "software/util/make_enum/make_enum.hpp"
5#include "software/world/ball.h"
8MAKE_ENUM(RefereeCommand,
30MAKE_ENUM(RefereeStage,
34 NORMAL_FIRST_HALF_PRE,
42 NORMAL_SECOND_HALF_PRE,
58 EXTRA_SECOND_HALF_PRE,
62 PENALTY_SHOOTOUT_BREAK,
104 restart_reason_(NONE),
105 command_(RefereeCommand::HALT),
108 ball_placement_point_(std::nullopt)
118 explicit GameState(
const TbotsProto::GameState& game_state_proto);
421 std::optional<Ball>
getBall(
void)
const;
432 PlayState play_state_;
433 RestartReason restart_reason_;
434 RefereeCommand command_;
435 std::optional<Ball> ball_;
442 std::optional<Point> ball_placement_point_;
Holds the state of the game according to the referee.
Definition game_state.h:80
bool isSetupRestart() const
Definition game_state.cpp:238
bool operator==(const GameState &other) const
Definition game_state.cpp:424
bool isOurPenalty() const
Definition game_state.cpp:177
bool isTheirIndirectFree() const
Definition game_state.cpp:217
bool isOurIndirectFree() const
Definition game_state.cpp:187
bool isIndirectFree() const
Definition game_state.cpp:167
bool stayAwayFromBall() const
Definition game_state.cpp:259
PlayState getPlayState(void) const
Definition game_state.cpp:232
bool isPlaying() const
Definition game_state.cpp:136
bool isDirectFree() const
Definition game_state.cpp:162
bool isOurKickoff() const
Definition game_state.cpp:172
void setRestartCompleted()
Definition game_state.cpp:418
std::optional< Point > getBallPlacementPoint(void) const
Definition game_state.cpp:281
void updateBall(const Ball &ball)
Definition game_state.cpp:389
const RefereeCommand & getRefereeCommand() const
Definition game_state.cpp:412
std::optional< Ball > getBall(void) const
Definition game_state.cpp:286
bool isTheirPenalty() const
Definition game_state.cpp:207
bool stayOnSide() const
Definition game_state.cpp:265
bool isTheirFreeKick() const
Definition game_state.cpp:222
RestartReason getRestartReason() const
Definition game_state.cpp:407
bool stayBehindPenaltyLine() const
Definition game_state.cpp:271
bool isOurDirectFree() const
Definition game_state.cpp:182
void updateRefereeCommand(RefereeCommand gameState)
Definition game_state.cpp:292
bool isHalted() const
Definition game_state.cpp:126
bool isOurBallPlacement() const
Definition game_state.cpp:197
bool operator!=(const GameState &other) const
Definition game_state.cpp:433
bool isTheirBallPlacement() const
Definition game_state.cpp:227
bool isTheirKickoff() const
Definition game_state.cpp:202
bool isBallPlacement() const
Definition game_state.cpp:151
bool isTheirDirectFree() const
Definition game_state.cpp:212
bool isOurRestart() const
Definition game_state.cpp:156
bool isOurFreeKick() const
Definition game_state.cpp:192
bool isPenalty() const
Definition game_state.cpp:146
void setBallPlacementPoint(Point placementPoint)
Definition game_state.cpp:276
bool canKick() const
Definition game_state.cpp:254
bool isStopped() const
Definition game_state.cpp:131
bool isReadyState() const
Definition game_state.cpp:248
bool isSetupState() const
Definition game_state.cpp:243
bool isKickoff() const
Definition game_state.cpp:141