mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 05:15:10 +00:00
46 lines
911 B
C++
46 lines
911 B
C++
/*
|
|
** 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;
|
|
} |