protected virtual bool ShouldChangeToDefending() { var shouldSwitch = false; var goalLocation = Field.GetMyGoal(); var ballDistToGoal = Field.GetDist(Ball.Location, goalLocation); if (Field.IsBallOnMySide(Ball)) { if (Field.CloserToTarget(Info.Location, Ball.Location, goalLocation)) { shouldSwitch = true; } } return(shouldSwitch); }