SequenceTrigger Class Reference

#include <sequence_trigger.hpp>

Inherits TriggerBase.

List of all members.

Public Member Functions

 SequenceTrigger (const Reader &reader)
 SequenceTrigger (const Vector &pos, const std::string &sequence)
 ~SequenceTrigger ()
void event (Player &player, EventType type)
std::string get_sequence_name () const

Private Attributes

EventType triggerevent
std::string sequence_name


Detailed Description

Definition at line 24 of file sequence_trigger.hpp.


Constructor & Destructor Documentation

SequenceTrigger::SequenceTrigger ( const Reader reader  ) 

Definition at line 22 of file sequence_trigger.cpp.

References MovingObject::bbox, TriggerBase::EVENT_TOUCH, lisp::Lisp::get(), Rectf::p1, sequence_name, Rectf::set_size(), triggerevent, Vector::x, and Vector::y.

00022                                                      :
00023   triggerevent(),
00024   sequence_name()
00025 {
00026   reader.get("x", bbox.p1.x);
00027   reader.get("y", bbox.p1.y);
00028   float w = 0, h = 0;
00029   reader.get("width", w);
00030   reader.get("height", h);
00031   bbox.set_size(w, h);
00032   reader.get("sequence", sequence_name);
00033   triggerevent = EVENT_TOUCH;
00034 }

SequenceTrigger::SequenceTrigger ( const Vector pos,
const std::string &  sequence 
)

Definition at line 36 of file sequence_trigger.cpp.

References MovingObject::bbox, TriggerBase::EVENT_TOUCH, sequence_name, Rectf::set_pos(), Rectf::set_size(), and triggerevent.

00036                                                                              :
00037   triggerevent(),
00038   sequence_name()
00039 {
00040   bbox.set_pos(pos);
00041   bbox.set_size(32, 32);
00042   sequence_name = sequence;
00043   triggerevent = EVENT_TOUCH;
00044 }

SequenceTrigger::~SequenceTrigger (  ) 

Definition at line 46 of file sequence_trigger.cpp.

00047 {
00048 }


Member Function Documentation

void SequenceTrigger::event ( Player player,
EventType  type 
)

Definition at line 51 of file sequence_trigger.cpp.

References sequence_name, Player::trigger_sequence(), and triggerevent.

00052 {
00053   if(type == triggerevent) {
00054     player.trigger_sequence(sequence_name);
00055   }
00056 }

std::string SequenceTrigger::get_sequence_name (  )  const [inline]

Definition at line 33 of file sequence_trigger.hpp.

References sequence_name.

00033 { return sequence_name; }


Member Data Documentation

EventType SequenceTrigger::triggerevent [private]

Definition at line 36 of file sequence_trigger.hpp.

Referenced by event(), and SequenceTrigger().

std::string SequenceTrigger::sequence_name [private]

Definition at line 37 of file sequence_trigger.hpp.

Referenced by event(), get_sequence_name(), and SequenceTrigger().


The documentation for this class was generated from the following files:
Generated on Mon Jun 9 03:38:36 2014 for SuperTux by  doxygen 1.5.1