Class: Linedefs
- Inherits:
-
DecodedLump
- Object
- Lump
- DecodedLump
- Linedefs
- Defined in:
- lib/ruby-doom.rb
Constant Summary collapse
- BYTES_EACH =
14
- NAME =
"LINEDEFS"
Instance Attribute Summary
Attributes inherited from DecodedLump
Attributes inherited from Lump
Instance Method Summary collapse
-
#initialize ⇒ Linedefs
constructor
A new instance of Linedefs.
- #read(bytes) ⇒ Object
- #size ⇒ Object
Methods inherited from DecodedLump
Constructor Details
Instance Method Details
#read(bytes) ⇒ Object
577 578 579 580 581 582 583 |
# File 'lib/ruby-doom.rb', line 577 def read(bytes) (bytes.size / BYTES_EACH).times {|index| linedef = Linedef.new linedef.read(bytes.slice(index*BYTES_EACH, BYTES_EACH)) @items << linedef } end |
#size ⇒ Object
584 585 586 |
# File 'lib/ruby-doom.rb', line 584 def size @items.size * BYTES_EACH end |