persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
UIAnimationHandle.hpp
Go to the documentation of this file.
1
6
7
#pragma once
8
9
#include "
uiAnimation/UIAnimation.hpp
"
10
11
#include <memory>
12
16
class
UIAnimationHandle
17
{
18
public
:
19
UIAnimationHandle
() =
default
;
20
21
explicit
UIAnimationHandle
(std::shared_ptr<UIAnimation> ptr) :
anim
(ptr)
22
{
23
}
24
25
void
cancel
()
26
{
27
if
(
auto
a =
anim
.lock())
28
{
29
a->cancel();
30
}
31
}
32
33
void
pause
()
34
{
35
if
(
auto
a =
anim
.lock())
36
{
37
a->pause();
38
}
39
}
40
41
void
resume
()
42
{
43
if
(
auto
a =
anim
.lock())
44
{
45
a->resume();
46
}
47
}
48
49
void
reverse
()
50
{
51
if
(
auto
a =
anim
.lock())
52
{
53
a->reverse();
54
}
55
}
56
57
bool
isValid
()
const
58
{
59
return
!
anim
.expired();
60
}
61
62
bool
isPlaying
()
const
63
{
64
auto
a =
anim
.lock();
65
return
a && !a->isCancelled() && !a->isPaused() && !a->isDone();
66
}
67
68
private
:
69
std::weak_ptr<UIAnimation>
anim
;
70
};
UIAnimation.hpp
Base class for one UI animation step (property, delay, callback, sequence).
UIAnimationHandle::UIAnimationHandle
UIAnimationHandle()=default
UIAnimationHandle::pause
void pause()
Definition
UIAnimationHandle.hpp:33
UIAnimationHandle::reverse
void reverse()
Definition
UIAnimationHandle.hpp:49
UIAnimationHandle::isPlaying
bool isPlaying() const
Definition
UIAnimationHandle.hpp:62
UIAnimationHandle::UIAnimationHandle
UIAnimationHandle(std::shared_ptr< UIAnimation > ptr)
Definition
UIAnimationHandle.hpp:21
UIAnimationHandle::resume
void resume()
Definition
UIAnimationHandle.hpp:41
UIAnimationHandle::cancel
void cancel()
Definition
UIAnimationHandle.hpp:25
UIAnimationHandle::anim
std::weak_ptr< UIAnimation > anim
Definition
UIAnimationHandle.hpp:69
UIAnimationHandle::isValid
bool isValid() const
Definition
UIAnimationHandle.hpp:57
source
uiAnimation
UIAnimationHandle.hpp
Generated by
1.15.0