Object Class Reference

#include <object.h>

Inherited by Ball, Paddle, and Rectangle.

List of all members.

Public Member Functions

 Object (char *imglocation, CollisionMode mode)
virtual ~Object ()
virtual void Render (SDL_Surface *screen)
virtual void Update ()
void Setsrccolorkey (int r, int g, int b)
void SetXPos (float i)
void SetYPos (float i)
void SetCenterXPos (float i)
void SetCenterYPos (float i)
void SetXVelocity (float i)
void SetYVelocity (float i)
void CollidesWith (char *name)
bool CollidedWith (char *name)
void ClearCollisionList ()
void GetVelocity (float *x, float *y)
void GetPos (float *x, float *y)
void GetImageArea (int *w, int *h)
CollisionMode GetCollisionMode ()

Protected Attributes

SDL_Rect m_blitrect
float m_posx
float m_posy
float m_velx
float m_vely
SDL_Surface * m_img
CollisionMode m_mode
std::vector< char * > m_collision_list


Detailed Description

This class is inherited by all objects that should be managed by the object manager


Constructor & Destructor Documentation

Object::Object ( char *  imglocation,
CollisionMode  mode 
)

Constructor

Parameters:
imglocation the location of the image that is loaded
mode the collision mode that is used

Object::~Object (  )  [virtual]


Member Function Documentation

void Object::Render ( SDL_Surface *  screen  )  [virtual]

renders the image to the specified screen

Parameters:
screen the screen to which the object is drawn

Reimplemented in Rectangle.

void Object::Update (  )  [virtual]

updates the object. Could be everything

Reimplemented in Paddle.

void Object::Setsrccolorkey ( int  r,
int  g,
int  b 
)

sets the source coler key

Parameters:
r the value for red
g the value for green
b the value for blue

void Object::SetXPos ( float  i  )  [inline]

sets the x value of the position

Parameters:
i the value for x

void Object::SetYPos ( float  i  )  [inline]

sets the y value of the position

Parameters:
i the value for y

void Object::SetCenterXPos ( float  i  )  [inline]

sets the centered x value of the position

Parameters:
i the value for x

void Object::SetCenterYPos ( float  i  )  [inline]

sets the centered y value of the position

Parameters:
i the value for y

void Object::SetXVelocity ( float  i  )  [inline]

sets the x value of the velocity

Parameters:
i the value for x

void Object::SetYVelocity ( float  i  )  [inline]

sets the y value of the velocity

Parameters:
i the value for y

void Object::CollidesWith ( char *  name  )  [inline]

Sets the string for the object with which ths one collided(used by object manager)

Parameters:
name name of the object with which this one collided

bool Object::CollidedWith ( char *  name  ) 

Gets the boolean for the object with which ths one collided

Parameters:
name name of the object that could collided with this object
Returns:
a boolean that indicates wether it collided with "name" or not

void Object::ClearCollisionList (  )  [inline]

Clears the whole collision list

void Object::GetVelocity ( float *  x,
float *  y 
) [inline]

Gets the x and y velocity

Parameters:
x the pointer which will set to the member x
y the pointer which will set to the member y

void Object::GetPos ( float *  x,
float *  y 
) [inline]

Gets the x and y position

Parameters:
x the pointer which will set to the velocity member x
y the pointer which will set to the velocity member y

void Object::GetImageArea ( int *  w,
int *  h 
) [inline]

Gets the w and h of the image

Parameters:
w the pointer which will set to the member w
h the pointer which will set to the member h

CollisionMode Object::GetCollisionMode (  )  [inline]

Gets the Collision mode

Returns:
the collision mode


Member Data Documentation

SDL_Rect Object::m_blitrect [protected]

float Object::m_posx [protected]

float Object::m_posy [protected]

float Object::m_velx [protected]

float Object::m_vely [protected]

SDL_Surface* Object::m_img [protected]

CollisionMode Object::m_mode [protected]

std::vector<char*> Object::m_collision_list [protected]


The documentation for this class was generated from the following files:
Generated on Wed Feb 21 21:50:47 2007 for Minup by  doxygen 1.5.1-p1