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


C++ IsDone函数代码示例

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


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


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