|
Britbot
|
Given two pirates (id) it tells you who is "more" in a specific direction than the other.
Definition at line 185 of file Navigator.cs. {
HeadingVector originDif = new HeadingVector(Bot.Game.GetMyPirate(p1).Loc.Col,
Bot.Game.GetMyPirate(p1).Loc.Row);
int coef;
if (originDif * hv > 0)
coef = 1;
else
coef = -1;
//calculate both pirates position on the line created by hv
double p1Dist = Navigator.CalcDistFromLine(new Location(0, 0), (Bot.Game.GetMyPirate(p1)).Loc,
hv.Orthogonal());
double p2Dist = Navigator.CalcDistFromLine(new Location(0, 0), (Bot.Game.GetMyPirate(p2)).Loc,
hv.Orthogonal());
return coef * p1Dist.CompareTo(p2Dist);
}
|
1.7.6.1