1 #include "mof/AnimationScheduler.h"
2 #include "mof/ConsoleIO.h"
4 typedef std::multimap<mof::AnimationKey , mof::AnimationResource>::iterator MapItr;
6 mof::AnimationScheduler::AnimationScheduler(){
11 mof::AnimationScheduler::~AnimationScheduler(){
15 void mof::AnimationScheduler::update(){
17 std::pair<MapItr , MapItr> range(m_map.begin() , m_map.upper_bound(m_key));
18 for(MapItr itr = range.first ; itr != range.second ; ++itr){
19 if(itr->second.get() != NULL && !itr->second->isPlaying())itr->second->start();
25 void mof::AnimationScheduler::add(int index , mof::AnimationResource pAnimation){
26 if(pAnimation.get() != NULL)pAnimation->stop();
27 m_map.insert(std::multimap<mof::AnimationKey , mof::AnimationResource>::value_type(index , pAnimation));
31 bool mof::AnimationScheduler::isFinalized(){
32 for(MapItr itr = m_map.begin() ; itr != m_map.end() ; ++itr){
33 if(!itr->second->isFinalized())return false;
38 void mof::AnimationScheduler::clear(){