#include <IShootable.h>
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 |
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.
IShootable::IShootable | ( | Game * | game, | |
H3DNode | parent, | |||
Physics * | physics, | |||
const int | id, | |||
const char * | name | |||
) | [inline] |
intializes an IShootable
game | ||
parent | ||
physics | ||
id |
Definition at line 65 of file IShootable.h.
btRigidBody* IShootable::getBody | ( | ) | [inline] |
returns the physics body of this shootable object
Definition at line 88 of file IShootable.h.
int IShootable::getHealth | ( | ) | [inline] |
returns the health of this object.
Definition at line 80 of file IShootable.h.
int IShootable::getID | ( | ) | [inline] |
const char* IShootable::getName | ( | ) | [inline] |
returns the name of this shootable object
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.
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.
Physics* IShootable::_physics [protected] |
accomodates physics since IShootables are always subject to collision detection
Definition at line 46 of file IShootable.h.