#include <Action.h>
Public Member Functions | |
Shot (std::shared_ptr< gameModel::Environment > env, std::shared_ptr< gameModel::Player > actor, std::shared_ptr< gameModel::Ball > ball, 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 |
auto | isShotOnGoal () const -> std::optional< ActionResult > |
auto | shotType () const -> std::optional< communication::messages::types::DeltaType > |
const std::shared_ptr< const gameModel::Ball > | getBall () const |
![]() | |
Action ()=default | |
Action (std::shared_ptr< gameModel::Environment > env, std::shared_ptr< gameModel::Player > actor, gameModel::Position target) | |
virtual | ~Action ()=default |
const gameModel::Position & | getTarget () const |
Additional Inherited Members | |
![]() | |
std::shared_ptr < gameModel::Player > | actor |
std::shared_ptr < gameModel::Environment > | env |
gameModel::Position | target {} |
Represents actions with the game's balls except for the Snitch
gameController::Shot::Shot | ( | std::shared_ptr< gameModel::Environment > | env, |
std::shared_ptr< gameModel::Player > | actor, | ||
std::shared_ptr< gameModel::Ball > | ball, | ||
gameModel::Position | target | ||
) |
main constructor for the Shot class.
env | the environment to operate on |
actor | the acting player as shared pointer. |
ball | The ball to be moved |
target | the target position of the shot. |
|
overridevirtual |
Checks if the Action is possible an if it may result in a foul
Implements gameController::Action.
|
virtual |
executes the Action. Method is not deterministic.
std::runtime_exception | if Action is impossible |
Implements gameController::Action.
|
overridevirtual |
Produces a list with all possible outcomes of the Action and the respective transition probabilities.
Implements gameController::Action.
const std::shared_ptr< const gameModel::Ball > gameController::Shot::getBall | ( | ) | const |
Getter
auto gameController::Shot::isShotOnGoal | ( | ) | const -> std::optional<ActionResult> |
Checks if the defined Shot will result in a goal if it succeeds
auto gameController::Shot::shotType | ( | ) | const -> std::optional<communication::messages::types::DeltaType> |
Returns the type of Shot as DeltaType
|
overridevirtual |
When throwing Quaffle, returns probability that ball lands on target. When shooting Bludger, returns probability of knocking out player on target.
Implements gameController::Action.