Class: Osu::DB::BeatmapDB

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/osu-db/beatmapdb.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#beatmapsObject (readonly)

Returns the value of attribute beatmaps.



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

def beatmaps
  @beatmaps
end

Instance Method Details

#load(str) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/osu-db/beatmapdb.rb', line 15

def load(str)
  ios = StringIO.new(str, 'rb')
  ios.read_version

  folders = ios.read_int 4
  dummy1  = ios.read_int 4
  dummy2  = ios.read_int 4
  dummy3  = ios.read_int 1
  user    = ios.read_str

  n = ios.read_int 4
  @beatmaps = Array.new(n) do
    beatmap = Beatmap.new(ios)
  end
end