Grail (C++)  1.1.1
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::simulation::ISimulatedGameAction Class Referenceabstract

Base class for all actions in SimulatedGame. Derive from it for your actions. More...

#include <ISimulatedGameAction.hh>

Public Member Functions

virtual ISimulatedGameUnitApply (ISimulatedGameUnit &currentUnit, SimulatedGameRuntime &runtimeControl) const =0
 Applies the effects of the action and returns the next Unit to make an action. More...
 
virtual std::string ToString () const
 Returns a text representation of an action - used only for printing and debugging purposes.
 
virtual std::unique_ptr< ISimulatedGameActionCloneForLearning () const
 
virtual size_t HashForLearning () const
 
virtual bool EqualsForLearning (const ISimulatedGameAction &other) const
 

Friends

std::ostream & operator<< (std::ostream &os, const ISimulatedGameAction &action)
 

Detailed Description

Base class for all actions in SimulatedGame. Derive from it for your actions.


Member Function Documentation

◆ Apply()

virtual ISimulatedGameUnit* grail::simulation::ISimulatedGameAction::Apply ( ISimulatedGameUnit currentUnit,
SimulatedGameRuntime runtimeControl 
) const
pure virtual

Applies the effects of the action and returns the next Unit to make an action.

Parameters
currentUnitUnit that performs the action (currently active unit).
runtimeControlInterface for basic game-control flow (termination, scores, turn).
Returns

◆ CloneForLearning()

std::unique_ptr< ISimulatedGameAction > grail::simulation::ISimulatedGameAction::CloneForLearning ( ) const
virtual

Returns a deep copy of the action object. Used only in offline learning approach and DecisionTrees. If you don't use offline learning or decision tree, you don't have to provide implementation of this method.

◆ EqualsForLearning()

bool grail::simulation::ISimulatedGameAction::EqualsForLearning ( const ISimulatedGameAction other) const
virtual

Returns whether the action object is equal to other. If you don't use offline learning or decision tree, you don't have to provide implementation of this method.

◆ HashForLearning()

size_t grail::simulation::ISimulatedGameAction::HashForLearning ( ) const
virtual

Returns hash of the action object. Used only in offline learning approach and DecisionTrees. If you don't use offline learning or decision tree, you don't have to provide implementation of this method.


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