class PlayerAndField
Attributes
field[RW]
player[RW]
Public Class Methods
new(player)
click to toggle source
# File lib/nicktroyanov_riverbattle/player_and_field.rb, line 5 def initialize player @player = player @field = [0]*10 end
Public Instance Methods
player_congratulate()
click to toggle source
# File lib/nicktroyanov_riverbattle/player_and_field.rb, line 22 def player_congratulate player.congratulate end
player_make_turn(oponent_field)
click to toggle source
# File lib/nicktroyanov_riverbattle/player_and_field.rb, line 14 def player_make_turn oponent_field player.make_turn oponent_field, field end
player_place_ships(number_of_ships = 5)
click to toggle source
# File lib/nicktroyanov_riverbattle/player_and_field.rb, line 10 def player_place_ships number_of_ships = 5 player.place_ships field, number_of_ships end
player_show_field(oponent_field)
click to toggle source
# File lib/nicktroyanov_riverbattle/player_and_field.rb, line 26 def player_show_field oponent_field player.show_field field, oponent_field end
player_win_condition?()
click to toggle source
# File lib/nicktroyanov_riverbattle/player_and_field.rb, line 18 def player_win_condition? player.win_condition? field end