The Stub sets up the
hardware in
the system.
When the system starts up, the Stub checks for the flippers
in the system. The system finds the locations of the flippers by flipping
each flipper a set number of times. It takes the over all change in the image
and averages the center of that to be the flipper.
If there is a flipper's file available it reads in the locations and skips the flipper test. It then stores the location back the file. It saves the file regardless.
A statistics object, Stats, is created to keep track of ball
in play, time in play, number of hits, number of ball, and other statistical
information about game play.
A StrategyQueue is created
to keep track of the buffers waiting to be used by the strategy.
The logging of the information is done to the
PinballLog.
Logs the locations of the flippers.
It checks the objects in the frame to see which is one is the ball.
Logs each of the objects and which one is considered to be the ball.
It then does the statistics for the ball.
The Buffer is placed in the StrategyQueue.
The Stub will notify the strategy when it's done with a
Buffer.
Every 100 frames, the frame rate statistics are displayed on the screen.