Class: Linedef
- Inherits:
-
Object
- Object
- Linedef
- Defined in:
- lib/ruby-doom.rb
Constant Summary collapse
- FORMAT =
"sssssss"
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#end_vertex ⇒ Object
Returns the value of attribute end_vertex.
-
#id ⇒ Object
Returns the value of attribute id.
-
#left_sidedef ⇒ Object
Returns the value of attribute left_sidedef.
-
#right_sidedef ⇒ Object
Returns the value of attribute right_sidedef.
-
#special_effects_type ⇒ Object
Returns the value of attribute special_effects_type.
-
#start_vertex ⇒ Object
Returns the value of attribute start_vertex.
Instance Method Summary collapse
-
#initialize(v1 = 0, v2 = 0, s = 0) ⇒ Linedef
constructor
A new instance of Linedef.
- #read(bytes) ⇒ Object
- #to_s ⇒ Object
- #write ⇒ Object
Constructor Details
#initialize(v1 = 0, v2 = 0, s = 0) ⇒ Linedef
Returns a new instance of Linedef.
592 593 594 595 596 597 598 599 |
# File 'lib/ruby-doom.rb', line 592 def initialize(v1=0,v2=0,s=0) @start_vertex=v1 @end_vertex=v2 @attributes=1 @special_effects_type=0 @right_sidedef=s @left_sidedef=-1 end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
591 592 593 |
# File 'lib/ruby-doom.rb', line 591 def attributes @attributes end |
#end_vertex ⇒ Object
Returns the value of attribute end_vertex.
591 592 593 |
# File 'lib/ruby-doom.rb', line 591 def end_vertex @end_vertex end |
#id ⇒ Object
Returns the value of attribute id.
591 592 593 |
# File 'lib/ruby-doom.rb', line 591 def id @id end |
#left_sidedef ⇒ Object
Returns the value of attribute left_sidedef.
591 592 593 |
# File 'lib/ruby-doom.rb', line 591 def left_sidedef @left_sidedef end |
#right_sidedef ⇒ Object
Returns the value of attribute right_sidedef.
591 592 593 |
# File 'lib/ruby-doom.rb', line 591 def right_sidedef @right_sidedef end |
#special_effects_type ⇒ Object
Returns the value of attribute special_effects_type.
591 592 593 |
# File 'lib/ruby-doom.rb', line 591 def special_effects_type @special_effects_type end |
#start_vertex ⇒ Object
Returns the value of attribute start_vertex.
591 592 593 |
# File 'lib/ruby-doom.rb', line 591 def start_vertex @start_vertex end |
Instance Method Details
#read(bytes) ⇒ Object
600 601 602 |
# File 'lib/ruby-doom.rb', line 600 def read(bytes) @start_vertex, @end_vertex, @attributes, @special_effects_type, @tag, @right_sidedef, @left_sidedef = Codec.decode(FORMAT, bytes) end |
#to_s ⇒ Object
606 607 608 |
# File 'lib/ruby-doom.rb', line 606 def to_s "Linedef from " + @start_vertex.to_s + " to " + @end_vertex.to_s + "; attribute flag is " + @attributes.to_s + "; special fx is " + @special_effects_type.to_s + "; tag is " + @tag.to_s + "; right sidedef is " + @right_sidedef.to_s + "; left sidedef is " + @left_sidedef.to_s end |