There should be exactly four actions: index, new, join, and rejoin.
After any action other than index, there should always be a Match model at least partially created.
The _wait_for_players_to_connect partial should be shown after (and only after) each action other than index. Everything to finish setting up the match should be done in this partial before calling PlayerActionsController#index.
There must be at least one slice in the Match instance before calling PlayerActionsController#index
#index
Only creates a blank Match and provides the user with forms for the other match start actions.
#new
Must finish creating a Match instance from the user's submitted form
Must have the TableManager (in this order):
Spawn a dealer
Spawn all automatic opponents
Create a proxy and connect it to the dealer
#join
Must find the Match instance specified by the user specified match name and seat, then must create a new Match instance with identical properties except that the seat is changed
Must then follow the same procedure as that followed by #rejoin after finding a match ID
#rejoin
Must find the Match instance specified by the user specified match name and seat and provide this ID to PlayerActionsController#index.
Issues NO requests to TableManager
PlayerActionsController
Match must be completely set up and all players must be connected to the dealer before any action in this controller is called.
#index
Displays the first match slice regardless of how many are present in the Match instance. Does nothing else.
#update
Deletes the first match slice and displays the next one (restoring the previous slice if no other slice is present).
Should only be called when there is a new slice to be displayed.
MatchStartController
index
,new
,join
, andrejoin
.Match
model at least partially created._wait_for_players_to_connect
partial should be shown after (and only after) each action other thanindex
. Everything to finish setting up the match should be done in this partial before callingPlayerActionsController#index
.Match
instance before callingPlayerActionsController#index
#index
Match
and provides the user with forms for the other match start actions.#new
Match
instance from the user's submitted formTableManager
(in this order):dealer
dealer
#join
Match
instance specified by the user specified match name and seat, then must create a newMatch
instance with identical properties except that the seat is changed#rejoin
after finding a match ID#rejoin
Match
instance specified by the user specified match name and seat and provide this ID toPlayerActionsController#index
.TableManager
PlayerActionsController
#index
Match
instance. Does nothing else.#update