file-based object now inherits from IRessource

This commit is contained in:
arthur.jamet
2021-05-17 09:08:46 +02:00
parent 322ca4d710
commit 24c18df8e5
7 changed files with 38 additions and 12 deletions
+4 -4
View File
@@ -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);
+2 -2
View File
@@ -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);
+2 -2
View File
@@ -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);
+2 -1
View File
@@ -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
+2 -1
View File
@@ -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
+2 -2
View File
@@ -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
+24
View File
@@ -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_ */