Bomberman
ModelAnimations.hpp
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, 2021
3 ** Bomberman
4 ** File description:
5 ** ModelAnimations
6 */
7 
8 #ifndef MODELANIMATIONS_HPP_
9 #define MODELANIMATIONS_HPP_
10 
11 #include "Model/ModelAnimation.hpp"
12 #include <vector>
13 #include <string>
14 #include "Utils/Cache.hpp"
15 
16 namespace RAY {
19  public:
22  explicit ModelAnimations(const std::string &filePath);
23 
25  ModelAnimations(const ModelAnimations &) = default;
26 
28  ~ModelAnimations() = default;
29 
31  ModelAnimations &operator=(const ModelAnimations &) = default;
32 
34  ModelAnimation &operator[](int index);
35 
37  const ModelAnimation &operator[](int index) const;
38 
40  const ModelAnimation &at(int index) const;
41 
43  ModelAnimation &at(int index);
44 
46  size_t getAnimationsCount() const;
47 
49  std::string getFilePath() const;
50 
51  private:
53  std::shared_ptr<::ModelAnimation> _animationsPtr;
54 
56  std::vector<ModelAnimation> _animations;
57 
60 
62  std::string _filePath;
63 
65  };
66 }
67 
68 #endif /* !MODELANIMATIONS_HPP_ */
RAY::ModelAnimations::operator=
ModelAnimations & operator=(const ModelAnimations &)=default
Default assignment operator.
RAY::ModelAnimations::_filePath
std::string _filePath
The file where the animations were loaded (used to create a copy of this class)
Definition: ModelAnimations.hpp:62
Cache.hpp
RAY::ModelAnimations::_animationsPtr
std::shared_ptr<::ModelAnimation > _animationsPtr
Holds the pointer returned by the loading function.
Definition: ModelAnimations.hpp:53
RAY::ModelAnimation
A Holder for Model Animations.
Definition: ModelAnimation.hpp:16
RAY::ModelAnimations::_animationsCache
static Cache<::ModelAnimation > _animationsCache
Definition: ModelAnimations.hpp:64
ModelAnimation.hpp
RAY::ModelAnimations::_animations
std::vector< ModelAnimation > _animations
A holder for animations.
Definition: ModelAnimations.hpp:56
RAY::ModelAnimations::~ModelAnimations
~ModelAnimations()=default
Default constructor.
RAY
Definition: IAudio.hpp:12
RAY::ModelAnimations::operator[]
ModelAnimation & operator[](int index)
Castin Object to raw model animation pointer.
Definition: ModelAnimations.cpp:28
RAY::ModelAnimations::getAnimationsCount
size_t getAnimationsCount() const
Definition: ModelAnimations.cpp:33
RAY::ModelAnimations::at
const ModelAnimation & at(int index) const
std at const
Definition: ModelAnimations.cpp:43
RAY::ModelAnimations::getFilePath
std::string getFilePath() const
Get the creation file.
Definition: ModelAnimations.cpp:38
RAY::ModelAnimations
A Holder for Model Animations.
Definition: ModelAnimations.hpp:18
RAY::ModelAnimations::_animationCount
int _animationCount
the number of loaded animations
Definition: ModelAnimations.hpp:59
RAY::ModelAnimations::ModelAnimations
ModelAnimations(const std::string &filePath)
A Model animation constructor.
Definition: ModelAnimations.cpp:18
RAY::Cache<::ModelAnimation >
Definition: Cache.hpp:75