Electrifier Class Reference

#include <electrifier.hpp>

Inherits GameObject.

List of all members.

Public Member Functions

 Electrifier (uint32_t oldtile, uint32_t newtile, float seconds)
 ~Electrifier ()

Protected Member Functions

virtual void update (float time)
 This function is called once per frame and allows the object to update it's state.
virtual void draw (DrawingContext &context)
 The GameObject should draw itself onto the provided DrawingContext if this function is called.

Private Attributes

uint32_t change_from
uint32_t change_to
Timer duration


Detailed Description

Definition at line 26 of file electrifier.hpp.


Constructor & Destructor Documentation

Electrifier::Electrifier ( uint32_t  oldtile,
uint32_t  newtile,
float  seconds 
)

Definition at line 20 of file electrifier.cpp.

References change_from, Sector::change_solid_tiles(), change_to, Sector::current(), duration, and Timer::start().

00020                                                                           :
00021   change_from(),
00022   change_to(),
00023   duration()
00024 {
00025   duration.start(seconds);
00026   change_from = oldtile;
00027   change_to = newtile;
00028   Sector::current()->change_solid_tiles(change_from,change_to);
00029 }

Electrifier::~Electrifier (  ) 

Definition at line 31 of file electrifier.cpp.

00031                           {
00032 }


Member Function Documentation

void Electrifier::update ( float  time  )  [protected, virtual]

This function is called once per frame and allows the object to update it's state.

The elapsed_time is the time since the last frame in seconds and should be the base for all timed calculations (don't use SDL_GetTicks directly as this will fail in pause mode)

Implements GameObject.

Definition at line 35 of file electrifier.cpp.

References change_from, Sector::change_solid_tiles(), change_to, Timer::check(), Sector::current(), duration, and GameObject::remove_me().

00036 {
00037   if (duration.check()) {
00038     Sector::current()->change_solid_tiles(change_to,change_from);
00039     remove_me();
00040   }
00041 }

void Electrifier::draw ( DrawingContext context  )  [protected, virtual]

The GameObject should draw itself onto the provided DrawingContext if this function is called.

Implements GameObject.

Definition at line 44 of file electrifier.cpp.

00045 {
00046 }


Member Data Documentation

uint32_t Electrifier::change_from [private]

Definition at line 37 of file electrifier.hpp.

Referenced by Electrifier(), and update().

uint32_t Electrifier::change_to [private]

Definition at line 38 of file electrifier.hpp.

Referenced by Electrifier(), and update().

Timer Electrifier::duration [private]

Definition at line 39 of file electrifier.hpp.

Referenced by Electrifier(), and update().


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