本文整理汇总了C++中IPlayerInfo::getPlayerMapID方法的典型用法代码示例。如果您正苦于以下问题:C++ IPlayerInfo::getPlayerMapID方法的具体用法?C++ IPlayerInfo::getPlayerMapID怎么用?C++ IPlayerInfo::getPlayerMapID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPlayerInfo
的用法示例。
在下文中一共展示了IPlayerInfo::getPlayerMapID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateInfo
void BaseGameView::updateInfo() {
int tileSize = _tileManager->getTileSize();
int mapHeight = _model->getMap()->getHeight() * tileSize;
int lineSpacing = 24;
int currentY = _infoOffsetY;
int currentX = _infoOffsetX + 8;
_displayImg->draw_rectangle(_infoOffsetX, _infoOffsetY,
_infoOffsetX + _backgroundInfoWidth,
mapHeight + _displayOffset.second,
__cBlack);
sprintf(__drawString, "Current turn: %5d", _model->getCurrentTurnCount());
_displayImg->draw_text(currentX, currentY, __drawString,
__cTurquoise1, __cBlack, 1.0, __smallFont);
currentY += lineSpacing;
vector<IPlayerInfo*> playerInfos = _model->getPlayersInfo();
IPlayerInfo* cur;
for (int i = 0; i < playerInfos.size(); i++) {
cur = playerInfos[i];
pair<int,int> pos = cur->getHeadquarterPosition();
sprintf(__drawString, "Team %c - Head: (%d, %d)", cur->getPlayerMapID(),
pos.first, pos.second);
_displayImg->draw_text(currentX, currentY, __drawString,
__cGreen, __cBlack, 1.0, __bigFont);
currentY += lineSpacing;
sprintf(__drawString, "Pos\t\tHP\tAmmo\tRange");
_displayImg->draw_text(currentX, currentY, __drawString,
__cPink, __cBlack, 1.0, __smallFont);
currentY += lineSpacing;
list<ITank*> tanks = cur->getAliveTanks();
for (list<ITank*>::iterator it = tanks.begin(); it != tanks.end(); ++it) {
ITank* tank = *it;
pos = tank->getPosition();
sprintf(__drawString, "(%2d, %2d)\t%2d\t%4d\t%5d",
pos.first, pos.second,
tank->getHP(), tank->getAmmoNumber(),
tank->getRange());
_displayImg->draw_text(currentX, currentY, __drawString,
__cWhite, __cBlack, 1.0, __smallFont);
currentY += lineSpacing;
}
}
}