1 #include "mof/GraphicsSchedule.h"
2 #include "mof/ConsoleIO.h"
8 mof::GraphicsSchedule::GraphicsSchedule(){
13 mof::GraphicsSchedule::~GraphicsSchedule(){
17 void mof::GraphicsSchedule::update(){
19 std::pair<MapItr , MapItr> range = m_map.equal_range(m_key);
20 for(MapItr itr = range.first ; itr != range.second ; ++itr){
21 if((*itr).second.pAnimation.get() != NULL){
22 (*itr).second.pObject->setAnimation(0 , (*itr).second.pAnimation);
23 (*itr).second.pAnimation->start();
30 void mof::GraphicsSchedule::add(int index , mof::GraphicsModelPtr& pObject , mof::AnimationResource& pAnimation){
31 if(pObject.get() == NULL)return;
32 if(pAnimation.get() != NULL)pAnimation->stop();
33 mof::GraphicsSchedule::Element element = {pObject , pAnimation };
34 m_modelList.push_back(pObject);
35 m_map.insert(std::multimap<mof::AnimationKey , mof::GraphicsSchedule::Element>::value_type(index , element));
38 std::list<mof::GraphicsModelPtr>& mof::GraphicsSchedule::appendModelList( std::list<mof::GraphicsModelPtr>& modelList){
39 modelList.insert(modelList.end() , m_modelList.begin() , m_modelList.end());
46 bool mof::GraphicsSchedule::isFinalized(){
47 if(m_map.size() == 0)return true;
48 for(MapItr itr = m_map.begin() ; itr != m_map.end() ; ++itr){
49 if(!itr->second.pAnimation->isFinalized() )return false;
55 bool mof::GraphicsSchedule::isPlaying(){
56 for(MapItr itr = m_map.begin() ; itr != m_map.end() ; ++itr){
57 if(itr->second.pAnimation->isPlaying() || itr->second.pAnimation->isFinalized())return true;
63 void mof::GraphicsSchedule::clear(){