Jamie Slowgrove - AI Assignment 1
Line of Sight & A* path-finding
 All Classes Namespaces Files Functions Variables
Public Member Functions | Private Attributes | List of all members
Player Class Reference

Creates a Player object that inherits Creature. Creates a Player object that inherits Creature and contains the details for the Player. More...

#include <player.h>

Inheritance diagram for Player:
Inheritance graph
Collaboration diagram for Player:
Collaboration graph

Public Member Functions

 Player (Texture *, Vec2, int, int)
 
 ~Player ()
 
void commandUp (bool)
 
void commandDown (bool)
 
void commandLeft (bool)
 
void commandRight (bool)
 
void handleCommands ()
 
- Public Member Functions inherited from Creature
 Creature (Texture *, Vec2, Vec2, int, int, int, int)
 
 ~Creature ()
 
void updatePosition (float)
 
void setVelocities (Vec2)
 
Vec2 getVelocities ()
 
void displayTiles (SDL_Renderer *, Map *)
 
void collisionUpdate (Map *, float)
 
void collisionUpdate (Entity *, float)
 
- Public Member Functions inherited from Entity
 Entity (Texture *, Vec2, Vec2, int, int, int, int)
 
 ~Entity ()
 
void display (SDL_Renderer *)
 
void setPosition (Vec2)
 
Vec2 getPosition ()
 
int getWidth ()
 
int getHeight ()
 

Private Attributes

bool up
 
bool down
 
bool left
 
bool right
 

Additional Inherited Members

- Protected Member Functions inherited from Creature
float collision (Map *, float, float, float, int, int, int, int, char)
 
void displayCollisionTest (SDL_Renderer *, Map *, int, int, int, int)
 
- Protected Attributes inherited from Creature
Vec2 velocities
 
int minX
 
int maxX
 
int minY
 
int maxY
 
- Protected Attributes inherited from Entity
Vec2 position
 
Vec2 source
 
int spriteWidth
 
int spriteHeight
 
int width
 
int height
 
Texturetexture
 

Detailed Description

Creates a Player object that inherits Creature. Creates a Player object that inherits Creature and contains the details for the Player.

Constructor & Destructor Documentation

Player::Player ( Texture inTexture,
Vec2  inPos,
int  w,
int  h 
)

Constructs a Player object

Parameters
Texture* a pointer to the Texture
Vec2the position of the Player
intthe width of the Player
intthe height of the Player
Player::~Player ( )

Destructs the Player object

Member Function Documentation

void Player::commandDown ( bool  command)

Setter # Input command - Down

Parameters
boolThe new state of the command

Here is the caller graph for this function:

void Player::commandLeft ( bool  command)

Setter # Input command - Left

Parameters
boolThe new state of the command

Here is the caller graph for this function:

void Player::commandRight ( bool  command)

Setter # Input command - Right

Parameters
boolThe new state of the command

Here is the caller graph for this function:

void Player::commandUp ( bool  command)

Setter # Input command - Up

Parameters
boolThe new state of the command

Here is the caller graph for this function:

void Player::handleCommands ( )

Handle the current set of commands

Here is the caller graph for this function:

Member Data Documentation

bool Player::down
private
bool Player::left
private
bool Player::right
private
bool Player::up
private

Input commands


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