本文整理汇总了C++中Fleet::getCost方法的典型用法代码示例。如果您正苦于以下问题:C++ Fleet::getCost方法的具体用法?C++ Fleet::getCost怎么用?C++ Fleet::getCost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fleet
的用法示例。
在下文中一共展示了Fleet::getCost方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: my_list_proc
int my_list_proc( int msg, DIALOG* d, int c )
{
STACKTRACE;
int old_d1 = d->d1;
Fleet *fleet = (Fleet*)d->dp3;
int ret = d_list_proc2( msg, d, c );
if ( d->d1 != old_d1 || msg == MSG_START ) {
ShipType* type = fleet->getShipType(d->d1);
ASSERT(type != NULL);
selectDialog[SELECT_DIALOG_TITLE].flags |= D_DIRTY;
sprintf(selectTitleString, "%s\n%s\n%d of %d points",
selectShipPrompt,
(type != NULL) ? type->name : 0,
(type != NULL) ? type->cost : 0,
fleet->getCost());
BITMAP* panel = NULL;
TW_DATAFILE* data = tw_load_datafile_object( type->data->file, "SHIP_P00_PCX" );
if ( data ) {
BITMAP* bmp = (BITMAP*)data->dat;
panel = create_bitmap_ex( bitmap_color_depth(screen), bmp->w, bmp->h );
blit( bmp, panel, 0, 0, 0, 0, bmp->w, bmp->h );
tw_unload_datafile_object( data );
data = tw_load_datafile_object( type->data->file, "SHIP_P01_PCX" );
bmp = (BITMAP*)data->dat;
blit( bmp, panel, 0, 0, 4, 65, bmp->w, bmp->h );
tw_unload_datafile_object( data );
color_correct_bitmap( panel, 0 );
}
if ( selectDialog[SELECT_DIALOG_PIC].dp ) destroy_bitmap( (BITMAP*)selectDialog[SELECT_DIALOG_PIC].dp );
selectDialog[SELECT_DIALOG_PIC].dp = panel;
scare_mouse();
SEND_MESSAGE( &selectDialog[SELECT_DIALOG_PIC], MSG_DRAW, 0 );
unscare_mouse();
}
return ret;
}
示例2: display_stats
void NormalGame::display_stats()
{
STACKTRACE;
pause();
int i;
for (i = 0; i < num_players; i += 1) {
Fleet *fleet = player_fleet[i];
switch (log->type) {
case Log::log_net1client:
case Log::log_net1server:
{
// if (log->get_direction(player_control[i]->channel) & Log::direction_write)
message.print(6000, 15, "%s status: : %d / ?? Ships, %d / ??? points", player_name[i], fleet->getSize(), fleet->getCost());
// else
// message.print(6000, 15, "%s status: : %d / %d points", buffy, fleet->cost, player_total_fleet[i]);
}
break;
default:
{
message.print(6000, 15, "%s status: : %d / ?? Ships, %d / ??? points", player_name[i], fleet->getSize(), fleet->getCost());
}
break;
}
}
unpause();
return;
}