示例#1
0
文件: OR_SPY.cpp 项目: Stummi/7kaa
static void disp_total()
{
	int x = SPY_BROWSE_X1+9;
	int y = SPY_BROWSE_Y2-16;

	vga_back.d3_panel_up(SPY_BROWSE_X1, SPY_BROWSE_Y2-18, SPY_BROWSE_X2, SPY_BROWSE_Y2 );

	String str;

	if( browse_spy.total_rec() > 1 )
		str = "Total Spies";
	else
		str = "Total Spy";

	str  = translate.process(str);
	str += ": ";
	str += browse_spy.total_rec();

	font_san.put( x, y, str );
}
示例#2
0
文件: OR_TOWN.cpp 项目: AMDmi3/7kaa
static void disp_total()
{
	//------- calculate total --------//

	total_population = 0;
	total_peasant	  = 0;

	Town* townPtr;

	for( int i=town_array.size() ; i>0 ; i-- )
	{
		if( town_array.is_deleted(i) )
			continue;

		townPtr = town_array[i];

		if( townPtr->nation_recno==info.viewing_nation_recno )
		{
			total_population += townPtr->population;
			total_peasant	  += townPtr->jobless_population;
		}
	}

	//-------- display town total --------//

	int x=TOWN_BROWSE_X1+9;
	int y=TOWN_BROWSE_Y2-16;

	vga_back.d3_panel_up(TOWN_BROWSE_X1, TOWN_BROWSE_Y2-18, TOWN_BROWSE_X2, TOWN_BROWSE_Y2 );

	String str;

	snprintf( str, MAX_STR_LEN+1, _("Total Villages: %s"), misc.format(browse_town.total_rec()) );

	font_san.put( x, y, str );

   //-------------------------------//

	snprintf( str, MAX_STR_LEN+1, _("Total Villagers: %s"), misc.format(total_population) );

	font_san.put( x+180, y, str );

	//-------------------------------//

	snprintf( str, MAX_STR_LEN+1, _("Total Peasants: %s"), misc.format(total_peasant) );

	font_san.put( x+360, y, str );

	//------- display other totals --------//

	Nation* viewNation = nation_array[info.viewing_nation_recno];

	x=POP_TOTAL_X1+9;
	y=POP_TOTAL_Y1+2;

	vga_back.d3_panel_up(POP_TOTAL_X1, POP_TOTAL_Y1, POP_TOTAL_X2, POP_TOTAL_Y2 );

	snprintf( str, MAX_STR_LEN+1, _("Total Other Human Units: %s"), misc.format(viewNation->total_human_count) );

	font_san.put( x, y, str );

	snprintf( str, MAX_STR_LEN+1, _("Total Population: %s"), misc.format(viewNation->total_population + viewNation->total_human_count) );

	font_san.put( x+360, y, str );

	//-------- display firm total ---------//

	x=FIRM_BROWSE_X1+9;
	y=FIRM_BROWSE_Y2-16;

	vga_back.d3_panel_up(FIRM_BROWSE_X1, FIRM_BROWSE_Y2-18, FIRM_BROWSE_X2, FIRM_BROWSE_Y2 );

	font_san.put( x	 , y, _("Total") );
	font_san.put( x+265, y, total_firm_count );
	font_san.put( x+370, y, misc.format(total_firm_cost,2) );
	font_san.put( x+470, y, misc.format(total_firm_income,2) );
}
示例#3
0
文件: OR_MIL.cpp 项目: Stummi/7kaa
static void disp_troop_total()
{
	//---- count the total no. of soldiers ----//

	Unit* unitPtr;
	int   totalSoldier=0, totalCommandedSoldier=0;

	int i;
	for( i=unit_array.size() ; i>0 ; i-- )
	{
		if( unit_array.is_deleted(i) )
			continue;

		unitPtr = unit_array[i];

		if( unitPtr->nation_recno != info.viewing_nation_recno )
			continue;

		if( unitPtr->rank_id == RANK_SOLDIER )
			totalSoldier++;
		else
			totalCommandedSoldier += unitPtr->commanded_soldier_count();
	}

	Nation* viewingNation = nation_array[info.viewing_nation_recno];

	for( i=viewingNation->ai_camp_count-1 ; i>=0 ; i-- )
	{
		totalSoldier += firm_array[ viewingNation->ai_camp_array[i] ]->worker_count;
	}

	//--------- paint the area ----------//

	int x=TROOP_BROWSE_X1+9;
	int y=TROOP_BROWSE_Y2-16;

	vga_back.d3_panel_up(TROOP_BROWSE_X1, TROOP_BROWSE_Y2-18, TROOP_BROWSE_X2, TROOP_BROWSE_Y2 );

	//------ display commander count ------//

	String str;

	if( browse_troop.total_rec() > 1 )
		str = "Total Commanders";
	else
		str = "Total Commander";

	str  = translate.process(str);
	str += ": ";
	str += browse_troop.total_rec();

	font_san.put( x, y, str );

	//------ display soldiers under command count ------//

	if( totalCommandedSoldier > 1 )
		str = "Total Soldiers Under Command";
	else
		str = "Total Soldier Under Command";

	str  = translate.process(str);
	str += ": ";
	str += totalCommandedSoldier;

	font_san.put( x+160, y, str );

	//------ display soldiers count ------//

	if( totalSoldier > 1 )
		str = "Total Soldiers";
	else
		str = "Total Soldier";

	str  = translate.process(str);
	str += ": ";
	str += totalSoldier;

#if(defined(FRENCH))
	font_san.put( x+396, y, str );
#else
	font_san.put( x+410, y, str );
#endif
}