Botball Game State
A game stared library for Botball, it helps model the table and different phases of the competition.
Loading...
Searching...
No Matches
Client Class Reference
Inheritance diagram for Client:
Socket

Public Member Functions

GameState get_remote_state (const std::string &ip_address, uint16_t port)
Public Member Functions inherited from Socket
void init_socket (uint16_t port)
void init_server (uint16_t port)
void init_client (const std::string &ip_address, uint16_t port)
void recv_all (void *buf, size_t len)
void send_all (const void *buf, size_t len) const
void send_json (const json &data) const
std::optional< json > recv_json ()
void shutdown_socket ()
void close_socket ()

Additional Inherited Members

Protected Attributes inherited from Socket
int m_fd = -1
bool m_closed = true
std::shared_ptr< spdlog::logger > m_log

Member Function Documentation

◆ get_remote_state()

GameState Client::get_remote_state ( const std::string & ip_address,
uint16_t port )
nodiscard

Initializes the Socket, connects to the server as a client, gets the by the server already verified config and reconstructs the GameState object which it then returns.

Parameters
ip_addressof the remote server (bot_a)
portof the remote server
Returns
a GameState object

The documentation for this class was generated from the following file: