Bazaar developer reference

CvUnit::IsDeclareWar() const

Defined in
CvUnit.cpp, line 22561
Class
CvUnit
Hook name
CivHooks::CvUnit_IsDeclareWar

Hooks

static bool BeforeCvUnit_IsDeclareWar(const CvUnit* self, bool& result);static void AfterCvUnit_IsDeclareWar(const CvUnit* self, bool& result);static bool ReplaceCvUnit_IsDeclareWar(bool (*original)(const CvUnit*), const CvUnit* self);CivRegisterBefore<CivHooks::CvUnit_IsDeclareWar>(host, &BeforeCvUnit_IsDeclareWar);CivRegisterAfter<CivHooks::CvUnit_IsDeclareWar>(host, &AfterCvUnit_IsDeclareWar);CivRegisterReplace<CivHooks::CvUnit_IsDeclareWar>(host, &ReplaceCvUnit_IsDeclareWar);

Code

22561bool CvUnit::IsDeclareWar() const22562{22563	VALIDATE_OBJECT22564	if(isHuman())22565	{22566		return false;22567	}22568	else22569	{22570		switch(AI_getUnitAIType())22571		{22572		case UNITAI_UNKNOWN:22573		case UNITAI_SETTLE:22574		case UNITAI_WORKER:22575			break;22576		case UNITAI_CITY_BOMBARD:22577			return true;22578			break;2257922580		case UNITAI_ATTACK:22581		case UNITAI_FAST_ATTACK:22582		case UNITAI_PARADROP:22583		case UNITAI_DEFENSE:22584		case UNITAI_COUNTER:22585		case UNITAI_RANGED:22586		case UNITAI_CITY_SPECIAL:22587		case UNITAI_EXPLORE:22588		case UNITAI_ARTIST:22589		case UNITAI_SCIENTIST:22590		case UNITAI_GENERAL:22591		case UNITAI_MERCHANT:22592		case UNITAI_ENGINEER:22593		case UNITAI_ICBM:22594		case UNITAI_WORKER_SEA:22595		case UNITAI_SPACESHIP_PART:22596		case UNITAI_TREASURE:22597		case UNITAI_PROPHET:22598		case UNITAI_MISSIONARY:22599		case UNITAI_INQUISITOR:22600		case UNITAI_ADMIRAL:22601		case UNITAI_TRADE_UNIT:22602		case UNITAI_ARCHAEOLOGIST:22603		case UNITAI_WRITER:22604		case UNITAI_MUSICIAN:22605			break;2260622607		case UNITAI_ATTACK_SEA:22608		case UNITAI_RESERVE_SEA:22609		case UNITAI_ESCORT_SEA:22610		case UNITAI_EXPLORE_SEA:22611		case UNITAI_ASSAULT_SEA:22612			break;2261322614		case UNITAI_SETTLER_SEA:22615		case UNITAI_CARRIER_SEA:22616		case UNITAI_MISSILE_CARRIER_SEA:22617		case UNITAI_PIRATE_SEA:22618		case UNITAI_ATTACK_AIR:22619		case UNITAI_DEFENSE_AIR:22620		case UNITAI_CARRIER_AIR:22621		case UNITAI_MISSILE_AIR:22622			break;2262322624		default:22625			CvAssert(false);22626			break;22627		}22628	}2262922630	return false;22631}

Calls

Called by