Class: Reversi::Game

Inherits:
Object
  • Object
show all
Defined in:
lib/reversi/game.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Game

Initializes a new Board object.



7
8
9
# File 'lib/reversi/game.rb', line 7

def initialize(options = {})
  reset(options)
end

Instance Attribute Details

#boardObject (readonly)

Returns the value of attribute board.



4
5
6
# File 'lib/reversi/game.rb', line 4

def board
  @board
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/reversi/game.rb', line 4

def options
  @options
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/reversi/game.rb', line 4

def status
  @status
end

#vs_humanObject (readonly)

Returns the value of attribute vs_human.



4
5
6
# File 'lib/reversi/game.rb', line 4

def vs_human
  @vs_human
end

Instance Method Details

#start(options = {}) ⇒ Object

Set the option values and start a game.

See Also:

  • #run


14
15
16
17
18
# File 'lib/reversi/game.rb', line 14

def start(options = {})
  reset(options)
  mode = {:progress => @progress, :vs_human => @vs_human}
  run(mode)
end