Flock You!
 All Classes Files Functions Variables
Public Member Functions | Private Attributes | List of all members
Boid Class Reference

Creates an Boid object Creates an Boid object that is to be used for each Boid. More...

#include <boid.h>

Collaboration diagram for Boid:
Collaboration graph

Public Member Functions

 Boid (Texture *, Vec2, Vec2)
 
 ~Boid ()
 
void setPosition (Vec2)
 
Vec2 getPosition ()
 
void setScale (Vec2)
 
Vec2 getScale ()
 
void setVelocity (Vec2)
 
Vec2 getVelocity ()
 
void display (SDL_Renderer *)
 

Private Attributes

Texturetexture
 
Vec2 position
 
Vec2 scale
 
Vec2 velocity
 

Detailed Description

Creates an Boid object Creates an Boid object that is to be used for each Boid.

Constructor & Destructor Documentation

Boid::Boid ( Texture inTexture,
Vec2  inPosition,
Vec2  inScale 
)

Constructs an Boid object

Parameters
Texture* a pointer to the Texture
Vec2the initial Boid position
Vec2the Boid scale
Boid::~Boid ( )

Destructs an Boid object

Member Function Documentation

void Boid::display ( SDL_Renderer *  renderer)

Displays the Boid

Parameters
SDL_Renderer* a pointer to the renderer

Here is the call graph for this function:

Vec2 Boid::getPosition ( )

Getter # gets the position

Returns
Vec2 the position
Vec2 Boid::getScale ( )

Getter # gets the scale

Returns
Vec2 the scale
Vec2 Boid::getVelocity ( )

Getter # gets the velocity

Returns
Vec2 the velocity
void Boid::setPosition ( Vec2  inPosition)

Setter # sets the position

Parameters
Vec2the new position
void Boid::setScale ( Vec2  inScale)

Setter # sets the scale

Parameters
Vec2the new scale
void Boid::setVelocity ( Vec2  inVelocity)

Setter # sets the velocity

Parameters
Vec2the new velocity

Member Data Documentation

Vec2 Boid::position
private
Vec2 Boid::scale
private
Texture* Boid::texture
private
Vec2 Boid::velocity
private

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