Example #1
0
//-------- Begin of function Town::think_capture_linked_firm --------//
//
// Try to capture firms linked to this town if all the workers in firms
// resident in this town. 
//
void Town::think_capture_linked_firm()
{
	Firm* firmPtr;

	//----- scan for linked firms -----//

	for( int i=linked_firm_count-1 ; i>=0 ; i-- )
	{
		firmPtr = firm_array[ linked_firm_array[i] ];

		if( firmPtr->nation_recno == nation_recno )		// this is our own firm
			continue;

		if( firmPtr->can_worker_capture(nation_recno) )	// if we can capture this firm, capture it now
		{
			firmPtr->capture_firm(nation_recno);
		}
	}
}