Sha256: 1fe32643cd4757aca8f22b1491cb6e3fb8ebca250550a4a83a46ec7a5c236a06

Contents?: true

Size: 646 Bytes

Versions: 11

Compression:

Stored size: 646 Bytes

Contents

# frozen_string_literal: true

module Codebreaker
  class Difficulties
    LEVELS = {
      easy: {
        attempts: 15,
        hints: 2
      },
      medium: {
        attempts: 10,
        hints: 2
      },
      hell: {
        attempts: 5,
        hints: 1
      }
    }.freeze
    attr_reader :level, :attempts, :hints

    def initialize(difficulties)
      @level = difficulties
      @attempts = LEVELS[difficulties.to_sym][:attempts]
      @hints = LEVELS[difficulties.to_sym][:hints]
    end

    class << self
      def valid_difficult(difficulties)
        Verifier.verify_valid_difficult(difficulties)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
codebreaker_rg_game-1.11 lib/codebreaker/entities/difficulties.rb
codebreaker_rg_game-1.10 lib/codebreaker/entities/difficulties.rb
codebreaker_rg_game-1.9 lib/codebreaker/entities/difficulties.rb
codebreaker_rg_game-1.8 lib/codebreaker/entities/difficulties.rb
codebreaker_rg_game-1.7 lib/codebreaker/entities/difficulties.rb
codebreaker_rg_game-1.6 lib/codebreaker/entities/difficulties.rb
codebreaker_rg_game-1.5 lib/codebreaker/entities/difficulties.rb
codebreaker_rg_game-1.3 lib/codebreaker/entities/difficulties.rb
codebreaker_rg_game-1.2 lib/codebreaker/entities/difficulties.rb
codebreaker_rg_game-1.1 lib/codebreaker/entities/difficulties.rb
codebreaker_rg_game-1.0 lib/codebreaker/entities/difficulties.rb