KiTraining
 All Data Structures Functions
Public Member Functions | Data Fields
gameHandling::Game Class Reference

Public Member Functions

 Game (communication::messages::broadcast::MatchConfig matchConfig, const communication::messages::request::TeamConfig &teamConfig1, const communication::messages::request::TeamConfig &teamConfig2, communication::messages::request::TeamFormation teamFormation1, communication::messages::request::TeamFormation teamFormation2, util::Logging &log, std::string expDir)
 
 Game (communication::messages::broadcast::MatchConfig matchConfig, const aiTools::State &state, util::Logging &log, std::string expDir)
 
auto getNextAction () -> communication::messages::broadcast::Next
 
bool executeDelta (communication::messages::request::DeltaRequest command, gameModel::TeamSide teamSide)
 
void executeBallDelta (communication::messages::types::EntityId entityId)
 
auto getState () const -> aiTools::State
 
void saveExperience ()
 

Data Fields

std::shared_ptr
< gameModel::Environment > 
environment
 
std::optional< std::pair
< gameModel::TeamSide,
communication::messages::types::VictoryReason > > 
winEvent
 

Constructor & Destructor Documentation

gameHandling::Game::Game ( communication::messages::broadcast::MatchConfig  matchConfig,
const aiTools::State &  state,
util::Logging &  log,
std::string  expDir 
)

Constructs a game from a saved experience

Parameters
expFilefile to load the experience from
loglogging instance
expPathdirectory to save the new experiences to

Member Function Documentation

void gameHandling::Game::executeBallDelta ( communication::messages::types::EntityId  entityId)

Executes a ball turn

Parameters
entityIdthe ball to make a move
bool gameHandling::Game::executeDelta ( communication::messages::request::DeltaRequest  command,
gameModel::TeamSide  teamSide 
)

Executess the requested command if compliant with the game rules

Parameters
commandCommand to be executed
teamSideSide which executes the command
Returns
true if successful, false if rule violation
auto gameHandling::Game::getNextAction ( ) -> communication::messages::broadcast::Next

Gets the next actor to make a move. If the actor is a player, the timeout timer is started

Returns
auto gameHandling::Game::getState ( ) const -> aiTools::State

Gets a copy of the current game state

Returns
void gameHandling::Game::saveExperience ( )

Saves the current State if certain conditions are met


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