2016-04-13 06:07:23 +00:00
|
|
|
#ifndef __URDE_CCHARANIMTIME_HPP__
|
|
|
|
#define __URDE_CCHARANIMTIME_HPP__
|
2015-08-18 05:54:43 +00:00
|
|
|
|
2016-04-11 07:10:28 +00:00
|
|
|
#include "IOStreams.hpp"
|
2016-04-11 03:59:54 +00:00
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2015-08-18 05:54:43 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
class CCharAnimTime
|
|
|
|
{
|
2016-02-27 06:03:39 +00:00
|
|
|
float m_time = 0.f;
|
2016-04-11 03:59:54 +00:00
|
|
|
enum class Type
|
|
|
|
{
|
|
|
|
NonZero,
|
|
|
|
ZeroIncreasing,
|
|
|
|
ZeroSteady,
|
|
|
|
ZeroDecreasing,
|
|
|
|
Infinity
|
|
|
|
} m_type = Type::ZeroSteady;
|
2016-01-05 00:48:10 +00:00
|
|
|
public:
|
2016-02-27 06:03:39 +00:00
|
|
|
CCharAnimTime() = default;
|
2016-04-11 07:10:28 +00:00
|
|
|
CCharAnimTime(CInputStream& in)
|
|
|
|
: m_time(in.readFloatBig()),
|
|
|
|
m_type(Type(in.readUint32Big())) {}
|
2016-01-05 00:48:10 +00:00
|
|
|
CCharAnimTime(float time)
|
|
|
|
: m_time(time),
|
2016-04-11 03:59:54 +00:00
|
|
|
m_type(m_time != 0.f ? Type::NonZero : Type::ZeroSteady) {}
|
|
|
|
|
|
|
|
static CCharAnimTime Infinity();
|
|
|
|
operator float() const {return m_time;}
|
|
|
|
|
|
|
|
bool EqualsZero() const;
|
2016-08-21 20:39:18 +00:00
|
|
|
bool EpsilonZero() const;
|
2016-04-11 03:59:54 +00:00
|
|
|
bool GreaterThanZero() const;
|
|
|
|
bool operator ==(const CCharAnimTime& other) const;
|
|
|
|
bool operator !=(const CCharAnimTime& other) const;
|
|
|
|
bool operator>=(const CCharAnimTime& other);
|
|
|
|
bool operator<=(const CCharAnimTime& other);
|
|
|
|
bool operator >(const CCharAnimTime& other) const;
|
|
|
|
bool operator <(const CCharAnimTime& other) const;
|
|
|
|
CCharAnimTime& operator*=(const CCharAnimTime& other);
|
|
|
|
CCharAnimTime& operator+=(const CCharAnimTime& other);
|
|
|
|
CCharAnimTime operator+(const CCharAnimTime& other);
|
|
|
|
CCharAnimTime& operator-=(const CCharAnimTime& other);
|
|
|
|
CCharAnimTime operator-(const CCharAnimTime& other);
|
|
|
|
CCharAnimTime operator*(const CCharAnimTime& other);
|
|
|
|
CCharAnimTime operator*(const float& other);
|
|
|
|
float operator/(const CCharAnimTime& other);
|
2016-01-05 00:48:10 +00:00
|
|
|
};
|
2015-08-18 05:54:43 +00:00
|
|
|
}
|
|
|
|
|
2016-04-13 06:07:23 +00:00
|
|
|
#endif // __URDE_CCHARANIMTIME_HPP__
|