• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ IsDone函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Tick

int Scene::Tick(int* currFunction, int* currTask) {
  if(IsDone())
    return (int)SUCCES;

  if(stack.empty())
      return (int)FAILURE;

  // Go to stack and execute last entry if not null-pointer. If null-pointer, remove and take next. If stack is empty, return false.
  while(functions[stack.back().x][stack.back().y] == UNDEFINED) { // Find entry which is not undefined
    stack.pop_back();
    if(stack.empty())
      return FAILURE; // No more commmands. We already checked if we solved the task, so we return FAILURE
  }
  
  *currFunction = stack.back().x;
  *currTask = stack.back().y;
  // Execute function
  int returnValue = CallFunc(functions[stack.back().x][stack.back().y]);
  // (x, y+1) into stack.
  stack.back().y++;

  // If return is not -1, put (return, 0) into stack;
  if(returnValue != -1)
    stack.push_back((Pos){returnValue, 0});

  return (int)NOT_DONE;
}
开发者ID:Newspaperman57,项目名称:Crane_bot,代码行数:27,代码来源:scene.cpp


示例2: GetProgress

CVariant CKadOperation::AddLoadRes(const CVariant& LoadRes, CKadNode* pNode)
{
	SOpProgress* pProgress = GetProgress(pNode);

	CVariant FilteredRes = LoadRes.Clone(false); // Make a Shellow Copy
	const CVariant& LoadedList = LoadRes["RES"];

	CVariant FilteredList;
	for(uint32 i=0; i < LoadedList.Count(); i++)
	{
		CVariant Loaded = LoadedList.At(i).Clone(false); // Make a Shellow Copy
		const CVariant& XID = Loaded["XID"];

		// Counting
		if(pProgress) // might be NULL if we filter our own index response right now
		{
			SOpStatus &Status = pProgress->Loads[XID];
			Status.Results++;
			if(!Loaded.Get("MORE"))
				Status.Done = true; // this marks that no more results are to be expected form this node
		}

		SOpStatus* pStatus = &m_LoadMap[XID].Status;
		pStatus->Results++;
		if(!pStatus->Done)
			pStatus->Done = IsDone(SOpProgress::GetLoads, XID);
		
		if(!pStatus->Done)
			Loaded.Insert("MORE", true);
		else
			Loaded.Remove("MORE");
		//

		if(Loaded.Has("ERR"))
		{
			FilteredList.Append(Loaded);
			continue;
		}

		// Filtering
		CVariant UniquePayloads;
		const CVariant& Payloads = Loaded["PLD"];
		for(uint32 j=0; j < Payloads.Count(); j++)
		{
			const CVariant& Payload = Payloads.At(j);
			if(m_LoadFilter[XID].insert(Payload["DATA"].GetFP()).second)
				UniquePayloads.Append(Payload);
		}

		// Note: we must add this even if UniquePayloads is empty or else we will misscount replys
		CVariant NewLoaded;
		NewLoaded["XID"] = XID;
		NewLoaded["PLD"] = UniquePayloads;
		FilteredList.Append(NewLoaded);
		//
	}

	FilteredRes.Insert("RES", FilteredList);
	return FilteredRes;
}
开发者ID:0vermind,项目名称:NeoLoader,代码行数:60,代码来源:KadOperation.cpp


示例3: IsDone

