Class: Osu::DB::CTBScore

Inherits:
Score
  • Object
show all
Defined in:
lib/osu-db/score.rb

Overview

Score of Catch The Beat Mode

Instance Attribute Summary

Attributes inherited from Score

#beatmapcode, #combo, #datetime, #dummy, #game_mode, #geki, #katsu, #miss, #mods, #perfect, #score, #scorecode, #scoreid, #user, #x100, #x300, #x50

Instance Method Summary collapse

Methods inherited from Score

#initialize, #load

Constructor Details

This class inherits a constructor from Osu::DB::Score

Instance Method Details

#accuracyObject



135
136
137
# File 'lib/osu-db/score.rb', line 135

def accuracy
  (x300 + x100 + x50).to_f / hits
end

#gradeObject



139
140
141
142
143
144
145
# File 'lib/osu-db/score.rb', line 139

def grade
  acc = accuracy
  [0.85, :D, 0.90, :C, 0.94, :B, 0.98, :A].each_slice(2) do |a, g|
    return g if acc <= a
  end
  acc < 1 ? :S : :SS
end

#hitsObject



131
132
133
# File 'lib/osu-db/score.rb', line 131

def hits
  x300 + x100 + x50 + droplet_miss + miss
end