Ejemplo n.º 1
0
/// Can all units in this army move on ocean?
bool CvArmyAI::IsAllOceanGoing()
{
	CvUnit* pUnit = GetFirstUnit();
	while(pUnit)
	{
		if(pUnit->getDomainType() != DOMAIN_SEA && !pUnit->IsHasEmbarkAbility())
		{
			return false;
		}

		// If can move over ocean, not a coastal vessel
		if(pUnit->isTerrainImpassable(TERRAIN_OCEAN))
		{
			return false;
		}

		pUnit = GetNextUnit(pUnit);
	}

	return true;
}