ChangeableSprite Class Reference
[Robot building minigame]

#include <changeableSprite.h>

Inherits Sprite.

Collaboration diagram for ChangeableSprite:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ChangeableSprite (int type, Point point)
 ChangeableSprite (int type)
int getType ()
 Returns the current type of the sprite.
void setType (int type)
 Sets the type and image of the sprite to the given type.
void draw (BITMAP *canvas, Point offset)
 The basic draw() function.

Protected Member Functions

void setSprite ()
 Sets the image of the sprite to correspond with the type.

Protected Attributes

int type


Detailed Description

ChangeableSprite is a generic sprite whose image can be changed.

Constructor & Destructor Documentation

ChangeableSprite::ChangeableSprite ( int  type,
Point  point 
)

ChangeableSprite::ChangeableSprite ( int  type  ) 


Member Function Documentation

void ChangeableSprite::draw ( BITMAP *  canvas,
Point  offset 
) [virtual]

The basic draw() function.

This is literally

draw_sprite(canvas, sprite, (location + offset));

although the position has to be split back into x and y components.

Reimplemented from Sprite.

int ChangeableSprite::getType (  ) 

Returns the current type of the sprite.

Reimplemented from Sprite.

void ChangeableSprite::setSprite (  )  [protected]

Sets the image of the sprite to correspond with the type.

void ChangeableSprite::setType ( int  type  ) 

Sets the type and image of the sprite to the given type.


Member Data Documentation

int ChangeableSprite::type [protected]

The type of the image of the sprite

Reimplemented from Sprite.


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

Generated on Mon Mar 16 14:33:07 2009 for LearningGaming by  doxygen 1.5.7.1