20 template <> ControllerManager* Singleton<ControllerManager>::msInstance =
nullptr;
21 template <>
const char* Singleton<ControllerManager>::mClassTypeName =
"ControllerManager";
25 mCategoryName(
"Controller")
57 mIsInitialise =
false;
60 void ControllerManager::clear()
62 for (ListControllerItem::iterator iter = mListItem.begin(); iter != mListItem.end(); ++iter)
64 delete (*iter).second;
78 if (mListItem.empty())
84 for (ListControllerItem::iterator iter = mListItem.begin(); iter != mListItem.end(); ++iter)
87 if ((*iter).first == _widget)
89 if ((*iter).second->getTypeName() == _item->
getTypeName())
91 delete (*iter).second;
92 (*iter).second = _item;
99 mListItem.push_back(PairControllerItem(_widget, _item));
105 for (ListControllerItem::iterator iter = mListItem.begin(); iter != mListItem.end(); ++iter)
107 if ((*iter).first == _widget) (*iter).first =
nullptr;
111 void ControllerManager::_unlinkWidget(
Widget* _widget)
116 void ControllerManager::frameEntered(
float _time)
118 for (ListControllerItem::iterator iter = mListItem.begin(); iter != mListItem.end(); )
120 if (
nullptr == (*iter).first)
122 delete (*iter).second;
124 iter = mListItem.erase(iter);
128 if ((*iter).second->addTime((*iter).first, _time))
135 (*iter).first =
nullptr;
138 if (mListItem.empty())
144 return mCategoryName;