Class: Vertexes

Inherits:
DecodedLump show all
Defined in:
lib/ruby-doom.rb

Constant Summary collapse

BYTES_EACH =
4
NAME =
"VERTEXES"

Instance Attribute Summary

Attributes inherited from DecodedLump

#items

Attributes inherited from Lump

#name

Instance Method Summary collapse

Methods inherited from DecodedLump

#add, #write

Constructor Details

#initializeVertexes

Returns a new instance of Vertexes.



438
439
440
# File 'lib/ruby-doom.rb', line 438

def initialize
  super(NAME)
end

Instance Method Details

#read(bytes) ⇒ Object



441
442
443
444
445
446
447
# File 'lib/ruby-doom.rb', line 441

def read(bytes)
  (bytes.size / BYTES_EACH).times {|index|
    v = Vertex.new
    v.read(bytes.slice(index*BYTES_EACH, BYTES_EACH))
    @items << v
  }
end

#sizeObject



448
449
450
# File 'lib/ruby-doom.rb', line 448

def size
  @items.size * BYTES_EACH
end