Class: Osu::DB::ManiaScore

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

Overview

Score of osu!mania 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



157
158
159
# File 'lib/osu-db/score.rb', line 157

def accuracy
  (300 * (max + x300) + 200 * x200 + 100 * x100 + 50 * x50) / (300.0 * hits)
end

#gradeObject



161
162
163
164
165
166
167
# File 'lib/osu-db/score.rb', line 161

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

#hitsObject



153
154
155
# File 'lib/osu-db/score.rb', line 153

def hits
  max + x300 + x200 + x100 + x50 + miss
end