class JustShogi::Piece

Piece

A piece that can move on a chess board

Public Class Methods

new(id: , player_number: , type: nil) click to toggle source
# File lib/just_shogi/pieces/piece.rb, line 9
def initialize(id: , player_number: , type: nil)
  @id = id
  @player_number = player_number
end

Public Instance Methods

switch_player() click to toggle source
# File lib/just_shogi/pieces/piece.rb, line 14
def switch_player
  @player_number = opponent
end