Method: Codebreaker::Player#initialize

Defined in:
lib/codebraker_ov/entities/player.rb

#initialize(name, difficulty) ⇒ Player

Returns a new instance of Player.



14
15
16
17
18
19
20
21
22
23
# File 'lib/codebraker_ov/entities/player.rb', line 14

def initialize(name, difficulty)
  @name = name
  @difficulty = difficulty
  @attempts_total = Game::DIFFICULTIES[difficulty][:attempts]
  @attempts_used = nil
  @hints_total = Game::DIFFICULTIES[difficulty][:hints]
  @hints_used = nil
  @rating = nil
  @date = nil
end