mpf.core.ball_search
¶
Implements the ball search procedure.
-
class
mpf.core.ball_search.
BallSearch
(machine, playfield)¶ Ball search controller.
Initialise ball search.
-
cancel_ball_search
(**kwargs)¶ Cancel the current ballsearch and mark the ball as missing.
-
disable
()¶ Disable ball search.
Will stop the ball search if it is running.
-
enable
()¶ Enable but do not start ball search.
Ball search is started by a timeout. Enable also resets that timer.
-
give_up
()¶ Give up the ball search.
Did not find the missing ball. Execute the failed action which either adds a replacement ball or ends the game.
-
register
(priority, callback)¶ Register a callback for sequential ballsearch.
Callbacks are called by priority. Ball search only waits if the callback returns true.
Parameters: - priority – priority of this callback in the ball search procedure
- callback – callback to call. ball search will wait before the next callback, if it returns true
-
request_to_start_game
(**kwargs)¶ Method registered for the request_to_start_game event.
Returns false if the ball search is running.
-
reset_timer
()¶ Reset the start timer.
Called by playfield.
-
run
()¶ Run one iteration of the ball search.
Will schedule itself for the next run.
-
start
()¶ Actually start ball search.
-