Orxonox: orxonox::PlayerTrigger Class Reference

# orxonox::PlayerTrigger Class Reference

A PlayerTrigger is a trigger which is normally triggered by ControllableEntities and can as such return a pointer to the ControllableEntity which triggered it. More...

`#include <src/orxonox/objects/worldentities/triggers/PlayerTrigger.h>`

Inheritance diagram for orxonox::PlayerTrigger:

List of all members.

## Public Member Functions

Pawn * | getTriggeringPlayer (void) const
| Returns the player that triggered the PlayerTrigger.
bool | isForPlayer (void) const
| Checks whether the PlayerTrigger normally returns a ControllableEntity.
| PlayerTrigger (BaseObject *creator)
| Constructor. Registers the object and initializes defaults.
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode)
| Method for creating a PlayerTrigger object through XML.
virtual | ~PlayerTrigger ()
| Destructor.

## Protected Member Functions

virtual bool | isTriggered (TriggerMode::Value mode)=0
void | setForPlayer (bool isForPlayer)
| Set whether the PlayerTrigger normally is triggered by ControllableEntities.
void | setTriggeringPlayer (Pawn *player)
| Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger.

## Private Attributes

bool | isForPlayer_
| Is true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities.
Pawn * | player_
| The player that triggered the PlayerTrigger.

## Detailed Description

A PlayerTrigger is a trigger which is normally triggered by ControllableEntities and can as such return a pointer to the ControllableEntity which triggered it.

Author:
  Damian 'Mozork' Frick

## Constructor & Destructor Documentation

orxonox::PlayerTrigger::PlayerTrigger | ( | BaseObject * | creator | ) |

Constructor. Registers the object and initializes defaults.

References isForPlayer_, player_, and RegisterObject.

orxonox::PlayerTrigger::~PlayerTrigger | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

Pawn* orxonox::PlayerTrigger::getTriggeringPlayer | ( | void |  | ) | const`[inline]`

Returns the player that triggered the PlayerTrigger.

Returns:
  Returns a pointer to the ControllableEntity that triggered the PlayerTrigger.

Referenced by orxonox::QuestEffectBeacon::execute().

bool orxonox::PlayerTrigger::isForPlayer | ( | void |  | ) | const`[inline]`

Checks whether the PlayerTrigger normally returns a ControllableEntity.

Returns:
  Returns true if the PlayerTrigger normally returns a ControllableEntity.

Referenced by orxonox::DistanceTrigger::checkDistance(), and orxonox::QuestEffectBeacon::execute().

virtual bool orxonox::PlayerTrigger::isTriggered | ( | TriggerMode::Value | mode | ) | `[protected, pure virtual]`

Reimplemented from orxonox::Trigger.

Implemented in orxonox::DistanceTrigger.

void orxonox::PlayerTrigger::setForPlayer | ( | bool | isForPlayer | ) | `[inline, protected]`

Set whether the PlayerTrigger normally is triggered by ControllableEntities.

Parameters:

  | isForPlayer | Should be true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities, false if not.

Referenced by orxonox::DistanceTrigger::addTargets(), and orxonox::DistanceTrigger::DistanceTrigger().

void orxonox::PlayerTrigger::setTriggeringPlayer | ( | Pawn * | player | ) | `[inline, protected]`

Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger.

Parameters:

  | player | A pointer to the ControllableEntity that triggered the PlayerTrigger.

Referenced by orxonox::DistanceTrigger::checkDistance().

void orxonox::PlayerTrigger::XMLPort | ( | Element & | xmlelement,
|  | XMLPort::Mode | mode |
| ) |  |  | `[virtual]`

Method for creating a PlayerTrigger object through XML.

Method for creating a QuestEffectBeacon object through XML.

Reimplemented from orxonox::Trigger.

Reimplemented in orxonox::CheckPoint, and orxonox::DistanceTrigger.

References SUPER.

## Member Data Documentation

bool orxonox::PlayerTrigger::isForPlayer_`[private]`

Is true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities.

Referenced by PlayerTrigger().

Pawn* orxonox::PlayerTrigger::player_`[private]`

The player that triggered the PlayerTrigger.

Referenced by PlayerTrigger().

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

- src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
- src/orxonox/objects/worldentities/triggers/PlayerTrigger.cc