Rally X
ELEN3009 Project by Justin Wernick and David Schneider
Public Member Functions | Private Attributes
LimitedTimeObject Class Reference

Parent class for GameObjects that are created, exist for a given time, and are then destroyed. More...

#include <LimitedTimeObject.h>

Inheritance diagram for LimitedTimeObject:
GameObject DestroyedObjectPopup Smokescreen

List of all members.

Public Member Functions

 LimitedTimeObject (double x, double y, BitmapStore::Image image, int time)
 Creates a LimitedTimeObject with the given parameters.
void update ()
 Function that should be run on every iteration of the gameloop.

Private Attributes

int _remainingTime
 The number of times that update still needs to be run before the object is marked for destruction.

Detailed Description

Parent class for GameObjects that are created, exist for a given time, and are then destroyed.

Author:
Justin Wernick
David Schneider

Definition at line 14 of file LimitedTimeObject.h.


Constructor & Destructor Documentation

LimitedTimeObject::LimitedTimeObject ( double  x,
double  y,
BitmapStore::Image  image,
int  time 
)

Creates a LimitedTimeObject with the given parameters.

Parameters:
[in]xThe x coordinate of the new object.
[in]yThe y coordinate of the new object.
[in]imageThe image that is drawn to represent the object.
[in]timeThe number of times that the update function is run before the object is destroyed.

Definition at line 3 of file LimitedTimeObject.cpp.


Member Function Documentation

void LimitedTimeObject::update ( )

Function that should be run on every iteration of the gameloop.

The time remaining is decremented, and the object is marked for destruction when it reaches zero.

Definition at line 9 of file LimitedTimeObject.cpp.


Member Data Documentation

The number of times that update still needs to be run before the object is marked for destruction.

For example, if the remaining time is 1, then the object is marked on the next update.

Definition at line 42 of file LimitedTimeObject.h.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator