Class: JustXiangqi::Piece

Inherits:
BoardGameGrid::Piece
  • Object
show all
Defined in:
lib/just_xiangqi/pieces/piece.rb

Overview

Piece

A piece that can move on a board

Direct Known Subclasses

Jiang, Ju, Ma, Pao, Shi, Xiang, Zu

Instance Method Summary collapse

Constructor Details

#initialize(id:, player_number:, type: nil) ⇒ Piece

Returns a new instance of Piece.



9
10
11
12
# File 'lib/just_xiangqi/pieces/piece.rb', line 9

def initialize(id: , player_number: , type: nil)
  @id = id
  @player_number = player_number
end