WalkerBuddy
Checks walker neighborhood and step suggestions
Syntax: WalkerBuddy(wa,wb,step)
wasource walker for neighborhood checkwbwalker to check if is in neighborhoodstepplace where suggested step will be stored
Returns: This function returns a value that represents the relationship between wa and wb.
0
wais on same spot aswb1
wamust do a perpendicular step to reachwb2
wamust do a diagonal step to reachwb3
wais too far to reachwbin one single step
Notes: This function checks if wb is in close neighborhood to wa. It also suggests a step which wa can perform to reach the spot of wb. In case wb is too far away from wa number 3 is returned and step is filled by STEP_NONE.
Example:
if(WalkerBuddy(wa,wb,step)<3) {...}, ifwbis close towado ...WalkerBuddy(wa,wb,step), ifwbis close towa, put the step into step
Last updated