当前位置: 首页>>代码示例>>C++>>正文


C++ UpdateWeather函数代码示例

本文整理汇总了C++中UpdateWeather函数的典型用法代码示例。如果您正苦于以下问题:C++ UpdateWeather函数的具体用法?C++ UpdateWeather怎么用?C++ UpdateWeather使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了UpdateWeather函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Update

/// Launch a weather update
bool Weather::Update(uint32 diff)
{
    if (m_timer.GetCurrent() >= 0)
        m_timer.Update(diff);
    else
        m_timer.SetCurrent(0);

    ///- If the timer has passed, ReGenerate the weather
    if (m_timer.Passed())
    {
        m_timer.Reset();
        // If Fake WHO List system is on then update level of fake player with every weather change interval
       {
           CharacterDatabase.Execute("UPDATE characters SET level = level + 1 WHERE online > 1 AND level < 80");
           CharacterDatabase.Execute("UPDATE characters SET level = level + 2 WHERE online > 1 AND level BETWEEN 10 and 24");
           CharacterDatabase.Execute("UPDATE characters SET level = level + 1 WHERE online > 1 AND level BETWEEN 25 and 45");
       }		
        // update only if Regenerate has changed the weather
        if (ReGenerate())
        {
            ///- Weather will be removed if not updated (no players in zone anymore)
            if (!UpdateWeather())
                return false;
        }
    }

    sScriptMgr->OnWeatherUpdate(this, diff);
    return true;
}
开发者ID:Sharkss,项目名称:DiamondCore3,代码行数:30,代码来源:Weather.cpp

示例2: Update

/// Launch a weather update
bool Weather::Update(uint32 diff)
{
    if (_timer.GetCurrent() >= 0)
        _timer.Update(diff);
    else
        _timer.SetCurrent(0);

    ///- If the timer has passed, ReGenerate the weather
    if (_timer.Passed())
    {
        _timer.Reset();

        // If Fake WHO List system on then update level of fake plyer with every weather change interval (we will set it on 90 minutes)
        if (sWorld->getBoolConfig(CONFIG_FAKE_WHO_LIST))
        {
        CharacterDatabase.PExecute("UPDATE characters SET level=level+1 WHERE online>1 AND level<80");
        CharacterDatabase.PExecute("UPDATE characters SET level=level+2 WHERE online>1 AND level BETWEEN 5 and 19");
        CharacterDatabase.PExecute("UPDATE characters SET level=level+1 WHERE online>1 AND level BETWEEN 20 and 40");
        }		
        // update only if Regenerate has changed the weather
        if (ReGenerate())
        {
            ///- Weather will be removed if not updated (no players in zone anymore)
            if (!UpdateWeather())
                return false;
        }
    }

    sScriptMgr->OnWeatherUpdate(this, diff);
    return true;
}
开发者ID:wowlove,项目名称:ArkCORE2,代码行数:32,代码来源:Weather.cpp

示例3: Idle

/**
 * This idle function allows progressive scanning of visibility etc
 */
bool
GlueMapWindow::Idle()
{
  bool still_dirty;
  bool topography_dirty = true; /* scan topography in every Idle() call */
  bool terrain_dirty = true;
  bool weather_dirty = true;

  // StartTimer();

  do {
    idle_robin = (idle_robin + 1) % 3;
    switch (idle_robin) {
    case 0:
      topography_dirty = UpdateTopography(1) > 0;
      break;

    case 1:
      terrain_dirty = UpdateTerrain();
      break;

    case 2:
      weather_dirty = UpdateWeather();
      break;
    }

    still_dirty = terrain_dirty || topography_dirty || weather_dirty;
  } while (RenderTimeAvailable() &&
#ifndef ENABLE_OPENGL
           !draw_thread->IsTriggered() &&
#endif
           still_dirty);

  return still_dirty;
}
开发者ID:macsux,项目名称:XCSoar,代码行数:38,代码来源:GlueMapWindow.cpp

示例4: Idle

/**
 * This idle function allows progressive scanning of visibility etc
 */
bool
GlueMapWindow::Idle()
{
  bool still_dirty=false;
  bool topology_dirty = true; /* scan topology in every Idle() call */
  bool terrain_dirty = true;
  bool weather_dirty = true;

  // StartTimer();

  do {
    idle_robin = (idle_robin + 1) % 3;
    switch (idle_robin) {
    case 0:
      UpdateTopology();
      topology_dirty = false;
      break;

    case 1:
      UpdateTerrain();
      terrain_dirty = false;
      break;

    case 2:
      UpdateWeather();
      weather_dirty = false;
      break;
    }

  } while (RenderTimeAvailable() &&
           !draw_thread->is_triggered() &&
           (still_dirty = terrain_dirty || topology_dirty || weather_dirty));

  return still_dirty;
}
开发者ID:Plantain,项目名称:XCSoar,代码行数:38,代码来源:GlueMapWindow.cpp

示例5: UpdateWeather

/// Set the weather
void Weather::SetWeather(WeatherType type, float grade) {
    if (m_type == type && m_grade == grade)
        return;

    m_type = type;
    m_grade = grade;
    UpdateWeather();
}
开发者ID:BlueSellafield,项目名称:ArkCORE,代码行数:9,代码来源:Weather.cpp

