Class: Openra::Replays::File

Inherits:
Object
  • Object
show all
Defined in:
lib/openra/replays/file.rb

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ File

Returns a new instance of File.



4
5
6
# File 'lib/openra/replays/file.rb', line 4

def initialize(filename)
  @filename = filename
end

Instance Method Details

#metadataObject



16
17
18
19
20
21
22
# File 'lib/openra/replays/file.rb', line 16

def 
   = fs
  offset = -(.data_length + 4)
  .seek(offset, IO::SEEK_END)

  @metadata ||= Metadata.read()
end

#ordersObject



12
13
14
# File 'lib/openra/replays/file.rb', line 12

def orders
  @orders ||= packets.orders
end

#packetsObject



8
9
10
# File 'lib/openra/replays/file.rb', line 8

def packets
  @packets ||= PacketList.read(fs)
end