Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / client / src / ig_enum.h
blobb906e88da9a0ed50c450b93554836c629071c34a
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/>.
19 #ifndef CL_IG_ENUM_H
20 #define CL_IG_ENUM_H
22 #include "game_share/time_weather_season/time_and_season.h"
24 namespace NL3D
26 class UInstanceGroup;
29 /** This serves as a callback to enumerate ig in various places .
30 * (loaded igs of the landscape, igs of villages
32 struct IIGEnum
34 /** Called by the enumerator for each ig of interest
35 * \return true if the enumeration must continue
37 virtual bool enumIG(NL3D::UInstanceGroup *ig) = 0;
41 /** Tool fct : this enum all instanciated (added to the main scene) igs of the following categories :
42 * - Zone igs
43 * - ZC igs
44 * - continents igs (villages)
45 * \return false if the enumeration has been stopped
47 bool enumAllIGs(IIGEnum *callaback);
49 /** A callback to know when an ig has been added.
50 * (such callbacks are managed bu UInstanceGroup, but it doesn't tells which ig has been instanciated
52 struct IIGObserver
54 virtual void instanceGroupLoaded(NL3D::UInstanceGroup *ig) = 0;
55 virtual void instanceGroupAdded(NL3D::UInstanceGroup *ig) = 0;
56 virtual void instanceGroupRemoved(NL3D::UInstanceGroup *ig) = 0;
59 /** An helper class to register 'IIGAdded' observers
61 class CIGNotifier
63 public:
64 void registerObserver(IIGObserver *obs);
65 void removeObserver(IIGObserver *obs);
66 bool isObserver(IIGObserver *obs) const;
68 void notifyIGLoaded(NL3D::UInstanceGroup *ig);
69 void notifyIGAdded(NL3D::UInstanceGroup *ig);
70 void notifyIGRemoved(NL3D::UInstanceGroup *ig);
71 ///////////////////
72 private:
73 typedef std::vector<IIGObserver *> TObservers;
74 TObservers _Observers;
77 #endif