hexDistance(int, int)
- Defined in
- CvGameCoreUtils.h, line 94
- Not a hook point
- written in a header
Code
94inline int hexDistance(int iDX, int iDY)95{96 // I'm assuming iDX and iDY are in hex-space97 if((iDX >= 0) == (iDY >= 0)) // the signs match98 {99 int iAbsDX = iDX >= 0 ? iDX : -iDX;100 int iAbsDY = iDY >= 0 ? iDY : -iDY;101 return iAbsDX + iAbsDY;102 }103 else104 {105 int iAbsDX = iDX >= 0 ? iDX : -iDX;106 int iAbsDY = iDY >= 0 ? iDY : -iDY;107 return iAbsDX >= iAbsDY ? iAbsDX : iAbsDY;108 }109}
Called by
- CvFractal::ridgeBuilder(CvRandom &, int, int, int, int)
- getRotatedPosition(int, int, DirectionTypes, int &, int &)
- plotCityXY(const CvCity *, const CvPlot *)
- CvPlot::changeAdjacentSight(TeamTypes, int, bool, InvisibleTypes, DirectionTypes, CvUnit *)
- CvCitySiteEvaluator::CanFound(CvPlot *, const CvPlayer *, bool) const
- CvTargeting::CanSeeDisplacementPlot(int, int, int, int, int)