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


C++ Firm::process方法代码示例

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


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

示例1: process

//--------- Begin of function FirmArray::process ---------//
//
// Process all firm in firm_array for action and movement for next frame
//
// Return : 1 - all firm in the FirmArray has been processed
//          0 - only some has been processed, not all
//
int FirmArray::process()
{
   int  i;
	Firm *firmPtr;

	// ####### begin Gilbert 19/11 ######//
	if( sys.day_frame_count == 0 )
	{
		god_res.update_prayer_count();		// count no. of prayer of each god, each nation
	}
	// ####### end Gilbert 19/11 ######//

	//----- each time process some firm only ------//

	for( i=1 ; i<=size() ; i++ )
	{
		firmPtr = (Firm*) get_ptr(i);

		if( !firmPtr )    // the firm has been deleted
			continue;

		err_when(firmPtr->firm_recno!=i);

		//-------- system yield ---------//

		if( i%20==1 )
			sys.yield();

#if defined(ENABLE_LOG)
		String logStr;
		logStr = "begin process firm ";
		logStr += firmPtr->firm_recno;
		logStr += " nation=";
		logStr += firmPtr->nation_recno;
		LOG_MSG(logStr);
#endif
	
		if(i==50)
		{

			FirmMarket *mPtr = (FirmMarket*) firmPtr;
			MarketGoods *marketGoods = mPtr->market_goods_array;
			marketGoods++;

			if(marketGoods->stock_qty)
				int debug = 0;
		}

		// ##### begin Gilbert 18/5 ########//

		//-------- process visibility -----------//

		if( i%FRAMES_PER_DAY == int(sys.frame_count%FRAMES_PER_DAY) )	// only process each firm once per day
		{
			// before under construction checking 

			if( firmPtr->explore_for_player() )
			{
				world.visit( firmPtr->loc_x1, firmPtr->loc_y1, firmPtr->loc_x2, firmPtr->loc_y2, EXPLORE_RANGE-1 );
			}
		}
		// ##### begin Gilbert 18/5 ########//


		//------ if the firm is under construction ------//

		if( firmPtr->under_construction )
		{
			LOG_MSG(" process_construction");
			firmPtr->process_construction();
			LOG_MSG(m.get_random_seed() );
			continue;
		}

		//------ if the firm is being upgrade ------//

		if( firmPtr->upgrading_firm_id )
		{
			if( firmPtr->process_upgrade() )
				continue;
		}

		// ###### begin Gilbert 4/1 #######//
		firmPtr->process();
		// ###### end Gilbert 4/1 #######//

		//--------- process and process_ai firms ----------//

		if( i%FRAMES_PER_DAY == int(sys.frame_count%FRAMES_PER_DAY) )	// only process each firm once per day
		{
			#ifdef DEBUG
			unsigned long profileStartTime = m.get_time();
			#endif
//.........这里部分代码省略.........
开发者ID:mecirt,项目名称:7k2,代码行数:101,代码来源:ofirma.cpp


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