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


C++ GetStartTime函数代码示例

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


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

示例1: Update

void BattlegroundRL::Update (uint32 diff)
{
    Battleground::Update(diff);

    if (GetStatus() == STATUS_IN_PROGRESS)
    {
        if (GetStartTime() >= 47 * MINUTE * IN_MILLISECONDS)          // after 47 minutes without one team losing, the arena closes with no winner and no rating change
        {
            UpdateArenaWorldState();
            CheckArenaAfterTimerConditions();
        }
    }
}
开发者ID:814077430,项目名称:ArkCORE,代码行数:13,代码来源:BattlegroundRL.cpp

示例2: Update

void BattlegroundDS::Update(uint32 diff)
{
    Battleground::Update(diff);

    if (GetStatus() == STATUS_IN_PROGRESS)
    {
        if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS)    // after 47 minutes without one team losing, the arena closes with no winner and no rating change
        {
            UpdateArenaWorldState();
            CheckArenaAfterTimerConditions();
        }
    }

    if (getWaterFallTimer() < diff)
    {
        if (GetBgMap(false))
            if (isWaterFallActive())
            {
                setWaterFallTimer(urand(BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX));
                for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)
                    SpawnBGObject(i, getWaterFallTimer());
                setWaterFallActive(false);
            }
            else
            {
                setWaterFallTimer(BG_DS_WATERFALL_DURATION);
                for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)
                    SpawnBGObject(i, RESPAWN_IMMEDIATELY);
                setWaterFallActive(true);
            }
    }
    else
        setWaterFallTimer(getWaterFallTimer() - diff);

    if (GetStatus() == STATUS_IN_PROGRESS)
    {
        if(m_knockback < diff && m_knockbackCheck)
        {
            for(BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); itr++)
            {
                Player * plr = sObjectMgr->GetPlayer(itr->first);
                if (plr->GetTeam() == ALLIANCE && plr->GetDistance2d(1214, 765) <= 50 && plr->GetPositionZ() > 10)
                    KnockBackPlayer(plr, 6.15f, 50.00f, 7.00f);
                if (plr->GetTeam() == HORDE && plr->GetDistance2d(1369, 817) <= 50 && plr->GetPositionZ() > 10)
                    KnockBackPlayer(plr, 3.10f, 50.00f, 7.00f);
                plr->RemoveAurasDueToSpell(48018);
            }
            m_knockbackCheck = false;
        } else m_knockback -= diff;
    }
}
开发者ID:fragiami,项目名称:ZoneLimit,代码行数:51,代码来源:BattlegroundDS.cpp

示例3: GetStartTime

BOOL CMAPIAppointment::GetStartTime(CString& strStartTime, LPCTSTR szFormat)
{
	SYSTEMTIME tm;
	if(GetStartTime(tm)) 
	{
		TCHAR szTime[256];
		if(!szFormat) szFormat=_T("MM/dd/yyyy hh:mm:ss tt");
		GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szFormat, szTime, 256);
		GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szTime, szTime, 256);
		strStartTime=szTime;
		return TRUE;
	}
	return FALSE;
}
开发者ID:DenSumy,项目名称:MapiEx,代码行数:14,代码来源:MAPIAppointment.cpp

示例4: InitializeObjects

void BattlegroundNA::InitializeObjects()
{
    ObjectGUIDsByType.resize(BG_NA_OBJECT_MAX);
    if (GetStatus() == STATUS_IN_PROGRESS)
    {
        if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS)    // after 47 minutes without one team losing, the arena closes with no winner and no rating change
        {
            UpdateArenaWorldState();
            CheckArenaAfterTimerConditions();
        }
    }

    for (uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_4; ++i)
        SpawnGameObject(i, RESPAWN_IMMEDIATELY);
}
开发者ID:TrueWoW,项目名称:TrinityCore,代码行数:15,代码来源:BattlegroundNA.cpp

示例5: CheckMaxTime

