Class: Sector
- Inherits:
-
Object
- Object
- Sector
- Defined in:
- lib/ruby-doom.rb
Constant Summary collapse
- FORMAT =
"ss88sss"
Instance Attribute Summary collapse
-
#ceiling_height ⇒ Object
Returns the value of attribute ceiling_height.
-
#ceiling_texture ⇒ Object
Returns the value of attribute ceiling_texture.
-
#floor_height ⇒ Object
Returns the value of attribute floor_height.
-
#floor_texture ⇒ Object
Returns the value of attribute floor_texture.
-
#id ⇒ Object
Returns the value of attribute id.
-
#light_level ⇒ Object
Returns the value of attribute light_level.
-
#special ⇒ Object
Returns the value of attribute special.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
-
#initialize ⇒ Sector
constructor
A new instance of Sector.
- #read(bytes) ⇒ Object
- #to_s ⇒ Object
- #write ⇒ Object
Constructor Details
#initialize ⇒ Sector
Returns a new instance of Sector.
421 422 423 |
# File 'lib/ruby-doom.rb', line 421 def initialize @floor_height, @ceiling_height, @floor_texture, @ceiling_texture, @light_level, @special, @tag = 0, 128, "FLAT14", "FLAT14", 160, 0, 0 end |
Instance Attribute Details
#ceiling_height ⇒ Object
Returns the value of attribute ceiling_height.
420 421 422 |
# File 'lib/ruby-doom.rb', line 420 def ceiling_height @ceiling_height end |
#ceiling_texture ⇒ Object
Returns the value of attribute ceiling_texture.
420 421 422 |
# File 'lib/ruby-doom.rb', line 420 def ceiling_texture @ceiling_texture end |
#floor_height ⇒ Object
Returns the value of attribute floor_height.
420 421 422 |
# File 'lib/ruby-doom.rb', line 420 def floor_height @floor_height end |
#floor_texture ⇒ Object
Returns the value of attribute floor_texture.
420 421 422 |
# File 'lib/ruby-doom.rb', line 420 def floor_texture @floor_texture end |
#id ⇒ Object
Returns the value of attribute id.
420 421 422 |
# File 'lib/ruby-doom.rb', line 420 def id @id end |
#light_level ⇒ Object
Returns the value of attribute light_level.
420 421 422 |
# File 'lib/ruby-doom.rb', line 420 def light_level @light_level end |
#special ⇒ Object
Returns the value of attribute special.
420 421 422 |
# File 'lib/ruby-doom.rb', line 420 def special @special end |
#tag ⇒ Object
Returns the value of attribute tag.
420 421 422 |
# File 'lib/ruby-doom.rb', line 420 def tag @tag end |
Instance Method Details
#read(bytes) ⇒ Object
424 425 426 |
# File 'lib/ruby-doom.rb', line 424 def read(bytes) @floor_height, @ceiling_height, @floor_texture, @ceiling_texture, @light_level, @special, @tag = Codec.decode(FORMAT, bytes) end |
#to_s ⇒ Object
430 431 432 |
# File 'lib/ruby-doom.rb', line 430 def to_s " Sector floor/ceiling heights " + @floor_height.to_s + "/" + @ceiling_height.to_s + "; floor/ceiling textures " + @floor_texture.to_s + "/" + @ceiling_texture.to_s + "; light = " + @light_level.to_s + "; special = " + @special.to_s + "; tag = " + @tag.to_s end |