RTYPE TECHNICAL DOCUMENTATION
  • Introduction
  • Classes
    • utils::InputMap
    • utils::Window
    • utils::constant::ButtonValue
    • network::Client
    • network::LockedQueue
    • network::Server
    • ecs::EnemyFactory
    • ecs::Engine
    • ecs::Entity
    • ecs::Event
    • ecs::Registry
    • ecs::SparseArray
    • ecs::World
    • ecs::WorldManager
    • ecs::component::Activable
    • ecs::component::Animated
    • ecs::component::Animated::AnimFrame
    • ecs::component::AttackAI
    • ecs::component::AttackAI::Action
    • ecs::component::AttackAI::AI
    • ecs::component::AttackAI::AI::Pattern
    • ecs::component::Controllable
    • ecs::component::Direction
    • ecs::component::Drawable
    • ecs::component::EntityType
    • ecs::component::Faction
    • ecs::component::FollowEntity
    • ecs::component::Health
    • ecs::component::Hitbox
    • ecs::component::MovementAI
    • ecs::component::MovementAI::AI
    • ecs::component::NetworkId
    • ecs::component::Parallax
    • ecs::component::Position
    • ecs::component::Projectile
    • ecs::component::Score
    • ecs::component::Shootable
    • ecs::component::Size
    • ecs::component::Text
    • ecs::component::textColor
    • ecs::component::Velocity
    • ecs::component::Weapon
    • audio::AudioManager
    • asset::AssetLoader
    • anim::Animation
  • Namespaces
    • utils
    • utils::constant
    • network
    • ecs
    • ecs::component
    • ecs::systems
    • audio
    • asset
    • anim
  • Modules
    • Input
  • Files
    • src
    • src/client
    • Animation.cpp
    • Animation.hpp
    • AssetLoader.cpp
    • AssetLoader.hpp
    • AudioManager.cpp
    • AudioManager.hpp
    • entrypoint.cpp
    • GetWorld.cpp
    • GetWorld.hpp
    • NetworkClient.cpp
    • NetworkClient.hpp
    • src/ecs
    • src/ecs/components
    • src/ecs/components/client
    • Activable.hpp
    • Animated.hpp
    • Controllable.hpp
    • Drawable.hpp
    • Hitbox.hpp
    • Parallax.hpp
    • Shootable.hpp
    • Text.hpp
    • src/ecs/components/server
    • AttackAI.cpp
    • AttackAI.hpp
    • FollowEntity.hpp
    • Projectile.hpp
    • Direction.hpp
    • EntityType.hpp
    • Faction.hpp
    • Health.hpp
    • MovementAI.cpp
    • MovementAI.hpp
    • NetworkId.hpp
    • Position.hpp
    • Score.hpp
    • Size.hpp
    • Velocity.hpp
    • Weapon.hpp
    • src/ecs/systems
    • src/ecs/systems/client
    • Animate.hpp
    • Draw.hpp
    • ExecuteOnce.hpp
    • HandleIncomingMessages.hpp
    • HandleParallaxBounds.hpp
    • HandleSFMLEvents.hpp
    • HandleSFMLKeys.hpp
    • HealthBar.hpp
    • MenuSelect.hpp
    • ScoreUpdate.hpp
    • SendDirection.hpp
    • src/ecs/systems/server
    • DeathUpdate.hpp
    • FollowEntitySystem.hpp
    • HandleIncomingMessage.hpp
    • PlayerHealthUpdate.hpp
    • PositionUpdate.hpp
    • ProjectileCollision.hpp
    • RunAttackAI.hpp
    • Waves.hpp
    • ManageClientEvents.hpp
    • Movement.hpp
    • PositionLogger.hpp
    • RunMovementAI.hpp
    • EnemyFactory.cpp
    • EnemyFactory.hpp
    • Engine.hpp
    • Entity.hpp
    • Event.hpp
    • LockedQueue.hpp
    • Registry.hpp
    • SparseArray.hpp
    • World.hpp
    • WorldManager.cpp
    • WorldManager.hpp
    • src/server
    • entrypoint.cpp
    • Server.cpp
    • Server.hpp
    • src/utils
    • Constant.hpp
    • InputMap.cpp
    • InputMap.hpp
    • Window.cpp
    • README.md
  • Pages
    • deprecated
  • GitHub
Powered by GitBook
On this page
  • Public Functions
  • Detailed Description
  • Public Functions Documentation
  • function ~AssetLoader
  • function LoadTexture
  • function LoadTexture
  • function LoadBGM
  • function LoadBGM
  • function LoadSFX
  • function LoadSFX
  • function LoadFont
  • function LoadFont
  • function loadKeybind
  • function smartPath
  • function GetTexture
  • function GetBGM
  • function GetSFX
  • function GetFont
  • function GetKeybind
  • function LoadIniFile
  • function getInstance
  • function smartPath
  • function smartPath
  • function display_key_from_map
  1. Classes

asset::AssetLoader

Previousaudio::AudioManagerNextanim::Animation

Last updated 2 years ago

#include <AssetLoader.hpp>

Public Functions

Name

template <class... Args> void

void

template <class... Args> void

void

template <class... Args> void

void

template <class... Args> void

void

void

std::filesystem::path

sf::Texture &

sf::Music &

sf::Sound &

sf::Font &

sf::Keyboard::Key &

void

std::filesystem::path

template <class... Args> std::filesystem::path