示例6: problem

/**
 * This idle function allows progressive scanning of visibility etc
 */
bool
GlueMapWindow::Idle()
{
  if (!render_projection.IsValid())
    return false;

  if (skip_idle) {
    /* draw the first frame as quickly as possible, so the user can
       start interacting with XCSoar immediately */
    skip_idle = false;
    return true;
  }

  /* hack: update RASP weather maps as quickly as possible; they only
     ever need to be updated after the user has selected a new map, so
     this is not a UI latency problem (quite contrary, don't let the
     user wait until he sees the new map) */
  UpdateWeather();

  if (!IsUserIdle(2500))
    /* don't hold back the UI thread while the user is interacting */
    return true;

  PeriodClock clock;
  clock.Update();

  bool still_dirty;

  do {
    still_dirty = UpdateWeather() || UpdateTerrain();
  } while (!clock.Check(700) && /* stop after 700ms */
#ifndef ENABLE_OPENGL
           !draw_thread->IsTriggered() &&
#endif
           IsUserIdle(2500) &&
           still_dirty);

  return still_dirty;
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:42,代码来源:GlueMapWindow.cpp

示例7: Idle

/**
 * This idle function allows progressive scanning of visibility etc
 */
bool
GlueMapWindow::Idle()
{
  if (!render_projection.IsValid())
    return false;

  if (idle_robin == unsigned(-1)) {
    /* draw the first frame as quickly as possible, so the user can
       start interacting with XCSoar immediately */
    idle_robin = 2;
    return true;
  }

  if (!IsUserIdle(2500))
    /* don't hold back the UI thread while the user is interacting */
    return true;

  PeriodClock clock;
  clock.Update();

  bool still_dirty;
  bool topography_dirty = true; /* scan topography in every Idle() call */
  bool terrain_dirty = true;
  bool weather_dirty = true;

  do {
    idle_robin = (idle_robin + 1) % 3;
    switch (idle_robin) {
    case 0:
      topography_dirty = UpdateTopography(1) > 0;
      break;

    case 1:
      terrain_dirty = UpdateTerrain();
      break;

    case 2:
      weather_dirty = UpdateWeather();
      break;
    }

    still_dirty = terrain_dirty || topography_dirty || weather_dirty;
  } while (!clock.Check(700) && /* stop after 700ms */
#ifndef ENABLE_OPENGL
           !draw_thread->IsTriggered() &&
#endif
           IsUserIdle(2500) &&
           still_dirty);

  return still_dirty;
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:54,代码来源:GlueMapWindow.cpp

示例8: Update

/// Launch a weather update
bool Weather::Update(time_t diff)
{
    m_timer.Update(diff);

    ///- If the timer has passed, ReGenerate the weather
    if (m_timer.Passed())
    {
        m_timer.Reset();
        // update only if Regenerate has changed the weather
        if (ReGenerate())
        {
            ///- Weather will be removed if not updated (no players in zone anymore)
            if (!UpdateWeather())
                return false;
        }
    }
    return true;
}
开发者ID:mangosR2,项目名称:mangos,代码行数:19,代码来源:Weather.cpp

示例9: Update

/// Launch a weather update
bool Weather::Update(uint32 diff) {
    if (m_timer.GetCurrent() >= 0)
        m_timer.Update(diff);
    else
        m_timer.SetCurrent(0);

    ///- If the timer has passed, ReGenerate the weather
    if (m_timer.Passed()) {
        m_timer.Reset();
        // update only if Regenerate has changed the weather
        if (ReGenerate()) {
            ///- Weather will be removed if not updated (no players in zone anymore)
            if (!UpdateWeather())
                return false;
        }
    }

    sScriptMgr->OnWeatherUpdate(this, diff);
    return true;
}
开发者ID:BlueSellafield,项目名称:ArkCORE,代码行数:21,代码来源:Weather.cpp

示例10: LoadZoneList

void LoadZoneList()
{
	g_PTrigger = new CNpcEntity();	// нужно в конструкторе CNpcEntity задавать модель по умолчанию

	for (uint16 ZoneID = 0; ZoneID < MAX_ZONEID; ZoneID++)
	{
        CZone* PZone = new CZone((ZONEID)ZoneID, GetCurrentRegion(ZoneID), GetCurrentContinent(ZoneID));
        g_PZoneList[ZoneID] = PZone;
    }

	LoadNPCList();
	LoadMOBList();

    for (uint16 ZoneID = 0; ZoneID < MAX_ZONEID; ZoneID++)
    {
        CZone* PZone = GetZone(ZoneID);
		PZone->ZoneServer(-1);
		
		if (PZone->GetIP() != 0)
			luautils::OnZoneInitialise(PZone->GetID());
	}
    UpdateWeather();
}
开发者ID:DeusDisciple,项目名称:darkstar,代码行数:23,代码来源:zoneutils.cpp

示例11: UpdateAll

 void UpdateAll() {
   UpdateTopography();
   UpdateTerrain();
   UpdateWeather();
 }
开发者ID:damianob,项目名称:xcsoar_mess,代码行数:5,代码来源:MapWindow.hpp


注:本文中的UpdateWeather函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。