Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / client / src / ig_enum.cpp
blob1b331b7534f4fbd6c1bcce0d1a5476a6d674e513
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include "stdpch.h"
22 #include "continent_manager.h"
23 #include "continent.h"
24 #include "ig_callback.h"
25 #include "pacs_client.h"
26 #include "continent_manager.h"
27 #include "world_database_manager.h"
29 #include "ig_enum.h"
31 //===========================================================
32 bool enumAllIGs(IIGEnum *callback)
34 nlassert(callback);
35 if (IGCallbacks)
37 if (!IGCallbacks->enumIGs(callback))
38 return false;
41 if ((ContinentMngr.cur() == 0) || !ContinentMngr.cur()->enumIGs(callback))
42 return false;
43 return true;
46 // ***************************************************************************
47 // CIGAddedNotifier
48 // ***************************************************************************
50 //===========================================================
51 void CIGNotifier::registerObserver(IIGObserver *obs)
53 nlassert(obs);
54 _Observers.push_back(obs);
57 //===========================================================
58 void CIGNotifier::removeObserver(IIGObserver *obs)
60 _Observers.erase(std::remove(_Observers.begin(), _Observers.end(), obs), _Observers.end());
63 //===========================================================
64 bool CIGNotifier::isObserver(IIGObserver *obs) const
66 TObservers::const_iterator it = std::find(_Observers.begin(), _Observers.end(), obs);
67 return it != _Observers.end();
71 //===========================================================
72 void CIGNotifier::notifyIGLoaded(NL3D::UInstanceGroup *ig)
74 for(TObservers::iterator it = _Observers.begin(); it != _Observers.end(); ++it)
76 (*it)->instanceGroupLoaded(ig);
80 //===========================================================
81 void CIGNotifier::notifyIGAdded(NL3D::UInstanceGroup *ig)
83 for(TObservers::iterator it = _Observers.begin(); it != _Observers.end(); ++it)
85 (*it)->instanceGroupAdded(ig);
89 //===========================================================
90 void CIGNotifier::notifyIGRemoved(NL3D::UInstanceGroup *ig)
92 for(TObservers::iterator it = _Observers.begin(); it != _Observers.end(); ++it)
94 (*it)->instanceGroupRemoved(ig);