GameLogic
 All Data Structures Files Functions Variables Friends
Public Member Functions
gameController::Move Class Reference

#include <Action.h>

Inheritance diagram for gameController::Move:
gameController::Action

Public Member Functions

 Move ()=default
 
 Move (std::shared_ptr< gameModel::Environment > env, std::shared_ptr< gameModel::Player > actor, gameModel::Position target)
 
auto execute () const -> std::pair< std::vector< ActionResult >, std::vector< gameModel::Foul >> override
 
auto successProb () const -> double override
 
auto check () const -> ActionCheckResult override
 
auto executeAll () const -> std::vector< std::pair< std::shared_ptr< gameModel::Environment >, double >> override
 
auto checkForFoul () const -> std::vector< gameModel::Foul >
 
- Public Member Functions inherited from gameController::Action
 Action ()=default
 
 Action (std::shared_ptr< gameModel::Environment > env, std::shared_ptr< gameModel::Player > actor, gameModel::Position target)
 
virtual ~Action ()=default
 
const gameModel::PositiongetTarget () const
 

Additional Inherited Members

- Protected Attributes inherited from gameController::Action
std::shared_ptr
< gameModel::Player
actor
 
std::shared_ptr
< gameModel::Environment
env
 
gameModel::Position target {}
 

Detailed Description

class for a move in the game

Constructor & Destructor Documentation

gameController::Move::Move ( )
default

default constructor for the Move Class.

gameController::Move::Move ( std::shared_ptr< gameModel::Environment env,
std::shared_ptr< gameModel::Player actor,
gameModel::Position  target 
)

main constructor for the Move class.

Parameters
envthe environment to operate on
actorthe acting player or ball as shared pointer.
targetthe target position of the move.

Member Function Documentation

auto gameController::Move::check ( ) const -> ActionCheckResult
overridevirtual

Checks if the Action is possible an if it may result in a foul

Returns
See ActionCheckResult

Implements gameController::Action.

auto gameController::Move::checkForFoul ( ) const -> std::vector<gameModel::Foul>

checks if the move is a foul.

Returns
List with possible fouls resulting from the move
auto gameController::Move::execute ( ) const -> std::pair< std::vector< ActionResult >, std::vector< gameModel::Foul >>
overridevirtual

executes the Action. Method is not deterministic.

Exceptions
std::runtime_exceptionif Action is impossible
Returns
List of ramifications from the action execution, list of fouls during the execution

Implements gameController::Action.

auto gameController::Move::executeAll ( ) const -> std::vector< std::pair< std::shared_ptr< gameModel::Environment >, double >>
overridevirtual

Produces a list with all possible outcomes of the Action and the respective transition probabilities.

Returns
List of pairs consisting of the resulting Environment and the probability of landing in that state

Implements gameController::Action.

auto gameController::Move::successProb ( ) const -> double
overridevirtual

Probability that the actor will land on target cell and is not banned for commiting a foul

Returns
the success probability of the move as double.

Implements gameController::Action.


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