本文整理汇总了C++中NumberObject::getX方法的典型用法代码示例。如果您正苦于以下问题:C++ NumberObject::getX方法的具体用法?C++ NumberObject::getX怎么用?C++ NumberObject::getX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NumberObject
的用法示例。
在下文中一共展示了NumberObject::getX方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getGameNumber
int GameSelectWorld::getGameNumber(Room *room)
{
NumberObject *first = NULL, *second = NULL;
int gameNumber = 0;
for (UINT i=0; i<room->getObjects()->length(); i++)
{
if ( (first != NULL) && (second != NULL) )
break;
GameObject *object = (GameObject *)(room->getObjects()->elementAt(i));
if ( (object->getType() == GameObject::GAMEOBJECT_TYPE_NUMBER) &&
(object->getIsBeingHeld() == FALSE) )
{
if (first != NULL)
second = (NumberObject *)object;
else
first = (NumberObject *)object;
}
}
if (first != NULL)
{
if (second == NULL)
{
gameNumber = first->getNumber();
}
else
{
// the game number is the number as readable on screen (ignoring vertical
// position)
if (first->getX() < second->getX())
gameNumber = ( first->getNumber() * 10 ) + second->getNumber();
else
gameNumber = ( second->getNumber() * 10 ) + first->getNumber();
}
}
return gameNumber;
}