Class: Sidedef
- Inherits:
-
Object
- Object
- Sidedef
- Defined in:
- lib/ruby-doom.rb
Constant Summary collapse
- FORMAT =
"ss888s"
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#lower_texture ⇒ Object
Returns the value of attribute lower_texture.
-
#middle_texture ⇒ Object
Returns the value of attribute middle_texture.
-
#sector_id ⇒ Object
Returns the value of attribute sector_id.
-
#upper_texture ⇒ Object
Returns the value of attribute upper_texture.
-
#x_offset ⇒ Object
Returns the value of attribute x_offset.
-
#y_offset ⇒ Object
Returns the value of attribute y_offset.
Instance Method Summary collapse
-
#initialize ⇒ Sidedef
constructor
A new instance of Sidedef.
- #read(bytes) ⇒ Object
- #to_s ⇒ Object
- #write ⇒ Object
Constructor Details
#initialize ⇒ Sidedef
Returns a new instance of Sidedef.
492 493 494 495 496 497 498 499 |
# File 'lib/ruby-doom.rb', line 492 def initialize() @x_offset=0 @y_offset=0 @upper_texture="-" @lower_texture="-" @middle_texture="BROWN96" @sector_id=0 end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
491 492 493 |
# File 'lib/ruby-doom.rb', line 491 def id @id end |
#lower_texture ⇒ Object
Returns the value of attribute lower_texture.
491 492 493 |
# File 'lib/ruby-doom.rb', line 491 def lower_texture @lower_texture end |
#middle_texture ⇒ Object
Returns the value of attribute middle_texture.
491 492 493 |
# File 'lib/ruby-doom.rb', line 491 def middle_texture @middle_texture end |
#sector_id ⇒ Object
Returns the value of attribute sector_id.
491 492 493 |
# File 'lib/ruby-doom.rb', line 491 def sector_id @sector_id end |
#upper_texture ⇒ Object
Returns the value of attribute upper_texture.
491 492 493 |
# File 'lib/ruby-doom.rb', line 491 def upper_texture @upper_texture end |
#x_offset ⇒ Object
Returns the value of attribute x_offset.
491 492 493 |
# File 'lib/ruby-doom.rb', line 491 def x_offset @x_offset end |
#y_offset ⇒ Object
Returns the value of attribute y_offset.
491 492 493 |
# File 'lib/ruby-doom.rb', line 491 def y_offset @y_offset end |
Instance Method Details
#read(bytes) ⇒ Object
500 501 502 |
# File 'lib/ruby-doom.rb', line 500 def read(bytes) @x_offset, @y_offset, @upper_texture, @lower_texture, @middle_texture, @sector_id = Codec.decode(FORMAT, bytes) end |
#to_s ⇒ Object
506 507 508 |
# File 'lib/ruby-doom.rb', line 506 def to_s " Sidedef for sector " + @sector_id.to_s + "; upper/lower/middle textures are " + @upper_texture + "/" + @lower_texture + "/" + @middle_texture + " with offsets of " + @x_offset.to_s + "/" + @y_offset.to_s end |