当前位置: 首页>>代码示例>>C++>>正文


C++ Fleet::getCost方法代码示例

本文整理汇总了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;
}
开发者ID:argarak,项目名称:tw-light,代码行数:41,代码来源:mcontrol.cpp

示例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;
}
开发者ID:Yurand,项目名称:tw-light,代码行数:27,代码来源:mmain.cpp


注:本文中的Fleet::getCost方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。