void

Detailed Description

class asset::AssetLoader;

This class loads all the assets neened by the game and stores them in a map Basic operatations on assets are supported An asset is either a texture, a sound or a font

Public Functions Documentation

function ~AssetLoader

~AssetLoader() =default

function LoadTexture

template <class... Args>
static inline void LoadTexture(
    const std::string & key,
    const std::filesystem::path & path,
    std::string_view next,
    Args... args
)

load an SFML asset and add it to the map

Parameters:

  • key the key to load the asset

  • path first segment of the path of the asset

  • next next segment of the path of the asset

  • args other segments of the path

function LoadTexture

static inline void LoadTexture(
    const std::string & key,
    std::vector< std::string > paths
)

function LoadBGM

template <class... Args>
static inline void LoadBGM(
    const std::string & key,
    const std::filesystem::path & path,
    std::string_view next,
    Args... args
)

Load a background music and add it to the map.

Parameters:

  • key the key to load the asset

  • path first segment of the path of the asset

  • next next segment of the path of the asset

  • args other segments of the path

Template Parameters:

  • Args Path segments

function LoadBGM

static inline void LoadBGM(
    const std::string & key,
    std::vector< std::string > paths
)

function LoadSFX

template <class... Args>
static inline void LoadSFX(
    const std::string & key,
    const std::filesystem::path & path,
    std::string_view next,
    Args... args
)

Load a sound effect and add it to the map.

Parameters:

  • key the key to load the asset

  • path first segment of the path of the asset

  • next next segment of the path of the asset

  • args other segments of the path

Template Parameters:

  • Args Path segments

function LoadSFX

static inline void LoadSFX(
    const std::string & key,
    std::vector< std::string > paths
)

function LoadFont

template <class... Args>
static inline void LoadFont(
    const std::string & key,
    const std::filesystem::path & path,
    std::string_view next,
    Args... args
)

load a font and add it to the map

Parameters:

  • key the key to load the font

  • path first segment of the path of the font

  • next next segment of the path of the font

  • args other segments of the path

function LoadFont

static inline void LoadFont(
    const std::string & key,
    std::vector< std::string > paths
)

function loadKeybind

static inline void loadKeybind(
    const std::string & action,
    const std::string & key
)

function smartPath

static inline std::filesystem::path smartPath(
    std::vector< std::string > paths
)

create a smartpath from a vector of string

function GetTexture

static inline sf::Texture & GetTexture(
    const std::string & key
)

Get an Asset object from the map.

Parameters:

  • key of the asset to get

Return: sf::Texture& the texture

function GetBGM

static inline sf::Music & GetBGM(
    const std::string & key
)

Get a background music object from the map.

Parameters:

  • key of the asset to get

Return: sf::Music& the music

function GetSFX

static inline sf::Sound & GetSFX(
    const std::string & key
)

Get a sound effect object from the map.

Parameters:

  • key of the asset to get

Return: sf::Sound& the sound effect

function GetFont

static inline sf::Font & GetFont(
    const std::string & key
)

Get a font object from the mapb.

Parameters:

  • key of the asset to get

Return: sf::Font& the font

function GetKeybind

static inline sf::Keyboard::Key & GetKeybind(
    const std::string & key
)

function LoadIniFile

static inline void LoadIniFile(
    const std::filesystem::path & path
)

Load a .ini file with boost loading assets into the map.

function getInstance

static AssetLoader & getInstance()

function smartPath

static inline std::filesystem::path smartPath(
    std::filesystem::path path
)

function smartPath

template <class... Args>
static inline std::filesystem::path smartPath(
    std::filesystem::path path,
    std::string_view next,
    Args... args
)

function display_key_from_map

static inline void display_key_from_map()

Updated on 2022-11-13 at 17:21:37 +0100

() =default

(const std::string & key, const std::filesystem::path & path, std::string_view next, Args... args) load an SFML asset and add it to the map

(const std::string & key, std::vector< std::string > paths)

(const std::string & key, const std::filesystem::path & path, std::string_view next, Args... args) Load a background music and add it to the map.

(const std::string & key, std::vector< std::string > paths)

(const std::string & key, const std::filesystem::path & path, std::string_view next, Args... args) Load a sound effect and add it to the map.

(const std::string & key, std::vector< std::string > paths)

(const std::string & key, const std::filesystem::path & path, std::string_view next, Args... args) load a font and add it to the map

(const std::string & key, std::vector< std::string > paths)

(const std::string & action, const std::string & key)

(std::vector< std::string > paths) create a smartpath from a vector of string

(const std::string & key) Get an Asset object from the map.

(const std::string & key) Get a background music object from the map.

(const std::string & key) Get a sound effect object from the map.

(const std::string & key) Get a font object from the mapb.

(const std::string & key)

(const std::filesystem::path & path) Load a .ini file with boost loading assets into the map.

&

()

(std::filesystem::path path)

(std::filesystem::path path, std::string_view next, Args... args)

()

Destroy the object

the instance of the object

AssetLoader
AssetLoader
More...
~AssetLoader
LoadTexture
LoadTexture
LoadBGM
LoadBGM
LoadSFX
LoadSFX
LoadFont
LoadFont
loadKeybind
smartPath
GetTexture
GetBGM
GetSFX
GetFont
GetKeybind
LoadIniFile
AssetLoader
getInstance
smartPath
smartPath
display_key_from_map