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


C++ Nation::add_firm_info方法代码示例

本文整理汇总了C++中Nation::add_firm_info方法的典型用法代码示例。如果您正苦于以下问题:C++ Nation::add_firm_info方法的具体用法?C++ Nation::add_firm_info怎么用?C++ Nation::add_firm_info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Nation的用法示例。


在下文中一共展示了Nation::add_firm_info方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: change_nation


//.........这里部分代码省略.........
		unitPtr->change_nation(newNationRecno);

		//--- if this is a spy, chance its cloak ----//

		if( unitPtr->spy_recno )
			spy_array[unitPtr->spy_recno]->cloaked_nation_recno = newNationRecno;
	}

	//---------- stop all actions attacking this firm --------//

	unit_array.stop_attack_obj(base_obj_recno);

	//---- update nation_unit_count_array[] ----//

	FirmInfo* firmInfo = firm_res[firm_id];

	if( nation_recno )
		firmInfo->dec_nation_firm_count(nation_recno);

	if( newNationRecno )
		firmInfo->inc_nation_firm_count(newNationRecno);

	//---- reset should_close_flag -----//

	if( is_ai )
	{
		if( should_close_flag )
		{
			if( oldNationPtr )
			{
				oldNationPtr->firm_should_close_array[firm_id-1]--;
				err_when( oldNationPtr->firm_should_close_array[firm_id-1] < 0 );
			}

			should_close_flag = 0;
		}
	}

	//------- update player_spy_count -------//

	spy_array.update_firm_spy_count(firm_recno);

	//--- update the cloaked_nation_recno of all spies in the firm ---//

	spy_array.change_cloaked_nation(SPY_FIRM, firm_recno, nation_recno, newNationRecno);		// check the cloaked nation recno of all spies in the firm

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

	if( oldNationPtr )
		oldNationPtr->del_firm_info(firm_id, firm_recno);

	//------ update power nation recno ----------//

	if( should_set_power )
		world.restore_power(loc_x1, loc_y1, loc_x2, loc_y2, 0, firm_recno);

	should_set_power = get_should_set_power();

	if( should_set_power )
		world.set_power(loc_x1, loc_y1, loc_x2, loc_y2, newNationRecno);        // set power of the new nation

	//------------ update link --------------//

	release_link();		// need to update link because firms are only linked to firms of the same nation

	nation_recno = newNationRecno;

	setup_link();

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

	if (!newNationRecno)
		is_ai = 1;
	else
	{
		is_ai = nation_array[nation_recno]->is_ai();
		newNationPtr->add_firm_info(firm_id, firm_recno);
	}

	//--- if a nation set up a town in a location that the player has explored, contact between the nation and the player is established ---//

	establish_contact_with_player();

	//---- reset the action mode of all spies in this town ----//

	spy_array.set_action_mode( SPY_FIRM, firm_recno, SPY_IDLE );      // we need to reset it. e.g. when we have captured an enemy town, SPY_SOW_DISSENT action must be reset to SPY_IDLE

	//-- refresh display if this firm is currently selected --//

	if( firm_array.selected_recno == firm_recno )
		info.disp();

	// ####### begin Gilbert 5/7 ########//
	if( explore_for_player() )
	{
		world.unveil( loc_x1, loc_y1, loc_x2, loc_y2 );
		world.visit( loc_x1, loc_y1, loc_x2, loc_y2, EXPLORE_RANGE-1 );
	}
	// ####### end Gilbert 5/7 ########//
}
开发者ID:112212,项目名称:7k2,代码行数:101,代码来源:ofirm.cpp


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