void CheckMaxTime()
	{
	if (0 == g_ulMaxSecs.get())
		return;

	time_t Now = time(0);
	time_t ElapsedSecs = Now - GetStartTime();
	if (ElapsedSecs <= (time_t) g_ulMaxSecs.get())
		return;

	Log("Max time %s exceeded, elapsed seconds = %ul\n",
	  MaxSecsToStr(), ElapsedSecs);

	SaveCurrentAlignment();
	exit(EXIT_Success);
	}
开发者ID:Wyss,项目名称:mauve-py,代码行数:16,代码来源:savebest.cpp

示例6: GetStartTime

void ThreadProc::run (void)
{

    GetStartTime ();
    SocketReBuild();
    for(;!gameOver;)
    {
        if(!IsWorkinPermit())
        {
            msleep(10);
            continue;
        }
        GoGoStatusMachineRecv();
        DelaySRTime();
        GoGoStatusMachineSend ();
        OverTimeProc ();
    }
}
开发者ID:crazybun,项目名称:FreshTerminalOperatingTools,代码行数:18,代码来源:threadproc.cpp

示例7: ReadOptionsDirectTimeRange

void ReadOptionsDirectTimeRange(struct options_direct *opts,struct input *X)
{
  if(opts->t_start_flag==0)
    {
      opts->t_start = GetStartTime(X);
      opts->t_start_flag=1;
      mexWarnMsgIdAndTxt("STAToolkit:ReadOptionsTimeRange:missingParameter","Missing parameter start_time. Extracting from input: %f.\n",opts->t_start);
    }

  if(opts->t_end_flag==0)
    {
      opts->t_end = GetEndTime(X);
      opts->t_end_flag=1;
      mexWarnMsgIdAndTxt("STAToolkit:ReadOptionsTimeRange:missingParameter","Missing parameter end_time. Extracting from input: %f.\n",opts->t_end);
    }

  if((opts->t_start)>(opts->t_end))
      mexErrMsgIdAndTxt("STAToolkit:ReadOptionsTimeRange:badRange","Lower limit greater than upper limit for start_time and end_time.\n");
}
开发者ID:Field-Lab,项目名称:matlab,代码行数:19,代码来源:direct_mx.c

示例8: CRC32_Init

unsigned int CPhonemeTag::ComputeDataCheckSum()
{
	CRC32_t crc;
	CRC32_Init( &crc );

	// Checksum the text
	CRC32_ProcessBuffer( &crc, m_szPhoneme, Q_strlen( m_szPhoneme ) );
	int phonemeCode = GetPhonemeCode();
	CRC32_ProcessBuffer( &crc, &phonemeCode, sizeof( int ) );

	// Checksum timestamps
	float startTime = GetStartTime();
	float endTime = GetEndTime();
	CRC32_ProcessBuffer( &crc, &startTime, sizeof( float ) );
	CRC32_ProcessBuffer( &crc, &endTime, sizeof( float ) );

	CRC32_Final( &crc );

	return ( unsigned int )crc;
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:20,代码来源:sentence.cpp

示例9: return

bool TimedObject::OverlapWith(TimedObject* other)
{
	if(other == NULL)
		return false;
	
	TimedObject *first, *second;
    
	if(GetStartTime() <= other->GetStartTime()) 
    {
		first = this;
		second = other;
	} 
    else 
    {
		first = other;
		second = this;
	}
	    
	return (first->GetEndTime() >= second->GetStartTime());
}
开发者ID:AIDman,项目名称:Kaldi,代码行数:20,代码来源:timedobject.cpp

示例10: PostUpdateImpl

void BattlegroundDS::PostUpdateImpl(uint32 diff)
{
        if (GetStartTime() >= 75*IN_MILLISECONDS)
        {
            for(BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end();itr++)
            {
                Player *plr = ObjectAccessor::FindPlayer(itr->first);
                if (plr && plr->isAlive() && plr->GetPositionX() < 1260 && plr->GetPositionY() >755 && plr->GetPositionY() < 775 && plr->GetPositionZ() > 13)
                {
                    KnockBackPlayer(plr, 6.15f, 50.00f, 5.00f);
                    plr->RemoveAurasDueToSpell(48018);
                } 
                if (plr && plr->isAlive() && plr->GetPositionX() > 1330 && plr->GetPositionY() >805 && plr->GetPositionY() < 825 && plr->GetPositionZ() > 13)
                {
                    KnockBackPlayer(plr, 3.10f, 50.00f, 5.00f);
                    plr->RemoveAurasDueToSpell(48018);
                }
            }
        }

        if (getWaterFallTimer() < diff)
        {
            if (isWaterFallActive())
            {
                setWaterFallTimer(urand(BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX));
                for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)
                    SpawnBGObject(i, getWaterFallTimer());
                setWaterFallActive(false);
            }
            else
            {
                setWaterFallTimer(BG_DS_WATERFALL_DURATION);
                for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)
                    SpawnBGObject(i, RESPAWN_IMMEDIATELY);
                setWaterFallActive(true);
            }
        }
        else
            setWaterFallTimer(getWaterFallTimer() - diff);
}
开发者ID:FirstCore,项目名称:FunCore,代码行数:40,代码来源:BattlegroundDS.cpp

