本文整理汇总了C++中CShipClass::GetPlayerSettings方法的典型用法代码示例。如果您正苦于以下问题:C++ CShipClass::GetPlayerSettings方法的具体用法?C++ CShipClass::GetPlayerSettings怎么用?C++ CShipClass::GetPlayerSettings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CShipClass
的用法示例。
在下文中一共展示了CShipClass::GetPlayerSettings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GenerateShipImageChart
void GenerateShipImageChart (CUniverse &Universe, CXMLElement *pCmdLine)
{
int i;
enum OrderTypes
{
orderSmallest = 1,
orderLargest = 2,
orderName = 3,
};
// Options
bool bTextBoxesOnly = pCmdLine->GetAttributeBool(CONSTLIT("textBoxesOnly"));
// Figure out what order we want
CString sOrder = pCmdLine->GetAttribute(CONSTLIT("sort"));
int iOrder;
if (strEquals(sOrder, CONSTLIT("smallest")))
iOrder = orderSmallest;
else if (strEquals(sOrder, CONSTLIT("largest")))
iOrder = orderLargest;
else
iOrder = orderName;
// Image size
int cxDesiredWidth;
if (pCmdLine->FindAttributeInteger(CONSTLIT("width"), &cxDesiredWidth))
cxDesiredWidth = Max(512, cxDesiredWidth);
else
cxDesiredWidth = 1280;
// Spacing
int cxSpacing = pCmdLine->GetAttributeInteger(CONSTLIT("xSpacing"));
int cxExtraMargin = pCmdLine->GetAttributeInteger(CONSTLIT("xMargin"));
// Rotation
int iRotation = pCmdLine->GetAttributeInteger(CONSTLIT("rotation"));
// Font for text
CString sTypeface;
int iSize;
bool bBold;
bool bItalic;
if (!CG16bitFont::ParseFontDesc(pCmdLine->GetAttribute(CONSTLIT("font")),
&sTypeface,
&iSize,
&bBold,
&bItalic))
{
sTypeface = CONSTLIT("Arial");
iSize = 10;
bBold = false;
bItalic = false;
}
CG16bitFont NameFont;
NameFont.Create(sTypeface, -PointsToPixels(iSize), bBold, bItalic);
WORD wNameColor = CG16bitImage::RGBValue(255, 255, 255);
// Output file
CString sFilespec = pCmdLine->GetAttribute(CONSTLIT("output"));
if (!sFilespec.IsBlank())
sFilespec = pathAddExtensionIfNecessary(sFilespec, CONSTLIT(".bmp"));
// Generate a table of ships
CSymbolTable Table(FALSE, TRUE);
for (i = 0; i < Universe.GetShipClassCount(); i++)
{
CShipClass *pClass = Universe.GetShipClass(i);
// Skip player ship classes
if (pClass->GetPlayerSettings())
continue;
// Skip non-generic classes
if (!pClass->HasAttribute(CONSTLIT("genericClass")))
continue;
// Compute the sort key
char szBuffer[1024];
switch (iOrder)
{
case orderLargest:
wsprintf(szBuffer, "%04d%s%x",
2048 - RectWidth(pClass->GetImage().GetImageRect()),
pClass->GetName().GetASCIIZPointer(),
pClass);
break;
//.........这里部分代码省略.........