|
Britbot
|
This implements the GetDirection of the ITarget interface it returns the best direction to keep the given group (which asked for directions) in a path perpendicular to the direction of the enemy ship thus ensuring that it will reach it as soon as possible.
Implements Britbot.ITarget. Definition at line 191 of file EnemyGroup.cs. {
//calculates the direction based on the geographical data from the game
//first check if stationary
if (Math.Abs(this.GetHeading().Norm()) < Magic.VectorTolerance)
return Navigator.CalculateDirectionToStationeryTarget(group.FindCenter(true), group.Heading,
this.GetLocation());
//otherwise
return Navigator.CalculateDirectionToMovingTarget(group.FindCenter(true), group.Heading, GetLocation(),
this.GetHeading());
}
|
1.7.6.1