kylemcdonald / BaristaBot

BaristaBot draws your portrait in your latte.
Other
11 stars 4 forks source link

add scenes/states #6

Open kylemcdonald opened 11 years ago

kylemcdonald commented 11 years ago

we need a simple model of what states we can be in (looking at user, processing image, drawing in latte, uploading images) and what the transitions look like. then we need to separate each of those states into a class that can be called from the main app (which will probably be BaristaBotApp). switching from scene to scene will be done with a very simple human-barista controlled device (e.g., keyboard).

separating the scenes like this allows us to develop and debug them separately, and debug the state changes separately from the scenes themselves.

jamiezigelbaum commented 11 years ago

Here's a state diagram. I don't think that each scene needs human input to begin, many can flow naturally. I put the keydown events in this diagram to illustrate where human input is needed (e.g. to take a photo of a new face) and where it can happen (e.g. 'esc' always stops immediately and goes to idle; 'u' always uploads last image).

UPDATE: a more concise diagram could make PRINT and REPRINT the same state with different edges leading to them. For the code, best to have just one print method.

state diagram