Exemplo n.º 1
0
/*		CElement operator()(const pair<_null_type, sigout>& v)const
		{
			return  CEPair(v.first, v.second);
			//errorhandling    
		}*/
		CElement operator()(const pair<CEFunction, CElement>& fo)const{
			cout<<"-e-3--\n";
			return std::move(fo.first._function ? 
			fo.first._function ( apply_visitor(evaluate_crystal<T>(),fo.second)) 
			: 
			CElement() ) //CEPair( _null_type, fo)
			;
		}	
Exemplo n.º 2
0
CFigurePtr CCreateFigure::create()
{
  CFigurePtr spFigure(new CFigure());
  int figureNumber = m_pRandom->generate();
  for (int y = figureNumber * 4; y < (figureNumber +1) * 4; ++y)
    for (int x = 0; x < 4; ++x)
      if (figures[y][x])
        spFigure->elem.push_back(CElement(QPoint(m_size / 2 + x - 2, y - figureNumber * 4)));

  return spFigure;
}
Exemplo n.º 3
0
void CDatabase::AddElement(const char *pType, const char *pModelName, CParameters *paParameters)
{
	const CElementModel *pModel = m_pModelsDatabase->FindElementModel(pType, pModelName);
	if(!pModel)
	{
		printf("error: couldn't find model '%s' of type '%s'\n", pModelName, pType);
		PrintCallstack();
		return;
	}

	CElement *pElement = MEM_NEW(CElement(this, pModel, m_ElementsCount++, paParameters));
	CElementsGroup *pGroup = GetElementsGroup(pType);
	pGroup->m_apList.Add(pElement);
	pElement->CallFunction("$on_add", paParameters);

#ifdef SPB_DEBUG
	printf("success: added element %p (type '%s', model '%s')\n", pElement, pType, pModelName);
#endif
}
Exemplo n.º 4
0
		CElement operator()(const sigout& fo)const{
			cout<<"-e-4--\n";
			return CElement();///@@todo ???? error
		}