class Bchess::Game

Attributes

board[R]
fen[R]
moves[R]

Public Class Methods

new(fen = '') click to toggle source
# File lib/bchess/game.rb, line 5
def initialize(fen = '')
  @fen = fen
  @board = Board.new(fen)
  @moves = []
end

Public Instance Methods

add_move(move) click to toggle source
# File lib/bchess/game.rb, line 11
def add_move(move)
  moves << move
end
validate_game() click to toggle source
# File lib/bchess/game.rb, line 15
def validate_game
  moves.all? do |move|
    board.execute(move)
  end
end