* Called every time there's a mouse release over the surface. * Allows the surface to have custom functionality for this action, * and can be called externally to simulate the action. * @param action Pointer to an action. * @param state State that the action handlers belong to. */
| 269 | * @param state State that the action handlers belong to. |
| 270 | */ |
| 271 | void InteractiveSurface::mouseRelease(Action *action, State *state) |
| 272 | { |
| 273 | std::map<Uint8, ActionHandler>::iterator allHandler = _release.find(0); |
| 274 | std::map<Uint8, ActionHandler>::iterator oneHandler = _release.find(action->getDetails()->button.button); |
| 275 | if (allHandler != _release.end()) |
| 276 | { |
| 277 | ActionHandler handler = allHandler->second; |
| 278 | (state->*handler)(action); |
| 279 | } |
| 280 | if (oneHandler != _release.end()) |
| 281 | { |
| 282 | ActionHandler handler = oneHandler->second; |
| 283 | (state->*handler)(action); |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | /** |
| 288 | * Called every time there's a mouse click on the surface. |
nothing calls this directly
no test coverage detected