Class: Reversi::Game
- Inherits:
-
Object
- Object
- Reversi::Game
- Defined in:
- lib/reversi/game.rb
Instance Attribute Summary collapse
-
#board ⇒ Object
readonly
Returns the value of attribute board.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#vs_human ⇒ Object
readonly
Returns the value of attribute vs_human.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Game
constructor
Initializes a new Board object.
-
#start(options = {}) ⇒ Object
Set the option values and start a game.
Constructor Details
#initialize(options = {}) ⇒ Game
Initializes a new Board object.
7 8 9 |
# File 'lib/reversi/game.rb', line 7 def initialize( = {}) reset() end |
Instance Attribute Details
#board ⇒ Object (readonly)
Returns the value of attribute board.
4 5 6 |
# File 'lib/reversi/game.rb', line 4 def board @board end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/reversi/game.rb', line 4 def @options end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/reversi/game.rb', line 4 def status @status end |
#vs_human ⇒ Object (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.
14 15 16 17 18 |
# File 'lib/reversi/game.rb', line 14 def start( = {}) reset() mode = {:progress => @progress, :vs_human => @vs_human} run(mode) end |