Add bot actions to flash messages
This commit is contained in:
parent
381f67f93b
commit
825d22e827
@ -35,7 +35,13 @@ class TablesController < ApplicationController
|
||||
# TODO refactor to ensure play for 2nd and 3rd place
|
||||
|
||||
if @game.controlling_player.try("is_bot?")
|
||||
@game.controlling_player.auto_play
|
||||
bot_action = @game.controlling_player.auto_play
|
||||
flash[:notice] ||= ""
|
||||
if bot_action == "pass" # TODO bot passes notify
|
||||
flash[:notice] << " #{@game.controlling_player.display_name} passed."
|
||||
else
|
||||
flash[:notice] << " #{@game.controlling_player.display_name} played #{bot_action}"
|
||||
end
|
||||
@game.save
|
||||
@game.reload
|
||||
end
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
.original_flash_message_code
|
||||
.original_flash_message_code#flash_message
|
||||
- flash.each do |key, value|
|
||||
%div{class: "alert alert-#{key}"}
|
||||
= value
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user