本文整理汇总了C++中Firm::is_worker_full方法的典型用法代码示例。如果您正苦于以下问题:C++ Firm::is_worker_full方法的具体用法?C++ Firm::is_worker_full怎么用?C++ Firm::is_worker_full使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Firm
的用法示例。
在下文中一共展示了Firm::is_worker_full方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ai_assign_spy_to_firm
//--------- Begin of function Nation::ai_assign_spy_to_firm --------//
//
// Think about sending spies to the specific firm.
//
// return: <int> 1 - a spy is assigned successfully.
// 0 - failure.
//
int Nation::ai_assign_spy_to_firm(int firmRecno)
{
Firm* firmPtr = firm_array[firmRecno];
err_when( !firmPtr->worker_array );
//---- check if the firm is full or not -----//
if( firmPtr->nation_recno == nation_recno ) // if it's our own firm
{
if( firmPtr->is_worker_full() ) // use is_worker_full() for own firms as it take into account of units patrolling outside
return 0;
}
else
{
if( firmPtr->worker_count == MAX_WORKER )
return 0;
}
//------ look for an existing spy -------//
int raceId = firmPtr->majority_race();
int mobileOnly = firmPtr->nation_recno == nation_recno; // if assign to own firms/firms, only get mobile spies, don't get spies from existing firms/firms as that will result in a loop effect
return ai_assign_spy( firmPtr->loc_x1, firmPtr->loc_y1, raceId, mobileOnly );
}