mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 05:15:10 +00:00
creation of animation containers
This commit is contained in:
46
lib/Ray/sources/Model/ModelAnimation.cpp
Normal file
46
lib/Ray/sources/Model/ModelAnimation.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
** EPITECH PROJECT, 2021
|
||||
** Bomberman
|
||||
** File description:
|
||||
** ModelAnimation
|
||||
*/
|
||||
|
||||
#include "Model/ModelAnimation.hpp"
|
||||
|
||||
RAY::ModelAnimation::ModelAnimation(::ModelAnimation &animation):
|
||||
_animation(animation), _frameCounter(0)
|
||||
{
|
||||
}
|
||||
|
||||
size_t RAY::ModelAnimation::getFrameCounter() const
|
||||
{
|
||||
return this->_frameCounter;
|
||||
}
|
||||
|
||||
size_t RAY::ModelAnimation::getFrameCount() const
|
||||
{
|
||||
return this->_animation.frameCount;
|
||||
}
|
||||
|
||||
RAY::ModelAnimation &RAY::ModelAnimation::setFrameCounter(size_t frameCounter)
|
||||
{
|
||||
this->_frameCounter = frameCounter % this->_animation.frameCount;
|
||||
return *this;
|
||||
}
|
||||
|
||||
RAY::ModelAnimation &RAY::ModelAnimation::incrementFrameCounter()
|
||||
{
|
||||
this->_frameCounter = (this->_frameCounter + 1) % this->_animation.frameCount;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
RAY::ModelAnimation::operator ::ModelAnimation() const
|
||||
{
|
||||
return this->_animation;
|
||||
}
|
||||
|
||||
RAY::ModelAnimation::operator ::ModelAnimation *()
|
||||
{
|
||||
return &this->_animation;
|
||||
}
|
||||
Reference in New Issue
Block a user