示例11: GetStartTime

void UMovieSceneSubSection::TrimSection( float TrimTime, bool bTrimLeft )
{
	if ( !IsTimeWithinSection( TrimTime ) )
	{
		return;
	}

	float InitialStartTime = GetStartTime();
	float InitialStartOffset = StartOffset;

	UMovieSceneSection::TrimSection( TrimTime, bTrimLeft );

	// If trimming off the left, set the offset of the shot
	if ( bTrimLeft )
	{
		float NewStartOffset = ( TrimTime - InitialStartTime ) / TimeScale;
		NewStartOffset += InitialStartOffset;

		// Ensure start offset is not less than 0
		StartOffset = FMath::Max( NewStartOffset, 0.f );
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:22,代码来源:MovieSceneSubSection.cpp

示例12: QDialog

//---------------------------------------------------------------------------
satpassdialog::satpassdialog(PList *_satList, QWidget *parent) :
    QDialog(parent),
    m_ui(new Ui::satpassdialog)
{
 TSat *sat;
 int i, flags;
 double daynum = GetStartTime(QDateTime::currentDateTime().toUTC());;

    m_ui->setupUi(this);
    setLayout(m_ui->gridLayout);

    mw = (MainWindow *) parent;
    satList = _satList;

    flags = 0;
    for(i=0; i<satList->Count; i++) {
        sat = (TSat *) satList->ItemAt(i);

        sat->daynum = daynum;
        sat->Calc();
        if(sat->IsGeostationary() || sat->Decayed(0))
            continue;

        m_ui->satListWidget->addItem(sat->name);

        flags |= sat->isActive() ? 1:0;
    }

    m_ui->activeSatBtn->setVisible(flags ? true:false);
    m_ui->dateEdit->setDate(QDate::currentDate());

    if(flags)
        on_activeSatBtn_clicked();
    else if(m_ui->satListWidget->count())
        on_satListWidget_currentItemChanged(m_ui->satListWidget->item(0), NULL);
    else
        QMessageBox::critical(this, "No satellites found!", "Click menu Satellite->Keplerian elements to download.");
}
开发者ID:poes-weather,项目名称:poes-usrp,代码行数:39,代码来源:satpassdialog.cpp

示例13: assert

bool C4TableGraph::DumpToFile(const StdStrBuf &rszFilename,
                              bool fAppend) const {
  assert(!!rszFilename);
  // nothing to write?
  if (!fWrapped && !iBackLogPos) return false;
  // try append if desired; create if unsuccessful
  CStdFile out;
  if (fAppend)
    if (!out.Append(rszFilename.getData())) fAppend = false;
  if (!fAppend) {
    if (!out.Create(rszFilename.getData())) return false;
    // print header
    out.WriteString("t\tv\n\r");
  }
  // write out current timeframe
  int iEndTime = GetEndTime();
  StdStrBuf buf;
  for (int iWriteTime = GetStartTime(); iWriteTime < iEndTime; ++iWriteTime) {
    buf.Format("%d\t%d\n\r", (int)iWriteTime, (int)GetValue(iWriteTime));
    out.WriteString(buf.getData());
  }
  return true;
}
开发者ID:ev1313,项目名称:yaC,代码行数:23,代码来源:C4Network2Stats.cpp

示例14: Update

void BattlegroundNA::Update(uint32 diff)
{
    Battleground::Update(diff);

    if(GetStatus() == STATUS_IN_PROGRESS)
    {
        if(GetStartTime() >= 47*MINUTE*IN_MILLISECONDS)    // after 47 minutes without one team losing, the arena closes with no winner and no rating change
        {
            UpdateArenaWorldState();
            CheckArenaAfterTimerConditions();
        }

        if(m_uiTeleport < diff)
        {
            for(BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
            {
                Player* pPlayer = sObjectMgr->GetPlayer(itr->first);
                if(pPlayer && pPlayer->GetPositionZ() < 10)
                    pPlayer->TeleportTo(pPlayer->GetMapId(), 4056.513f, 2921.693f, 13.932f, pPlayer->GetOrientation(), false);
            }
            m_uiTeleport = 1000;
        } else m_uiTeleport -= diff;
    }
}
开发者ID:FreedomEmu,项目名称:FreedomEmu,代码行数:24,代码来源:BattlegroundNA.cpp

示例15: GetMangosString

void BattleGround::EndBattleGround(uint32 winner)
{
    this->RemoveFromBGFreeSlotQueue();

    uint32 loser_rating = 0;
    uint32 winner_rating = 0;
    WorldPacket data;
    Player *Source = NULL;
    const char *winmsg = "";

    if(winner == ALLIANCE)
    {
        winmsg = GetMangosString(LANG_BG_A_WINS);

        PlaySoundToAll(SOUND_ALLIANCE_WINS);                // alliance wins sound

        SetWinner(WINNER_ALLIANCE);
    }
    else if(winner == HORDE)
    {
        winmsg = GetMangosString(LANG_BG_H_WINS);

        PlaySoundToAll(SOUND_HORDE_WINS);                   // horde wins sound

        SetWinner(WINNER_HORDE);
    }
    else
    {
        SetWinner(3);
    }

    SetStatus(STATUS_WAIT_LEAVE);
    m_EndTime = 0;

    for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
    {
        Player *plr = sObjectMgr.GetPlayer(itr->first);
        if(!plr)
        {
            sLog.outError("BattleGround: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
            continue;
        }

        // should remove spirit of redemption
        if(plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
            plr->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);

        if(!plr->isAlive())
        {
            plr->ResurrectPlayer(1.0f);
            plr->SpawnCorpseBones();
        }
        else
        {
            //needed cause else in av some creatures will kill the players at the end
            plr->CombatStop();
            plr->getHostileRefManager().deleteReferences();
        }

        uint32 team = itr->second.Team;
        if(!team) team = plr->GetTeam();

        if(team == winner)
        {
            if(!Source)
                Source = plr;
            RewardMark(plr,ITEM_WINNER_COUNT);
            RewardQuestComplete(plr);
        }
        else
            RewardMark(plr,ITEM_LOSER_COUNT);

        plr->CombatStopWithPets(true);

        BlockMovement(plr);

        sBattleGroundMgr.BuildPvpLogDataPacket(&data, this);
        plr->GetSession()->SendPacket(&data);

        uint32 bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(GetTypeID());
        sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, this, plr->GetTeam(), plr->GetBattleGroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime());
        plr->GetSession()->SendPacket(&data);
    }

    // inform invited players about the removal
    sBattleGroundMgr.m_BattleGroundQueues[BattleGroundMgr::BGQueueTypeId(GetTypeID())].BGEndedRemoveInvites(this);

    if(Source)
    {
        ChatHandler(Source).FillMessageData(&data, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, Source->GetGUID(), winmsg);
        SendPacketToAll(&data);
    }
}
开发者ID:magomags,项目名称:mangoszero,代码行数:93,代码来源:BattleGround.cpp


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