本文整理汇总了C++中Firm::next_day方法的典型用法代码示例。如果您正苦于以下问题:C++ Firm::next_day方法的具体用法?C++ Firm::next_day怎么用?C++ Firm::next_day使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Firm
的用法示例。
在下文中一共展示了Firm::next_day方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
//.........这里部分代码省略.........
//------ 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
// //-------- process visibility -----------//
//
// if( firmPtr->explore_for_player() )
// {
// world.visit( firmPtr->loc_x1, firmPtr->loc_y1, firmPtr->loc_x2, firmPtr->loc_y2, EXPLORE_RANGE-1 );
// }
LOG_MSG(" next_day");
firmPtr->next_day();
LOG_MSG(m.get_random_seed() );
#ifdef DEBUG
firm_profile_time += m.get_time() - profileStartTime;
#endif
//-- if the hit points drop to zero, the firm should be deleted --//
if( firmPtr->hit_points <=0 )
{
se_res.sound( firmPtr->center_x, firmPtr->center_y, 1, 'F', firmPtr->firm_id, "DEST" );
del_firm( firmPtr->firm_recno );
continue;
}
//--------- process AI ------------//
#ifdef DEBUG
if( config.disable_ai_flag==0 && firmPtr->is_ai )
#else
if( firmPtr->is_ai )
#endif
{
LOG_MSG(" process_common_ai");
firmPtr->process_common_ai();
LOG_MSG(m.get_random_seed() );
#ifdef DEBUG
unsigned long profileAiStartTime = m.get_time();
#endif
LOG_MSG(" process_ai");
firmPtr->process_ai();
LOG_MSG(m.get_random_seed());
#ifdef DEBUG
firm_ai_profile_time += m.get_time() - profileAiStartTime;
#endif
if( is_deleted(i) ) // the firm may have been deleted in process_ai()
continue;
}
}
//-------- process animation ---------//
LOG_MSG(" process_animation");
firmPtr->process_animation();
LOG_MSG( m.get_random_seed() );
//-------- process monster firm ---------//
LOG_MSG(" process_animation");
firmPtr->process_monster_firm();
LOG_MSG( m.get_random_seed() );
}
return 0;
}