1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
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.
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/>.
22 #include "game_share/time_weather_season/time_and_season.h"
29 /** This serves as a callback to enumerate ig in various places .
30 * (loaded igs of the landscape, igs of villages
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 :
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
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
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
);
73 typedef std::vector
<IIGObserver
*> TObservers
;
74 TObservers _Observers
;