Class: Sectors
- Inherits:
-
DecodedLump
- Object
- Lump
- DecodedLump
- Sectors
- Defined in:
- lib/ruby-doom.rb
Constant Summary collapse
- BYTES_EACH =
26
- NAME =
"SECTORS"
Instance Attribute Summary
Attributes inherited from DecodedLump
Attributes inherited from Lump
Instance Method Summary collapse
-
#initialize ⇒ Sectors
constructor
A new instance of Sectors.
- #read(bytes) ⇒ Object
- #size ⇒ Object
Methods inherited from DecodedLump
Constructor Details
Instance Method Details
#read(bytes) ⇒ Object
406 407 408 409 410 411 412 |
# File 'lib/ruby-doom.rb', line 406 def read(bytes) (bytes.size / BYTES_EACH).times {|index| s = Sector.new s.read(bytes.slice(index*BYTES_EACH, BYTES_EACH)) @items << s } end |
#size ⇒ Object
413 414 415 |
# File 'lib/ruby-doom.rb', line 413 def size @items.size * BYTES_EACH end |