Class: Doomfire::Base
- Inherits:
-
Object
- Object
- Doomfire::Base
- Defined in:
- lib/doomfire/base.rb
Overview
Base class for the fire algorithm
Constant Summary collapse
- RGB =
[ [0, 0, 0], [7, 7, 7], [31, 7, 7], [47, 15, 7], [87, 23, 7], [103, 31, 7], [119, 31, 7], [143, 39, 7], [159, 47, 7], [175, 63, 7], [191, 71, 7], [199, 71, 7], [223, 79, 7], [223, 87, 7], [223, 87, 7], [215, 103, 15], [207, 111, 15], [207, 119, 15], [207, 127, 15], [207, 135, 23], [199, 135, 23], [199, 143, 23], [199, 151, 31], [191, 159, 31], [191, 159, 31], [191, 167, 39], [191, 167, 39], [191, 175, 47], [183, 175, 47], [183, 183, 47], [183, 183, 55], [207, 207, 111], [223, 223, 159], [239, 239, 199], [255, 255, 255] ].freeze
Instance Attribute Summary collapse
-
#exit_requested ⇒ Object
readonly
Returns the value of attribute exit_requested.
-
#fire_width ⇒ Object
readonly
Returns the value of attribute fire_width.
-
#pixels ⇒ Object
readonly
Returns the value of attribute pixels.
Instance Method Summary collapse
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #run ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
46 47 48 49 50 51 52 53 54 |
# File 'lib/doomfire/base.rb', line 46 def initialize @counter = 0 @thread = nil @exit_requested = false prepare_output initialize_pixels end |
Instance Attribute Details
#exit_requested ⇒ Object (readonly)
Returns the value of attribute exit_requested.
44 45 46 |
# File 'lib/doomfire/base.rb', line 44 def exit_requested @exit_requested end |
#fire_width ⇒ Object (readonly)
Returns the value of attribute fire_width.
44 45 46 |
# File 'lib/doomfire/base.rb', line 44 def fire_width @fire_width end |
#pixels ⇒ Object (readonly)
Returns the value of attribute pixels.
44 45 46 |
# File 'lib/doomfire/base.rb', line 44 def pixels @pixels end |
Instance Method Details
#run ⇒ Object
56 57 58 |
# File 'lib/doomfire/base.rb', line 56 def run raise NotImplementedError end |
#stop ⇒ Object
60 61 62 |
# File 'lib/doomfire/base.rb', line 60 def stop raise NotImplementedError end |