Class: Osu::DB::Mod

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

Constant Summary collapse

EZ =

Easy

Mod.new(1, 'Easy')
NF =

No Fail

Mod.new(0, 'NoFail')
HT =

Half Time

Mod.new(8, 'HalfTime')
HR =

Hard Rock

Mod.new(4, 'HardRock')
SD =

Sudden Death

Mod.new(5, 'SuddenDeath')
PF =

Perfect (based on SD)

Mod.new(14, '+Perfect')
DT =

Double Time

Mod.new(6, 'DoubleTime')
NC =

Night Core (based on DT)

Mod.new(9, '+NightCore')
HD =

Hidden

Mod.new(3, 'Hidden')
FL =

Flash Light

Mod.new(10, 'FlashLight')
RL =

Relax

Mod.new(-1, 'Relax')
AP =

Auto Pilot

Mod.new(-1, 'AutoPilot')
SO =

Spun Out

Mod.new(12, 'SpunOut')

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index, name) ⇒ Mod

Returns a new instance of Mod.



4
5
6
7
# File 'lib/osu-db/mods.rb', line 4

def initialize(index, name)
  @index = index
  @name = name
end

Class Method Details

.allObject

Return all ranked mods



46
47
48
# File 'lib/osu-db/mods.rb', line 46

def self.all
  [EZ, NF, HT, HR, SD, PF, DT, NC, HD, FL, SO]
end

Instance Method Details

#to_iObject



9
10
11
# File 'lib/osu-db/mods.rb', line 9

def to_i
  1 << @index
end

#to_sObject



13
14
15
# File 'lib/osu-db/mods.rb', line 13

def to_s
  @name
end