本文整理汇总了C++中IshipIGC::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ IshipIGC::GetName方法的具体用法?C++ IshipIGC::GetName怎么用?C++ IshipIGC::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IshipIGC
的用法示例。
在下文中一共展示了IshipIGC::GetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Paint
void Paint(ItemID pitemArg, Surface* psurface, bool bSelected, bool bFocus)
{
ImodelIGC* pDestination = (ImodelIGC*)pitemArg;
IshipIGC* pship = NULL;
IstationIGC* pstation = NULL;
if (pDestination == NULL || trekClient.MyMission() == NULL)
return;
if (pDestination->GetObjectType() == OT_ship)
{
CastTo(pship, pDestination);
}
else
{
assert(pDestination->GetObjectType() == OT_station);
CastTo(pstation, pDestination);
}
// draw the selection bar
if (bSelected) {
psurface->FillRect(
WinRect(0, 0, GetXSize(), GetYSize()),
Color::Red()
);
}
TRef<IEngineFont> pfont;
// show the place we currently are in bold
if (pship && pship == trekClient.GetShip()->GetParentShip()
|| pstation && pstation == trekClient.GetShip()->GetStation())
{
pfont = TrekResources::SmallBoldFont();
}
else
{
pfont = TrekResources::SmallFont();
}
Color color;
if (CanKeepCurrentShip(pDestination))
{
color = Color::White();
}
else
{
color = 0.75f * Color::White();
}
// draw the name
psurface->DrawString(
pfont,
color,
WinPoint(0, 0),
pship ? pship->GetName() : pstation->GetName()
);
// draw the ship type (if any)
if (pship)
{
psurface->DrawString(
pfont,
color,
WinPoint(m_viColumns[0], 0),
HullName(pDestination)
);
}
// draw the cluster
psurface->DrawString(
pfont,
color,
WinPoint(m_viColumns[1] + 2, 0),
SectorName(pDestination)
);
// draw the total number of turrets (if appropriate)
if (pship && NumTurrets(pship))
{
int nNumTurrets = NumTurrets(pship);
if (nNumTurrets != 0)
{
psurface->DrawString(
pfont,
color,
WinPoint(m_viColumns[2] + 2, 0),
ZString((int)MannedTurrets(pship)) + ZString("/") + ZString(nNumTurrets)
);
}
}
}