* Displays the right popup for a specific target. * @param target Pointer to target. */
| 117 | * @param target Pointer to target. |
| 118 | */ |
| 119 | void MultipleTargetsState::popupTarget(Target *target) |
| 120 | { |
| 121 | _game->popState(); |
| 122 | if (_craft == 0) |
| 123 | { |
| 124 | Base* b = dynamic_cast<Base*>(target); |
| 125 | Craft* c = dynamic_cast<Craft*>(target); |
| 126 | Ufo* u = dynamic_cast<Ufo*>(target); |
| 127 | if (b != 0) |
| 128 | { |
| 129 | _game->pushState(new InterceptState(_game, _state->getGlobe(), b)); |
| 130 | } |
| 131 | else if (c != 0) |
| 132 | { |
| 133 | _game->pushState(new GeoscapeCraftState(_game, c, _state->getGlobe(), 0)); |
| 134 | } |
| 135 | else if (u != 0) |
| 136 | { |
| 137 | _game->pushState(new UfoDetectedState(_game, u, _state, false, u->getHyperDetected())); |
| 138 | } |
| 139 | else |
| 140 | { |
| 141 | _game->pushState(new TargetInfoState(_game, target, _state->getGlobe())); |
| 142 | } |
| 143 | } |
| 144 | else |
| 145 | { |
| 146 | _game->pushState(new ConfirmDestinationState(_game, _craft, target)); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * Returns to the previous screen. |
nothing calls this directly
no test coverage detected