Class: Doomfire::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/doomfire/base.rb

Overview

Base class for the fire algorithm

Direct Known Subclasses

SDL, Terminal

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

Instance Method Summary collapse

Constructor Details

#initializeBase

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_requestedObject (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_widthObject (readonly)

Returns the value of attribute fire_width.



44
45
46
# File 'lib/doomfire/base.rb', line 44

def fire_width
  @fire_width
end

#pixelsObject (readonly)

Returns the value of attribute pixels.



44
45
46
# File 'lib/doomfire/base.rb', line 44

def pixels
  @pixels
end

Instance Method Details

#runObject

Raises:

  • (NotImplementedError)


56
57
58
# File 'lib/doomfire/base.rb', line 56

def run
  raise NotImplementedError
end

#stopObject

Raises:

  • (NotImplementedError)


60
61
62
# File 'lib/doomfire/base.rb', line 60

def stop
  raise NotImplementedError
end