IShootable Class Reference

#include <IShootable.h>

Inheritance diagram for IShootable:
Enemy Explosive Player

List of all members.

Public Member Functions

virtual void hit ()=0
 IShootable (Game *game, H3DNode parent, Physics *physics, const int id, const char *name)
int getID ()
int getHealth ()
btRigidBody * getBody ()
const char * getName ()

Protected Attributes

int _id
int _health
btRigidBody * _body
H3DNode _parent
Game_game
Physics_physics
const char * _name

Detailed Description

This abstract class provides a possible interface to the player to hit with bullets. All implementing subclasses share the fact of a certain health state and the capability to die by being hit with a bullet from the player.

Definition at line 19 of file IShootable.h.


Constructor & Destructor Documentation

IShootable::IShootable ( Game game,
H3DNode  parent,
Physics physics,
const int  id,
const char *  name 
) [inline]

intializes an IShootable

Parameters:
game 
parent 
physics 
id 

Definition at line 65 of file IShootable.h.


Member Function Documentation

btRigidBody* IShootable::getBody (  )  [inline]

returns the physics body of this shootable object

Returns:
the body

Definition at line 88 of file IShootable.h.

int IShootable::getHealth (  )  [inline]

returns the health of this object.

Returns:
the health of this object

Definition at line 80 of file IShootable.h.

int IShootable::getID (  )  [inline]

returns the id of this object

Returns:
the id

Definition at line 72 of file IShootable.h.

const char* IShootable::getName (  )  [inline]

returns the name of this shootable object

Returns:
the name

Definition at line 96 of file IShootable.h.

virtual void IShootable::hit (  )  [pure virtual]

call this method to damage this IShootable. Hitting an instance would render in a decreasing health until death ocurrs.

Implemented in Enemy, and Player.


Member Data Documentation

btRigidBody* IShootable::_body [protected]

The body is used to determine the collision with the bullet

Definition at line 34 of file IShootable.h.

Game* IShootable::_game [protected]

accomodates the game as backreference

Definition at line 42 of file IShootable.h.

int IShootable::_health [protected]

After the health has reached zero this object is considered to be finally shot. the subclass may implement behaviour that may react to this state.

Definition at line 30 of file IShootable.h.

int IShootable::_id [protected]

the id is used for general distinguation of objects of the same class

Definition at line 24 of file IShootable.h.

const char* IShootable::_name [protected]

the name of the shootable object

Definition at line 50 of file IShootable.h.

H3DNode IShootable::_parent [protected]

the parent may be used to attach this object to the scenery tree

Definition at line 38 of file IShootable.h.

accomodates physics since IShootables are always subject to collision detection

Definition at line 46 of file IShootable.h.


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

Generated by  doxygen 1.6.2