Bazaar developer reference

CvUnit::changeFeatureHalfMoveCount(FeatureTypes, int)

Defined in
CvUnit.cpp, line 20300
Class
CvUnit
Hook name
CivHooks::CvUnit_changeFeatureHalfMoveCount

Hooks

static bool BeforeCvUnit_changeFeatureHalfMoveCount(CvUnit* self, FeatureTypes eIndex, int iChange);static void AfterCvUnit_changeFeatureHalfMoveCount(CvUnit* self, FeatureTypes eIndex, int iChange);static void ReplaceCvUnit_changeFeatureHalfMoveCount(void (*original)(CvUnit*, FeatureTypes, int), CvUnit* self, FeatureTypes eIndex, int iChange);CivRegisterBefore<CivHooks::CvUnit_changeFeatureHalfMoveCount>(host, &BeforeCvUnit_changeFeatureHalfMoveCount);CivRegisterAfter<CivHooks::CvUnit_changeFeatureHalfMoveCount>(host, &AfterCvUnit_changeFeatureHalfMoveCount);CivRegisterReplace<CivHooks::CvUnit_changeFeatureHalfMoveCount>(host, &ReplaceCvUnit_changeFeatureHalfMoveCount);

Code

20300void CvUnit::changeFeatureHalfMoveCount(FeatureTypes eIndex, int iChange)20301{20302	VALIDATE_OBJECT20303	CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");20304	CvAssertMsg(eIndex < GC.getNumFeatureInfos(), "eIndex is expected to be within maximum bounds (invalid Index)");20305	m_featureHalfMoveCount.setAt(eIndex, m_featureHalfMoveCount[eIndex] + iChange);20306	CvAssert(getFeatureHalfMoveCount(eIndex) >= 0);20307}

Calls

Called by