Class: Sidedefs
- Inherits:
-
DecodedLump
- Object
- Lump
- DecodedLump
- Sidedefs
- Defined in:
- lib/ruby-doom.rb
Constant Summary collapse
- BYTES_EACH =
30
- NAME =
"SIDEDEFS"
Instance Attribute Summary
Attributes inherited from DecodedLump
Attributes inherited from Lump
Instance Method Summary collapse
-
#initialize ⇒ Sidedefs
constructor
A new instance of Sidedefs.
- #read(bytes) ⇒ Object
- #size ⇒ Object
Methods inherited from DecodedLump
Constructor Details
Instance Method Details
#read(bytes) ⇒ Object
477 478 479 480 481 482 483 |
# File 'lib/ruby-doom.rb', line 477 def read(bytes) (bytes.size / BYTES_EACH).times {|index| s = Sidedef.new s.read(bytes.slice(index*BYTES_EACH, BYTES_EACH)) @items << s } end |
#size ⇒ Object
484 485 486 |
# File 'lib/ruby-doom.rb', line 484 def size @items.size * BYTES_EACH end |