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

Creates a BotB object that inherits BotAI. Creates a BotB object that inherits BotAI and contains the details for the BotA. More...

#include <botB.h>

Inheritance diagram for BotB:
Inheritance graph
Collaboration diagram for BotB:
Collaboration graph

Public Member Functions

 BotB (Texture *, Vec2, int, int, Map *)
 
 ~BotB ()
 
void playerLineOfSight (Player *, BotA *, Map *)
 
void updateMovement (Player *, Map *, float)
 
bool getFollowing ()
 
- Public Member Functions inherited from BotAI
 BotAI (Texture *, Vec2, Vec2, int, int, int, int, Map *)
 
 ~BotAI ()
 
void playerLineOfSight (Player *, Map *)
 
void drawPath (SDL_Renderer *, Vec2 target)
 
Vec2 getLastNodePosition ()
 
bool getRunning ()
 
- 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 Member Functions

void updateMoveFollow (Creature *, Map *, float)
 

Private Attributes

bool following
 
BotAbotA
 

Additional Inherited Members

- Protected Member Functions inherited from BotAI
void updateMovementVelocities (float, bool)
 
- 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 BotAI
AStaraStar
 
Vec2 moveTarget
 
Vec2 nextPosition
 
Vec2 lastNode
 
bool running
 
- 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 BotB object that inherits BotAI. Creates a BotB object that inherits BotAI and contains the details for the BotA.

Constructor & Destructor Documentation

BotB::BotB ( Texture inTexture,
Vec2  inPos,
int  w,
int  h,
Map map 
)

Constructs an BotB object

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

Destructs an BotA object

Member Function Documentation

bool BotB::getFollowing ( )

Getter # Get the value of following

Returns
bool The value of following

Here is the caller graph for this function:

void BotB::playerLineOfSight ( Player player,
BotA botA,
Map map 
)

Test if the Player is in sight and if BotA should be followed

Parameters
Player* A pointer to the Player
BotA* A pointer to the BotA
Map* A pointer to the map

Here is the call graph for this function:

Here is the caller graph for this function:

void BotB::updateMoveFollow ( Creature ,
Map ,
float   
)
private

The movements of the BotB when following

Parameters
Creature* A pointer to the creature
Map* A pointer to the map
floatThe delta time
void BotB::updateMovement ( Player player,
Map map,
float  dt 
)
virtual

Update the next movement of the BotB

Parameters
BotA* A pointer to the Player
Map* A pointer to the map
floatThe delta time

Reimplemented from BotAI.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

BotA* BotB::botA
private

A pointer to BotA

bool BotB::following
private

If the bot is following


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