void MonsterManager::OnMouseMove(POINT ptMap, POINT mousePt) { map<UINT,Monster*>::iterator itBegin = m_objMap.begin(); map<UINT,Monster*>::iterator itEnd = m_objMap.end(); while (itBegin != itEnd) { Monster* pMon = itBegin->second; pMon->OnMouseMove(ptMap, mousePt); ++itBegin; } }
Monster* MonsterManager::FindSelectMonster(POINT ptMap, POINT mousePt) { map<UINT,Monster*>::iterator itBegin = m_objMap.begin(); map<UINT,Monster*>::iterator itEnd = m_objMap.end(); while (itBegin != itEnd) { Monster* pMon = itBegin->second; bool success = pMon->OnMouseMove(ptMap, mousePt); if (success) return pMon; ++itBegin; } return NULL; }