CS4850 Final Project
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Scene Struct Reference

Scene class that represents a scene in the game. More...

#include <Scene.hpp>

Public Member Functions

 Scene (int width, int height)
 Construct a new Scene object with the given width and height.
 
 Scene (const Scene &scene)
 Construct a new Scene object from an existing scene.
 
void StartUp (SDL_Renderer *renderer)
 Start up the scene. OnStart is called here.
 
void Shutdown ()
 Shutdown the scene.
 
void Input (float deltaTime)
 Handle input.
 
void Update (float deltaTime)
 Update the game state.
 
void Render ()
 Render the game.
 
void SetSceneActive (bool active)
 Set the scene to be active or inactive.
 
bool IsSceneActive () const
 Check if the scene is active.
 
void AddGameEntity (std::shared_ptr< GameEntity > entity)
 Add a game entity to the scene.
 
std::vector< std::shared_ptr< GameEntity > > GetEntities ()
 Get the entities in the scene.
 
void SetBackgroundColor (std::string color)
 Set the background color of the scene.
 
void SetBackgroundTexture (std::string filepath)
 
void ClearBackgroundTexture ()
 
int GetWidth () const
 Get the width of the scene.
 
int GetHeight () const
 Get the height of the scene.
 
SDL_Renderer * GetRenderer () const
 

Detailed Description

Scene class that represents a scene in the game.

Constructor & Destructor Documentation

◆ Scene() [1/2]

Scene::Scene ( int width,
int height )

Construct a new Scene object with the given width and height.

Parameters
widthThe width of the scene
heightThe height of the scene

◆ Scene() [2/2]

Scene::Scene ( const Scene & scene)

Construct a new Scene object from an existing scene.

Parameters
sceneThe scene to copy

Member Function Documentation

◆ AddGameEntity()

void Scene::AddGameEntity ( std::shared_ptr< GameEntity > entity)

Add a game entity to the scene.

Parameters
entityGame entity to add

◆ GetEntities()

std::vector< std::shared_ptr< GameEntity > > Scene::GetEntities ( )
inline

Get the entities in the scene.

Returns
std::vector<std::shared_ptr<GameEntity>>

◆ GetHeight()

int Scene::GetHeight ( ) const
inline

Get the height of the scene.

Returns
int The height of the scene

◆ GetWidth()

int Scene::GetWidth ( ) const
inline

Get the width of the scene.

Returns
int The width of the scene

◆ Input()

void Scene::Input ( float deltaTime)

Handle input.

Parameters
deltaTimeTime since last frame

◆ IsSceneActive()

bool Scene::IsSceneActive ( ) const

Check if the scene is active.

Returns
true
false

◆ SetBackgroundColor()

void Scene::SetBackgroundColor ( std::string color)

Set the background color of the scene.

Parameters
colorColor of the background

◆ SetSceneActive()

void Scene::SetSceneActive ( bool active)

Set the scene to be active or inactive.

Parameters
activeTrue if the scene should be active, false otherwise

◆ StartUp()

void Scene::StartUp ( SDL_Renderer * renderer)

Start up the scene. OnStart is called here.

Parameters
rendererSDL renderer

◆ Update()

void Scene::Update ( float deltaTime)

Update the game state.

Parameters
deltaTimeTime since last frame

The documentation for this struct was generated from the following file: