本文整理汇总了C++中Nation::add_ship_info方法的典型用法代码示例。如果您正苦于以下问题:C++ Nation::add_ship_info方法的具体用法?C++ Nation::add_ship_info怎么用?C++ Nation::add_ship_info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nation
的用法示例。
在下文中一共展示了Nation::add_ship_info方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init_ai
//--------- Begin of function Unit::init_ai ---------//
//
void Unit::init_ai()
{
is_ai = nation_recno && nation_array[nation_recno]->nation_type == NATION_AI;
if( nation_recno )
{
Nation* nationPtr = nation_array[nation_recno];
if( rank_id==RANK_GENERAL || rank_id==RANK_KING )
nationPtr->add_general_info(sprite_recno);
switch( unit_res[unit_id]->unit_class )
{
case UNIT_CLASS_CARAVAN:
nationPtr->add_caravan_info(sprite_recno);
break;
case UNIT_CLASS_SHIP:
nationPtr->add_ship_info(sprite_recno);
break;
}
}
}
示例2: change_nation
//.........这里部分代码省略.........
//---------------- update vars ----------------//
// unit_group_id = unit_array.cur_group_id++; // separate from the current group
nation_recno = newNationRecno;
home_camp_firm_recno = 0; // reset it
if( race_id )
{
nation_contribution = 0; // contribution to the nation
total_reward = 0;
}
// #### begin Gilbert 24/12 #######//
// -------- reset royal -------//
is_royal = 0;
// #### end Gilbert 24/12 #######//
//-------- if change to one of the existing nations ------//
is_ai = nation_recno && nation_array[nation_recno]->is_ai();
//------------ update AI info --------------//
if( oldNationRecno )
{
Nation* nationPtr = nation_array[oldNationRecno];
if( rank_id == RANK_GENERAL || rank_id == RANK_KING )
nationPtr->del_general_info(sprite_recno);
else if( unit_res[unit_id]->unit_class == UNIT_CLASS_CARAVAN )
nationPtr->del_caravan_info(sprite_recno);
else if( unit_res[unit_id]->unit_class == UNIT_CLASS_SHIP )
nationPtr->del_ship_info(sprite_recno);
}
if( nation_recno )
{
Nation* nationPtr = nation_array[nation_recno];
if( rank_id == RANK_GENERAL || rank_id == RANK_KING )
nationPtr->add_general_info(sprite_recno);
else if( unit_res[unit_id]->unit_class == UNIT_CLASS_CARAVAN )
nationPtr->add_caravan_info(sprite_recno);
else if( unit_res[unit_id]->unit_class == UNIT_CLASS_SHIP )
nationPtr->add_ship_info(sprite_recno);
}
//------ if this unit oversees a firm -----//
if( unit_mode==UNIT_MODE_OVERSEE )
firm_array[unit_mode_para]->change_nation(newNationRecno);
//----- this unit was defending the town before it gets killed ----//
else if( unit_mode==UNIT_MODE_TOWN_DEFENDER )
{
if( !town_array.is_deleted(unit_mode_para) )
town_array[unit_mode_para]->reduce_defender_count();
set_mode(0); // reset unit mode
}
//---- if the unit is no longer the same nation as the leader ----//
if( leader_unit_recno )
{
Unit* leaderUnit = unit_array[leader_unit_recno];
if( leaderUnit->nation_recno != nation_recno )
{
err_when( !leaderUnit->team_info );
leaderUnit->team_info->del_member(sprite_recno);
leader_unit_recno = 0;
// team_id = 0;
}
}
// ##### begin Gilbert 9/2 #######//
explore_area();
// ##### end Gilbert 9/2 #######//
//------ if it is currently selected -------//
if( selected_flag )
info.disp();
err_when( spy_recno && spy_array[spy_recno]->cloaked_nation_recno != nation_recno );
if( spy_recno && spy_array[spy_recno]->cloaked_nation_recno != nation_recno ) // BUGHERE - fix bug on-fly
spy_array[spy_recno]->cloaked_nation_recno = nation_recno;
}