* Returns if a certain target is detected by the craft's * radar, taking in account the range and chance. * @param target Pointer to target to compare. * @return True if it's detected, False otherwise. */
| 692 | * @return True if it's detected, False otherwise. |
| 693 | */ |
| 694 | bool Craft::detect(Target *target) const |
| 695 | { |
| 696 | if (_rules->getRadarRange() == 0) |
| 697 | return false; |
| 698 | double range = _rules->getRadarRange() * (1 / 60.0) * (M_PI / 180); |
| 699 | return (getDistance(target) <= range); |
| 700 | } |
| 701 | |
| 702 | /** |
| 703 | * Consumes the craft's fuel every 10 minutes |
nothing calls this directly
no test coverage detected