Beispiel #1
0
/// Add a Weather object to the list
Weather* WeatherMgr::AddWeather(uint32 zone_id) {
    WeatherData const* weatherChances = GetWeatherChances(zone_id);

    // zone not have weather, ignore
    if (!weatherChances)
        return NULL;

    Weather* w = new Weather(zone_id, weatherChances);
    m_weathers[w->GetZone()] = w;
    w->ReGenerate();
    w->UpdateWeather();
    return w;
}
/// Add a Weather object to the list
Weather* AddWeather(uint32 zone_id)
{
    WeatherData const* weatherChances = GetWeatherData(zone_id);

    // zone does not have weather, ignore
    if (!weatherChances)
        return nullptr;

    Weather* w = new Weather(zone_id, weatherChances);
    m_weathers[w->GetZone()].reset(w);
    w->ReGenerate();
    w->UpdateWeather();

    return w;
}