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

#include <Action.h>

Inheritance diagram for gameController::WrestQuaffle:
gameController::Action

Public Member Functions

 WrestQuaffle ()=default
 
 WrestQuaffle (std::shared_ptr< gameModel::Environment > env, std::shared_ptr< gameModel::Chaser > actor, gameModel::Position target)
 
auto execute () const -> std::pair< std::vector< ActionResult >, std::vector< gameModel::Foul >>
 
auto successProb () const -> double override
 
auto check () const -> ActionCheckResult override
 
auto executeAll () const -> std::vector< std::pair< std::shared_ptr< gameModel::Environment >, double >> override
 
- 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 the action of wresting the Quaffel from another player.

Constructor & Destructor Documentation

gameController::WrestQuaffle::WrestQuaffle ( )
default

default constructor for the WrestQuaffle class.

gameController::WrestQuaffle::WrestQuaffle ( std::shared_ptr< gameModel::Environment env,
std::shared_ptr< gameModel::Chaser actor,
gameModel::Position  target 
)

main constructor for the WrestQuaffle class.

Parameters
envthe environment to operate on
actorthe acting player (only chaser) as shared pointer.
targetthe target position of the shot.

Member Function Documentation

auto gameController::WrestQuaffle::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::WrestQuaffle::execute ( ) const -> std::pair< std::vector< ActionResult >, std::vector< gameModel::Foul >>
virtual

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::WrestQuaffle::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::WrestQuaffle::successProb ( ) const -> double
overridevirtual

Probability that the quaffle is wrested

Returns
the success probability of wresting the quaffel as double.

Implements gameController::Action.


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