Class: Doom::Map::Node
- Inherits:
-
Object
- Object
- Doom::Map::Node
- Defined in:
- lib/doom/map/data.rb
Defined Under Namespace
Classes: BBox
Constant Summary collapse
- SUBSECTOR_FLAG =
0x8000
Instance Attribute Summary collapse
-
#bbox_left ⇒ Object
readonly
Returns the value of attribute bbox_left.
-
#bbox_right ⇒ Object
readonly
Returns the value of attribute bbox_right.
-
#child_left ⇒ Object
readonly
Returns the value of attribute child_left.
-
#child_right ⇒ Object
readonly
Returns the value of attribute child_right.
-
#dx ⇒ Object
readonly
Returns the value of attribute dx.
-
#dy ⇒ Object
readonly
Returns the value of attribute dy.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(x, y, dx, dy, bbox_right, bbox_left, child_right, child_left) ⇒ Node
constructor
A new instance of Node.
- #left_index ⇒ Object
- #left_is_subsector? ⇒ Boolean
- #right_index ⇒ Object
- #right_is_subsector? ⇒ Boolean
Constructor Details
#initialize(x, y, dx, dy, bbox_right, bbox_left, child_right, child_left) ⇒ Node
Returns a new instance of Node.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/doom/map/data.rb', line 50 def initialize(x, y, dx, dy, bbox_right, bbox_left, child_right, child_left) @x = x @y = y @dx = dx @dy = dy @bbox_right = bbox_right @bbox_left = bbox_left @child_right = child_right @child_left = child_left end |
Instance Attribute Details
#bbox_left ⇒ Object (readonly)
Returns the value of attribute bbox_left.
46 47 48 |
# File 'lib/doom/map/data.rb', line 46 def bbox_left @bbox_left end |
#bbox_right ⇒ Object (readonly)
Returns the value of attribute bbox_right.
46 47 48 |
# File 'lib/doom/map/data.rb', line 46 def bbox_right @bbox_right end |
#child_left ⇒ Object (readonly)
Returns the value of attribute child_left.
46 47 48 |
# File 'lib/doom/map/data.rb', line 46 def child_left @child_left end |
#child_right ⇒ Object (readonly)
Returns the value of attribute child_right.
46 47 48 |
# File 'lib/doom/map/data.rb', line 46 def child_right @child_right end |
#dx ⇒ Object (readonly)
Returns the value of attribute dx.
46 47 48 |
# File 'lib/doom/map/data.rb', line 46 def dx @dx end |
#dy ⇒ Object (readonly)
Returns the value of attribute dy.
46 47 48 |
# File 'lib/doom/map/data.rb', line 46 def dy @dy end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
46 47 48 |
# File 'lib/doom/map/data.rb', line 46 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
46 47 48 |
# File 'lib/doom/map/data.rb', line 46 def y @y end |
Instance Method Details
#left_index ⇒ Object
73 74 75 |
# File 'lib/doom/map/data.rb', line 73 def left_index @child_left & ~SUBSECTOR_FLAG end |
#left_is_subsector? ⇒ Boolean
65 66 67 |
# File 'lib/doom/map/data.rb', line 65 def left_is_subsector? (@child_left & SUBSECTOR_FLAG) != 0 end |
#right_index ⇒ Object
69 70 71 |
# File 'lib/doom/map/data.rb', line 69 def right_index @child_right & ~SUBSECTOR_FLAG end |
#right_is_subsector? ⇒ Boolean
61 62 63 |
# File 'lib/doom/map/data.rb', line 61 def right_is_subsector? (@child_right & SUBSECTOR_FLAG) != 0 end |