Pacman Torben Petré
Loading...
Searching...
No Matches
AssetManager Class Reference

#include <AssetManager.h>

Public Member Functions

 AssetManager (AssetManager &other)=delete
void operator= (const AssetManager &)=delete
sf::Font & getFont ()
 Returns the font used throughout the project.
sf::Texture & getPacmanLogo ()
 Returns the Pacman logo.
sf::Texture & getSpriteSheet ()
 Returns the Spritesheet.
void toggleEasterEgg (bool toggle)
 Toggle whether the regular or the easteregg spritesheet is used.
sf::SoundBuffer & getSoundBuffer (const std::string &name)
 Returns the sf::SoundBuffer of the file with the provided name.

Static Public Member Functions

static AssetManagergetInstance ()
 Returns an instance of the AssetManager class.

Constructor & Destructor Documentation

◆ AssetManager()

AssetManager::AssetManager ( AssetManager & other)
delete

Singletons should not be cloneable or assignable.

Member Function Documentation

◆ getFont()

sf::Font & AssetManager::getFont ( )
nodiscard

Returns the font used throughout the project.

Returns
sf::Font

◆ getInstance()

AssetManager & AssetManager::getInstance ( )
staticnodiscard

Returns an instance of the AssetManager class.

Returns
AssetManager instance

◆ getPacmanLogo()

sf::Texture & AssetManager::getPacmanLogo ( )
nodiscard

Returns the Pacman logo.

Returns
Pacman logo

◆ getSoundBuffer()

sf::SoundBuffer & AssetManager::getSoundBuffer ( const std::string & name)
nodiscard

Returns the sf::SoundBuffer of the file with the provided name.

Will return a cached sf::SoundBuffer if this exists, otherwise it will load and extract it from the file (save it to a cache) and return.

Parameters
nameSound file name.
Returns
sf::SoundBuffer

◆ getSpriteSheet()

sf::Texture & AssetManager::getSpriteSheet ( )
nodiscard

Returns the Spritesheet.

Returns
Spritesheet

◆ operator=()

void AssetManager::operator= ( const AssetManager & )
delete

◆ toggleEasterEgg()

void AssetManager::toggleEasterEgg ( bool toggle)

Toggle whether the regular or the easteregg spritesheet is used.

Parameters
toggleOn or off

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