Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make console block for entire game, and better binding in repl during…

… choices
  • Loading branch information...
commit 188b60834b4c5dfcd6e4d92940ec3eddabdcfba9 1 parent 51dcd6f
@carter-thaxton authored
Showing with 7 additions and 4 deletions.
  1. +5 −2 lib/console_strategy.rb
  2. +1 −1  lib/game.rb
  3. +1 −1  play
View
7 lib/console_strategy.rb
@@ -6,7 +6,7 @@ class Console
@@fiber = nil
@@waiting_for_response = false
- def self.start_new_game(options = {})
+ def self.play_game(options = {})
g = Game.new options.merge(:strategy => ConsoleStrategy.new)
p1 = g.players[0]
p2 = g.players[1]
@@ -18,7 +18,10 @@ def self.start_new_game(options = {})
puts "Bye!"
exit
end
- f.resume
+ loop do
+ f.resume
+ Pry.start binding
+ end
end
def self.get_response
View
2  lib/game.rb
@@ -176,7 +176,7 @@ def move_to_next_player
def log(message)
#puts message
end
-
+
private
def create_players(options)
View
2  play
@@ -1 +1 @@
-pry -I lib -r dominion -e 'Console.start_new_game;'
+pry -I lib -r dominion -e 'Console.play_game;'
Please sign in to comment.
Something went wrong with that request. Please try again.