Class: Assumption::Game

Inherits:
Object
  • Object
show all
Includes:
UniFunctions
Defined in:
lib/assumption/game.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from UniFunctions

#clear_terminal, #get_char, #title, #underline

Constructor Details

#initialize(year) ⇒ Game

Returns a new instance of Game.



16
17
18
19
20
21
22
23
24
25
# File 'lib/assumption/game.rb', line 16

def initialize(year)
  @year = year
  @chart_data_set = Assumption::ChartDataSet.find_or_create_by_year(year)
  @level = 1
  @@all << self
  @current_song = @chart_data_set.random
  @next_song = @chart_data_set.random
  @input = nil
  start_level
end

Instance Attribute Details

#chart_data_setObject (readonly)

Returns the value of attribute chart_data_set.



14
15
16
# File 'lib/assumption/game.rb', line 14

def chart_data_set
  @chart_data_set
end

#idObject (readonly)

Returns the value of attribute id.



14
15
16
# File 'lib/assumption/game.rb', line 14

def id
  @id
end

#inputObject

Returns the value of attribute input.



12
13
14
# File 'lib/assumption/game.rb', line 12

def input
  @input
end

#yearObject (readonly)

Returns the value of attribute year.



14
15
16
# File 'lib/assumption/game.rb', line 14

def year
  @year
end

Class Method Details

.allObject



8
9
10
# File 'lib/assumption/game.rb', line 8

def self.all
  @@all
end