本文整理汇总了C++中Ball::GetStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ Ball::GetStatus方法的具体用法?C++ Ball::GetStatus怎么用?C++ Ball::GetStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ball
的用法示例。
在下文中一共展示了Ball::GetStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Ball::Ball(const Ball& ball)
{
_pPimpl = new BallPimpl;
assert(_pPimpl);
this->SetDiameter (ball.GetDiameter ());
this->SetCenterPoint (ball.GetCenterPoint ());
this->SetStatus (ball.GetStatus ());
}
示例2: TiXmlDeclaration
//---------------------------------------------------------------------------
// ----- Methods :: File Serialize (XML) ----- //
//---------------------------------------------------------------------------
bool Strip::Save (const TCHAR* lpszFileName)
{
// ----- Initialize & Declare ----- //
FILE* stream = _tfopen(lpszFileName, _T("wb") CHARSET);
if (stream == NULL || _pPimpl == NULL)
{
return false;
}
TiXmlDocument doc;
TiXmlDeclaration* pDecl;
TiXmlElement* pRoot;
TiXmlElement* pBlockNode;
TiXmlElement* pUnitNode;
TiXmlElement* pBallNode;
Block* pBlockObject;
Unit* pUnitObject;
Ball* pBallObject;
int vectorBlockSize;
int vectorUnitCountX;
int vectorUnitCountY;
int vectorBallSize;
pDecl = new TiXmlDeclaration("1.0", "euc-kr", "");
doc.LinkEndChild(pDecl);
// ----- Set a Strip Data ----- //
pRoot = new TiXmlElement(ROOT_NAME_STRIP);
pRoot->SetDoubleAttribute(ATTR_NAME_WIDTH, _pPimpl->dWidth);
pRoot->SetDoubleAttribute(ATTR_NAME_HEIGHT, _pPimpl->dHeight);
doc.LinkEndChild(pRoot);
// ----- Insert a Block Data ----- //
pBlockObject = FirstBlock();
if (pBlockObject != NULL)
{
do
{
pBlockNode = new TiXmlElement(NODE_NAME_BLOCK);
pBlockNode->SetDoubleAttribute(ATTR_NAME_COLUMN, pBlockObject->GetColumn ());
pBlockNode->SetDoubleAttribute(ATTR_NAME_ROW, pBlockObject->GetRow ());
pBlockNode->SetDoubleAttribute(ATTR_NAME_WIDTH, pBlockObject->GetWidth ());
pBlockNode->SetDoubleAttribute(ATTR_NAME_HEIGHT, pBlockObject->GetHeight ());
pBlockNode->SetDoubleAttribute(ATTR_NAME_START_X, pBlockObject->GetStartX ());
pBlockNode->SetDoubleAttribute(ATTR_NAME_START_Y, pBlockObject->GetStartY ());
// ----- Insert a Unit (in Block) Data ----- //
pUnitObject = pBlockObject->FirstUnit();
if (pUnitObject != NULL)
{
do
{
pUnitNode = new TiXmlElement(NODE_NAME_UNIT);
pUnitNode->SetDoubleAttribute(ATTR_NAME_COLUMN, pUnitObject->GetColumn ());
pUnitNode->SetDoubleAttribute(ATTR_NAME_ROW, pUnitObject->GetRow ());
pUnitNode->SetDoubleAttribute(ATTR_NAME_START_X, pUnitObject->GetStartX ());
pUnitNode->SetDoubleAttribute(ATTR_NAME_START_Y, pUnitObject->GetStartY ());
pUnitNode->SetDoubleAttribute(ATTR_NAME_CENTER_X, pUnitObject->GetCenterX ());
pUnitNode->SetDoubleAttribute(ATTR_NAME_CENTER_Y, pUnitObject->GetCenterY ());
pUnitNode->SetDoubleAttribute(ATTR_NAME_WIDTH, pUnitObject->GetWidth ());
pUnitNode->SetDoubleAttribute(ATTR_NAME_HEIGHT, pUnitObject->GetHeight ());
// ----- Insert a Ball (in Unit) Data ----- //
pBallObject = pUnitObject->FirstBall();
if (pBallObject != NULL)
{
do
{
pBallNode = new TiXmlElement(NODE_NAME_BALL);
pBallNode->SetDoubleAttribute(ATTR_NAME_DIAMETER, pBallObject->GetDiameter ());
pBallNode->SetDoubleAttribute(ATTR_NAME_CENTER_X, pBallObject->GetCenterX ());
pBallNode->SetDoubleAttribute(ATTR_NAME_CENTER_Y, pBallObject->GetCenterY ());
pBallNode->SetDoubleAttribute(ATTR_NAME_BALL_STATUS, pBallObject->GetStatus ());
pUnitNode->LinkEndChild(pBallNode);
}
while ((pBallObject = pUnitObject->NextBall()) != NULL);
}
pBlockNode->LinkEndChild(pUnitNode);
}
while ((pUnitObject = pBlockObject->NextUnit()) != NULL);
}
pRoot->LinkEndChild(pBlockNode);
}
while ((pBlockObject = NextBlock()) != NULL);
}
// ----- Save and Close ----- //
doc.SaveFile(stream);
//.........这里部分代码省略.........