本文整理汇总了C++中Draw::DrawMap1inside方法的典型用法代码示例。如果您正苦于以下问题:C++ Draw::DrawMap1inside方法的具体用法?C++ Draw::DrawMap1inside怎么用?C++ Draw::DrawMap1inside使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Draw
的用法示例。
在下文中一共展示了Draw::DrawMap1inside方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AttackShip
Position Player::AttackShip(Position pos)
{
Draw picaso;
Position mappos;
for (int i = 0; i < m_MyMap.GetMapColumn(); ++i)
{
for (int j = 0; j < m_MyMap.GetMapRow(); ++j)
{
mappos.x = i + 'a';
mappos.y = j + '1';
picaso.SetLetterColor(m_MyMap.GetMapStatus(mappos));
picaso.DrawMap1inside(mappos, m_MyMap.GetShipMapStatus(mappos));
picaso.SetLetterColor(WHITE);
picaso.SetLetterColor(m_AttackMap.GetMapStatus(mappos));
picaso.DrawMap2inside(mappos, m_AttackMap.GetShipMapStatus(mappos));
picaso.SetLetterColor(WHITE);
}
}
picaso.DrawMap2inside(pos, SQUARE);
Position erasepos = pos;
int attackkey = 0;
while (m_AttackMap.GetMapStatus(pos) == ATTACK || attackkey != ENTER)
{
attackkey = _getch();
if (attackkey == 224)
{
attackkey = _getch();
}
switch (attackkey)
{
case LEFT:
pos.x--;
break;
case RIGHT:
pos.x++;
break;
case UP:
pos.y--;
break;
case DOWN:
pos.y++;
break;
}
picaso.SetLetterColor(m_AttackMap.GetMapStatus(erasepos));
picaso.DrawMap2inside(mappos, m_AttackMap.GetMapStatus(erasepos));
picaso.SetLetterColor(WHITE);
picaso.DrawMap2inside(pos, SQUARE);
erasepos = pos;
}
picaso.DrawMap2inside(pos, ECSE);
m_AttackMap.ChangeStatusMap(pos, ATTACK);
return pos;
}