mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-04 02:36:31 +00:00
file-based object now inherits from IRessource
This commit is contained in:
@@ -8,20 +8,20 @@
|
||||
#ifndef AUDIO_HPP_
|
||||
#define AUDIO_HPP_
|
||||
|
||||
#include "IRessource.hpp"
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace RAY::Audio
|
||||
{
|
||||
class IAudio {
|
||||
class IAudio: public IRessource {
|
||||
public:
|
||||
virtual ~IAudio() = 0;
|
||||
|
||||
//! @brief Load Audio stream from file
|
||||
IAudio &load(const std::string &path);
|
||||
bool load(const std::string &path);
|
||||
|
||||
//! @brief Unload audio stream
|
||||
IAudio &unload(void);
|
||||
bool unload(void);
|
||||
|
||||
//! @brief Check if audio is playing
|
||||
bool isPlayin(void);
|
||||
|
||||
@@ -34,10 +34,10 @@ namespace RAY::Music
|
||||
Music &operator=(const Music &Music) = default;
|
||||
|
||||
//! @brief Load Music stream from file
|
||||
Music &load(const std::string &path);
|
||||
bool load(const std::string &path);
|
||||
|
||||
//! @brief Unload Music stream
|
||||
Music &unload(void);
|
||||
bool unload(void);
|
||||
|
||||
//! @brief Check if Music is playing
|
||||
bool isPlayin(void);
|
||||
|
||||
@@ -34,10 +34,10 @@ namespace RAY::Sound
|
||||
Sound &operator=(const Sound &sound) = default;
|
||||
|
||||
//! @brief Load Sound stream from file
|
||||
Sound &load(const std::string &path);
|
||||
bool load(const std::string &path);
|
||||
|
||||
//! @brief Unload Sound stream
|
||||
Sound &unload(void);
|
||||
bool unload(void);
|
||||
|
||||
//! @brief Check if Sound is playing
|
||||
bool isPlayin(void);
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
#include <raylib.h>
|
||||
#include <string>
|
||||
#include "Canvas.hpp"
|
||||
#include "IRessource.hpp"
|
||||
|
||||
namespace RAY
|
||||
{
|
||||
class Image: public Canvas {
|
||||
class Image: public Canvas, IRessource {
|
||||
public:
|
||||
//! @brief Create an image, loading a file
|
||||
//! @param filename: path to file to load
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
#include <raylib.h>
|
||||
#include <string>
|
||||
#include "Canvas.hpp"
|
||||
#include "IRessource.hpp"
|
||||
|
||||
namespace RAY
|
||||
{
|
||||
class Texture: public Canvas {
|
||||
class Texture: public Canvas, IRessource {
|
||||
public:
|
||||
//! @brief Create an texture, loading a file
|
||||
//! @param filename: path to file to load
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
#define FONT_HPP_
|
||||
|
||||
#include <raylib.h>
|
||||
#include <string>
|
||||
#include "IRessource.hpp"
|
||||
|
||||
namespace RAY
|
||||
{
|
||||
class Font {
|
||||
class Font: public IRessource {
|
||||
public:
|
||||
//! @brief Create an font, loading a file
|
||||
//! @param filename: path to file to load
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
** EPITECH PROJECT, 2021
|
||||
** Bomberman
|
||||
** File description:
|
||||
** Ressource
|
||||
*/
|
||||
|
||||
#ifndef RESSOURCE_HPP_
|
||||
#define RESSOURCE_HPP_
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace RAY {
|
||||
class IRessource {
|
||||
public:
|
||||
virtual ~IRessource() = 0;
|
||||
|
||||
virtual bool load(const std::string &filePath) = 0;
|
||||
|
||||
virtual bool unload() = 0;
|
||||
};
|
||||
};
|
||||
|
||||
#endif /* !RESSOURCE_HPP_ */
|
||||
Reference in New Issue
Block a user