Arch Game Engine
0.2
|
Class for storing health, emotion, team, etc. of an Object. More...
#include <entity.h>
Public Member Functions | |
double | getHealth () const |
Get Entity's health. | |
void | setHealth (double h) |
Set the Entity's health. If the health is higher then the max health it will set it to the max health. | |
double | getMaxHealth () const |
Get max health. | |
void | setMaxHealth (double mh) |
Set max health. | |
void | damage (double d) |
Deal damage. Subtracted from health. If health is less then zero it kills the entity. | |
void | heal (double h) |
Give health to the Entity. | |
int | getEmotion () const |
Get current emotion state. | |
void | setEmotion (int e) |
Set current emotion state. | |
int | getTeam () const |
Get Entity's team. | |
void | setTeam (int t) |
Set Entity's team. | |
bool | isActive () const |
Check if Entity is active. | |
void | kill () |
Sets health to zero and deactives the Entity. | |
void | deactivate () |
Sets active to false. | |
void | activate () |
Sets active to true. | |
void | checkDisplayable (Object screen) |
Checks if an the Entity is in the current screen by passing the screen to it. | |
SDL_Rect | getDetect () const |
Returns the detection radius. | |
void | setDetect (SDL_Rect d) |
Sets the detection with another SDL_Rect. | |
void | setDetectRange (int r) |
Sets the detection radius with a single given distance. | |
void | setDetectRange (int w, int h) |
Sets the detection radius with two given distances in both directions. | |
Public Member Functions inherited from Object | |
SDL_Rect | getBuff () const |
SDL_Rect | getMovedBuff () const |
void | actGravity (bool g) |
void | setDisplayable (bool d) |
This sets if you want the Object to visible on the screen by passing in a boolean. | |
bool | isDisplayable (Object screen) |
Check if the Object is displayable by seeing if it is in a given screen. | |
void | setCoord (double x, double y) |
Set the coordinate of the Object with a given x and y. | |
void | setX (double sx) |
Set the x coordinate with a given x. | |
void | setY (double sy) |
Set the y coordinate with a given y. | |
void | move (double x, double y) |
Move along the x and y coordinate with a given x and y amount. | |
void | moveX (double mx) |
Move along the x coordinate with a given x amount. | |
void | moveY (double my) |
Move along the y coordinate with a given y amount. | |
double | getX () const |
Get the current x coordinate. | |
double | getY () const |
Get the current y coordinate. | |
Image | getImage () const |
Get the Object's Image. | |
void | setImage (Image i) |
Set the Object's Image with a given Image. | |
void | setImage (string file, SDL_Renderer *ren) |
Give the path and renderer to create the Object's Image. | |
double | getAngle () const |
Get the Object's angle. | |
void | setAngle (double a) |
Set the angle. | |
void | center (int w, int h) |
Center the Object based on a width and height. | |
SDL_Rect | getFrame () const |
Get the frame that the Object parses from the Image. | |
SDL_Rect | getDest () const |
Get the destination for the Object to be displayed on screen. | |
SDL_Rect | getPos () const |
Get the position of the Object in the world. | |
void | setFrame (SDL_Rect i) |
Set the frame with a given SDL_Rect. | |
void | setDest (SDL_Rect i) |
Set the destination with a given SDL_Rect. | |
void | setPos (SDL_Rect i) |
Set the position with a given SDL_Rect. | |
void | setFrame (int x, int y, int w, int h) |
Set the frame with a given x and y coordinate and width and height. | |
void | setFrameCoord (int x, int y) |
Set the x and y coordinate of the frame. | |
void | setFrameSize (int w, int h) |
Set the size of the frame with a width and height. | |
void | setFrameX (int x) |
Set the x coordinate of the frame. | |
void | setVelTo (Object o) |
Set the object's velocity toward another object. | |
void | lookAt (Object o) |
Set the object's angle towards another object. | |
void | setFrameY (int y) |
Set the y coordinate of the frame. | |
void | setFrameW (int w) |
void | setFrameH (int h) |
int | getFrameX () const |
int | getFrameY () const |
int | getFrameW () const |
int | getFrameH () const |
void | setDest (int x, int y, int w, int h) |
void | setDestCoord (int x, int y) |
void | setDestSize (int w, int h) |
void | setDestX (int x) |
void | setDestY (int y) |
void | setDestW (int w) |
void | setDestH (int h) |
int | getDestX () const |
int | getDestY () const |
int | getDestW () const |
int | getDestH () const |
void | setPos (int x, int y, int w, int h) |
void | setPosCoord (int x, int y) |
void | setPosSize (int w, int h) |
void | setPosX (int x) |
void | setPosY (int y) |
void | setPosW (int w) |
void | setPosH (int h) |
int | getPosX () const |
int | getPosY () const |
int | getPosW () const |
int | getPosH () const |
void | moveFrame (int x, int y) |
void | moveFrameX (int x) |
void | moveFrameY (int y) |
void | moveDest (int x, int y) |
void | moveDestX (int x) |
void | moveDestY (int y) |
void | movePos (int x, int y) |
void | movePosX (int x) |
void | movePosY (int y) |
double | getVelX () |
double | getVelY () |
void | setVelX (double vx) |
void | setVelY (double vy) |
void | setVelTo (int x, int y) |
double | getSpeed () |
void | setSpeed (double s) |
void | setName (string s) |
string | getName () |
void | centerOn (Input i) |
void | centerOn (int cx, int cy) |
void | centerOn (Object obj) |
void | lookAt (Input i) |
void | setColor (color c) |
void | setColor (Uint8 r, Uint8 g, Uint8 b) |
void | setTransparency (Uint8 a) |
bool | imageSet () const |
color | getColor () const |
void | rotateAngle (int rot) |
void | moveToVel () |
Additional Inherited Members | |
Public Attributes inherited from Object | |
color | red = {0xff,0,0,0xff} |
color | green = {0,0xff,0,0xff} |
color | blue = {0,0,0xff,0xff} |