Class: Osu::DB::TaikoScore

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

Overview

Score of Taiko 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



106
107
108
# File 'lib/osu-db/score.rb', line 106

def accuracy
  (great + good * 0.5) / hits
end

#gradeObject



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/osu-db/score.rb', line 110

def grade
  if x300 == hits
    :SS
  elsif 10 * x300 > 9 * hits && miss == 0
    :S
  elsif 10 * x300 > 8 * hits && miss == 0 || 10 * x300 > 9 * hits
    :A
  elsif 10 * x300 > 7 * hits && miss == 0 || 10 * x300 > 8 * hits
    :B
  elsif 10 * x300 > 6 * hits
    :C
  else
    :D
  end
end

#hitsObject



102
103
104
# File 'lib/osu-db/score.rb', line 102

def hits
  great + good + miss
end