Class: CARPS::StartGameInterface
- Inherits:
-
QuitInterface
- Object
- Interface
- QuitInterface
- CARPS::StartGameInterface
- Includes:
- ControlInterface
- Defined in:
- lib/carps/service/start/interface.rb
Overview
Interface to start games
Direct Known Subclasses
Class Method Summary collapse
-
.start_game_interface(mailer, config, manager) ⇒ Object
Start interface.
Instance Method Summary collapse
-
#initialize(continuation, mailer, game_config, manager) ⇒ StartGameInterface
constructor
A new instance of StartGameInterface.
Methods included from ControlInterface
Methods inherited from Interface
Constructor Details
#initialize(continuation, mailer, game_config, manager) ⇒ StartGameInterface
Returns a new instance of StartGameInterface.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/carps/service/start/interface.rb', line 43 def initialize continuation, mailer, game_config, manager @manager = manager @manager.none @mailer = mailer @game_config = game_config @continuation = continuation super() add_command "games", "List existing games." add_command "load", "Load an existing game.", "NAME" end |
Class Method Details
.start_game_interface(mailer, config, manager) ⇒ Object
Start interface
33 34 35 36 37 38 39 40 41 |
# File 'lib/carps/service/start/interface.rb', line 33 def StartGameInterface.start_game_interface mailer, config, manager loop do choice = callcc do |continuation| interface = self.new continuation, mailer, config, manager interface.run end choice.call end end |