* Called every time there's a mouse press 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. */
| 246 | * @param state State that the action handlers belong to. |
| 247 | */ |
| 248 | void InteractiveSurface::mousePress(Action *action, State *state) |
| 249 | { |
| 250 | std::map<Uint8, ActionHandler>::iterator allHandler = _press.find(0); |
| 251 | std::map<Uint8, ActionHandler>::iterator oneHandler = _press.find(action->getDetails()->button.button); |
| 252 | if (allHandler != _press.end()) |
| 253 | { |
| 254 | ActionHandler handler = allHandler->second; |
| 255 | (state->*handler)(action); |
| 256 | } |
| 257 | if (oneHandler != _press.end()) |
| 258 | { |
| 259 | ActionHandler handler = oneHandler->second; |
| 260 | (state->*handler)(action); |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | /** |
| 265 | * Called every time there's a mouse release over the surface. |
nothing calls this directly
no test coverage detected