Class: TTT::PlayersFactory
- Inherits:
-
Object
- Object
- TTT::PlayersFactory
- Defined in:
- lib/games/tictactoe/players_factory.rb
Instance Method Summary collapse
Instance Method Details
#generate_players(config) ⇒ Object
5 6 7 8 9 |
# File 'lib/games/tictactoe/players_factory.rb', line 5 def generate_players(config) player_1 = TTT::Player.new(value: config.player_1_value, name: config.player_1_name, type: :human) player_2 = TTT::Player.new(value: config.player_2_value, name: config.player_2_name, type: config.player_2_type, difficulty_level: config.computer_difficulty_level) [player_1, player_2] end |