Class: GameFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/ttt_malisa/game_factory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(board, display, rules, menu) ⇒ GameFactory

Returns a new instance of GameFactory.



4
5
6
7
8
9
# File 'lib/ttt_malisa/game_factory.rb', line 4

def initialize(board, display, rules, menu)
  @board = board
  @display = display
  @rules = rules
  @menu = menu
end

Instance Attribute Details

#player_oneObject (readonly)

Returns the value of attribute player_one.



2
3
4
# File 'lib/ttt_malisa/game_factory.rb', line 2

def player_one
  @player_one
end

#player_twoObject (readonly)

Returns the value of attribute player_two.



2
3
4
# File 'lib/ttt_malisa/game_factory.rb', line 2

def player_two
  @player_two
end

Instance Method Details

#create_gameObject



11
12
13
14
15
16
# File 'lib/ttt_malisa/game_factory.rb', line 11

def create_game
  player_selections
  player_choices
  game = Game.new(@display, @rules, @player_one, @player_two)
  game
end