class BoardGame::Piece
A piece on the board.
Attributes
tile[RW]
Public Instance Methods
as_json(*args)
click to toggle source
# File lib/boardgame/piece.rb, line 17 def as_json(*args) {} end
inspect()
click to toggle source
# File lib/boardgame/piece.rb, line 13 def inspect "+" end
move_to(new_tile)
click to toggle source
# File lib/boardgame/piece.rb, line 5 def move_to(new_tile) raise 'that isnt a tile' unless new_tile.is_a? BoardGame::Tile @tile.remove self if @tile @tile = new_tile @tile << self self end