Class: Openra::Replays::File
- Inherits:
-
Object
- Object
- Openra::Replays::File
- Defined in:
- lib/openra/replays/file.rb
Instance Method Summary collapse
-
#initialize(filename) ⇒ File
constructor
A new instance of File.
- #metadata ⇒ Object
- #orders ⇒ Object
- #packets ⇒ Object
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
#metadata ⇒ Object
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 |
#orders ⇒ Object
12 13 14 |
# File 'lib/openra/replays/file.rb', line 12 def orders @orders ||= packets.orders end |
#packets ⇒ Object
8 9 10 |
# File 'lib/openra/replays/file.rb', line 8 def packets @packets ||= PacketList.read(fs) end |