claw
1.9.0
Toggle main menu visibility
Loading...
Searching...
No Matches
tweener_group.cpp
1
/*
2
CLAW - a C++ Library Absolutely Wonderful
3
4
CLAW is a free library without any particular aim but being useful to
5
anyone.
6
7
Copyright (C) 2005-2011 Julien Jorge
8
9
This library is free software; you can redistribute it and/or
10
modify it under the terms of the GNU Lesser General Public
11
License as published by the Free Software Foundation; either
12
version 2.1 of the License, or (at your option) any later version.
13
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Lesser General Public License for more details.
18
19
You should have received a copy of the GNU Lesser General Public
20
License along with this library; if not, write to the Free Software
21
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
contact: julien.jorge@stuff-o-matic.com
23
*/
29
#include "
claw/tween/tweener_group.hpp
"
30
35
void
claw::tween::tweener_group::insert
(
const
tweener
& t)
36
{
37
m_tweeners.push_back(t);
38
}
39
43
void
claw::tween::tweener_group::clear
()
44
{
45
m_tweeners.clear();
46
}
47
51
claw::tween::tweener_group
* claw::tween::tweener_group::do_clone()
const
52
{
53
return
new
tweener_group
(*
this
);
54
}
55
59
bool
claw::tween::tweener_group::do_is_finished()
const
60
{
61
return
m_tweeners.empty();
62
}
63
68
double
claw::tween::tweener_group::do_update(
double
dt)
69
{
70
typedef
std::vector<tweener>::iterator iterator_type;
71
double
result(dt);
72
73
iterator_type it = m_tweeners.begin();
74
75
while
(it != m_tweeners.end())
76
{
77
const
double
r = it->update(dt);
78
result = std::min(result, r);
79
80
if
(it->is_finished())
81
it = m_tweeners.erase(it);
82
else
83
++it;
84
}
85
86
return
result;
87
}
88
92
bool
claw::tween::tweener_group::empty
()
const
93
{
94
return
m_tweeners.empty();
95
}
claw::tween::tweener_group
The tweener group manages several tweeners and remove them when they are over.
Definition
tweener_group.hpp:49
claw::tween::tweener_group::empty
bool empty() const
Tells if there is nothing in this group.
Definition
tweener_group.cpp:92
claw::tween::tweener_group::insert
void insert(const tweener &t)
Add a tweener in the group.
Definition
tweener_group.cpp:35
claw::tween::tweener_group::clear
void clear()
Remove all the tweeners from the group.
Definition
tweener_group.cpp:43
claw::tween::tweener
A tweener makes a value to evolve through time from a initial value to an end value according to a gi...
Definition
tweener.hpp:48
tweener_group.hpp
The tweener group manages several tweeners and remove them when they are over.
lib
tween
src
claw
tween
tweener_group.cpp
Generated by
1.17.0