Sha256: 798fcfe3cce0ab2de6b160d66f1b794460ae25e5bc5810910a7ca244f3ea1662

Contents?: true

Size: 549 Bytes

Versions: 20

Compression:

Stored size: 549 Bytes

Contents

# Holds information about an Tournament::Entry's possibilities for
# remaining games in a tournament.
class Tournament::Possibility
  include Comparable
  attr_accessor :times_champ, :max_score, :min_rank
  attr_reader :champs, :entry
  def initialize(entry)
    @times_champ = 0
    @max_score = 0
    @min_rank = 1_000_000_000
    @champs = {}
    @entry = entry
  end
  def <=>(other)
    (other.times_champ <=> self.times_champ).nonzero? ||
      (self.min_rank <=> other.min_rank).nonzero? ||
      other.max_score <=> self.max_score
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
tournament-4.0.2 lib/tournament/possibility.rb
tournament-4.0.0 lib/tournament/possibility.rb
tournament-3.3.3 lib/tournament/possibility.rb
tournament-3.3.2 lib/tournament/possibility.rb
tournament-3.3.1 lib/tournament/possibility.rb
tournament-3.3.0 lib/tournament/possibility.rb
tournament-3.2.2 lib/tournament/possibility.rb
tournament-3.2.1 lib/tournament/possibility.rb
tournament-3.2.0 lib/tournament/possibility.rb
tournament-3.1.1 lib/tournament/possibility.rb
tournament-3.1.0 lib/tournament/possibility.rb
tournament-3.0.3 lib/tournament/possibility.rb
tournament-3.0.2 lib/tournament/possibility.rb
tournament-3.0.1 lib/tournament/possibility.rb
tournament-3.0.0 lib/tournament/possibility.rb
tournament-2.5.0 lib/tournament/possibility.rb
tournament-2.4.0 lib/tournament/possibility.rb
tournament-2.5.1 lib/tournament/possibility.rb
tournament-2.5.2 lib/tournament/possibility.rb
tournament-2.6.0 lib/tournament/possibility.rb