void CLoadLTADlg::OnTimer(UINT nIDEvent) 
{
	CEdit* pEdit = ((CEdit*)GetDlgItem(IDC_LOADLOG));
	pEdit->SetSel(-1, 0, TRUE);

	if(nIDEvent == TIMER_ID)
	{
		BOOL bDone = IsDone();

		//see if we need to update the load log
		//(the check is done so that when it is running, we don't refresh it
		//continually)
		if(m_bPrevLoaderDone == FALSE)
		{
			UpdateLoadLog();
		}

		//see if the finishing state has finished at all
		if(bDone != m_bPrevLoaderDone)
		{
			((CButton*)GetDlgItem(IDC_SAVELOADLOG))->EnableWindow(bDone);
			((CButton*)GetDlgItem(IDOK))->EnableWindow(bDone);
			m_bPrevLoaderDone = bDone;
		}

		// automatically close the dialog on load completion
		if( m_bAutoConfirm && bDone && m_bPrevLoaderDone )
		{
			OnOK();
		}
	}
	
	CDialog::OnTimer(nIDEvent);
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:34,代码来源:loadltadlg.cpp


示例4: NS_ERROR

//------------------------------------------------------------
void
nsFilteredContentIterator::Last()
{
  if (!mCurrentIterator) {
    NS_ERROR("Missing iterator!");

    return;
  }

  // If we are switching directions then
  // we need to switch how we process the nodes
  if (mDirection != eBackward) {
    mCurrentIterator = mIterator;
    mDirection       = eBackward;
    mIsOutOfRange    = false;
  }

  mCurrentIterator->Last();

  if (mCurrentIterator->IsDone()) {
    return;
  }

  nsINode *currentNode = mCurrentIterator->GetCurrentNode();
  nsCOMPtr<nsIDOMNode> node(do_QueryInterface(currentNode));

  bool didCross;
  CheckAdvNode(node, didCross, eBackward);
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:30,代码来源:nsFilteredContentIterator.cpp


示例5: NS_ASSERTION

void
nsFilteredContentIterator::Prev()
{
  if (mIsOutOfRange || !mCurrentIterator) {
    NS_ASSERTION(mCurrentIterator, "Missing iterator!");

    return;
  }

  // If we are switching directions then
  // we need to switch how we process the nodes
  if (mDirection != eBackward) {
    nsresult rv = SwitchDirections(false);
    if (NS_FAILED(rv)) {
      return;
    }
  }

  mCurrentIterator->Prev();

  if (mCurrentIterator->IsDone()) {
    return;
  }

  // If we can't get the current node then 
  // don't check to see if we can skip it
  nsINode *currentNode = mCurrentIterator->GetCurrentNode();

  nsCOMPtr<nsIDOMNode> node(do_QueryInterface(currentNode));
  CheckAdvNode(node, mDidSkip, eBackward);
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:31,代码来源:nsFilteredContentIterator.cpp


示例6:

PyObject *pyllbc_PackLemma_Top::Read(pyllbc_Stream *stream)
{
    if (UNLIKELY(!IsDone()))
    {
        pyllbc_SetError("top-lemma not done, could not unpack data");
        return NULL;
    }

    size_t idx = 0;
    PyObject *values = PyTuple_New(_lemmas.size());
    for (; idx < _lemmas.size(); idx++)
    {
        PyObject *value;
        Base *lemma = _lemmas[idx];
        if (!(value = lemma->Read(stream)))
            break;

        PyTuple_SET_ITEM(values, idx, value);
    }

    if (idx != _lemmas.size())
    {
        Py_DECREF(values);
        values = NULL;
    }

    return values;
}
开发者ID:lailongwei,项目名称:llbc,代码行数:28,代码来源:PackLemma_Top.cpp


示例7: Rewind

HRESULT
SoundD3D::Play()
{
	if (IsPlaying())  return S_OK;
	if (!buffer)      return E_FAIL;

	HRESULT hr = E_FAIL;

	if (IsDone())
	hr = Rewind();

	if (IsReady()) {
		if (moved)
		Localize();

		if (flags & LOOP || flags & STREAMED)
		hr = buffer->Play(0, 0, DSBPLAY_LOOPING);
		else
		hr = buffer->Play(0, 0, 0);

		if (SUCCEEDED(hr))
		status = PLAYING;
	}

	return hr;
}
开发者ID:lightgemini78,项目名称:Starshatter-Rearmed,代码行数:26,代码来源:SoundD3D.cpp


示例8: IsFinished

bool CLIENTFX_INSTANCE::IsFinished()
{
	if (IsDone()) 
		return true;

	CLinkListNode<FX_LINK>	*pActiveNode = m_collActiveFX.GetHead();
	CBaseFX	*pFX = LTNULL;
	while (pActiveNode)
	{
		pFX = pActiveNode->m_Data.m_pFX;

		// Check for expiration
		if( pFX ) 
		{				
			//determine if this effect has expired
			bool bExpired = ((pFX->GetElapsed() >= pFX->GetEndTime()) || pFX->IsShuttingDown()) && 
							 (pFX->IsFinishedShuttingDown() || !pActiveNode->m_Data.m_pRef->m_bSmoothShutdown);
			
			if (!bExpired) 
				return false;
		}

		pActiveNode = pActiveNode->m_pNext;
	}

	return true;
}
开发者ID:bibendovsky,项目名称:ltjs,代码行数:27,代码来源:clientfxmgr.cpp


示例9: DrawAt

void BattleAnimation::DrawAt(int x, int y) {
	if (!sprite) return; // Initialization failed
	if (IsDone()) return;

	const RPG::AnimationFrame& anim_frame = animation.frames[frame];

	std::vector<RPG::AnimationCellData>::const_iterator it;
	for (it = anim_frame.cells.begin(); it != anim_frame.cells.end(); ++it) {
		const RPG::AnimationCellData& cell = *it;

		if (!cell.valid) {
			// Skip unused cells (they are created by deleting cells in the
			// animation editor, resulting in gaps)
			continue;
		}

		sprite->SetX(cell.x + x);
		sprite->SetY(cell.y + y);
		int sx = cell.cell_id % 5;
		int sy = cell.cell_id / 5;
		int size = large ? 128 : 96;
		sprite->SetSrcRect(Rect(sx * size, sy * size, size, size));
		sprite->SetOx(size / 2);
		sprite->SetOy(size / 2);
		sprite->SetTone(Tone(cell.tone_red * 128 / 100,
			cell.tone_green * 128 / 100,
			cell.tone_blue * 128 / 100,
			cell.tone_gray * 128 / 100));
		sprite->SetOpacity(255 * (100 - cell.transparency) / 100);
		sprite->SetZoomX(cell.zoom / 100.0);
		sprite->SetZoomY(cell.zoom / 100.0);
		sprite->Draw();
	}
}
开发者ID:FaithFeather,项目名称:Player,代码行数:34,代码来源:battle_animation.cpp


示例10:

const LLBC_String &pyllbc_PackLemma::ToString() const
{
    if (!IsDone())
        return _emptyStr;

    return _str;
}
开发者ID:lailongwei,项目名称:llbc,代码行数:7,代码来源:PackLemma.cpp


示例11: UpdateDisplays

    void Environment::Run(const int n_steps)
    {
      int t;
      unsigned int i;
      for(i = 0; i < agents.size(); i++)
	{
	  agents[i]->SetPerformance(0);
	}
      UpdateDisplays();
      if(delay)
	{
	  sleep(delay);
	}
      for(t = 0; t < n_steps; t++)
	{
	  if(IsDone())
	    {
	      return;
	    }
	  Step();
	  if(delay)
	    {
	      sleep(delay);
	    }
	}
    }
开发者ID:sstephens,项目名称:sstephens1,代码行数:26,代码来源:Environment.cpp


示例12: NAssert

void T_SimpleListIterator<Item>::Next() {
	NAssert(!IsDone()) ;
	if (_reverse) {
		_current=_current->prev ;
	} else {
		_current=_current->next ;
	}
}
开发者ID:EQ4,项目名称:LittleGPTracker,代码行数:8,代码来源:T_SimpleListIterator.cpp


示例13: IteratorOutOfBoundException

		const char& String::StringIterator::CurrentItem() const
		{
			if (IsDone()) {
				throw IteratorOutOfBoundException();
			}

			return (_string->operator[](_current));
		}
开发者ID:chronos38,项目名称:lupus-framework,代码行数:8,代码来源:String.cpp


示例14: OnCancel

void CLoadLTADlg::OnCancel() 
{
	//don't let them quit while the thread is running
	if(IsDone() == FALSE)
		return;
	
	CDialog::OnCancel();
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:8,代码来源:loadltadlg.cpp


示例15:

Item MyListIterator<Item>::CurrentItem() const
{
    if(IsDone())
    {
        throw IteratorOutOfBounds;
    }
    return _list->Get(_current);
}
开发者ID:saranfly,项目名称:DesignPatterns,代码行数:8,代码来源:mylistiterator.cpp


示例16:

	virtual ~FXmppMessageReceiveTask()
	{
		// task shouldn't really be deleted until done but just in case
		if (!IsDone())
		{
			Stop();
		}
	}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:8,代码来源:XmppMessagesJingle.cpp


示例17:

bool
nsFilteredContentIterator::IsDone()
{
  if (mIsOutOfRange || !mCurrentIterator) {
    return true;
  }

  return mCurrentIterator->IsDone();
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:9,代码来源:nsFilteredContentIterator.cpp


示例18: CreateJob

Job*
CryptTask::CreateNextJob()
{
	if (IsDone())
		return NULL;

	CryptJob* job = CreateJob();
	_PrepareJob(job);
	return job;
}
开发者ID:axeld,项目名称:driveencryption,代码行数:10,代码来源:crypt.cpp


示例19: MustShowReadJobs

bool CItem::MustShowReadJobs() const
{
	if (GetParent() != NULL)
	{
		return !GetParent()->IsDone();
	}
	else
	{
		return !IsDone();
	}
}
开发者ID:coapp-packages,项目名称:windirstat,代码行数:11,代码来源:item.cpp


示例20: Render

void Window::Render(const boost::shared_ptr<Surface>& target)
{
    if (IsDone())
    {
        return;
    }

    target->PushState();
    target->SetViewportRelative(GetBounds());
    OnRender(target);
    target->PopState();
}
开发者ID:FooSoft,项目名称:moonfall,代码行数:12,代码来源:Window.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IsEOF函数代码示例发布时间:2022-05-30
下一篇:
C++ IsDlgButtonChecked函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap