Class: ConsoleShogi::Fu

Inherits:
Piece
  • Object
show all
Defined in:
lib/console_shogi/piece.rb

Constant Summary collapse

NUMBER =
1

Instance Attribute Summary

Attributes inherited from Piece

#teban

Instance Method Summary collapse

Methods inherited from Piece

#active_image, #can_move_long_distance?, #change_player!, #focused_image, #fu?, #image, #initialize, #move, #moves, #none?, #number, #promote, #promoted?, #same?

Constructor Details

This class inherits a constructor from ConsoleShogi::Piece

Instance Method Details

#base_movesObject



100
101
102
103
104
# File 'lib/console_shogi/piece.rb', line 100

def base_moves
  [
    {x: 0, y: -1}
  ]
end

#can_promote?Boolean

Returns:

  • (Boolean)


106
107
108
# File 'lib/console_shogi/piece.rb', line 106

def can_promote?
  true
end


110
111
112
# File 'lib/console_shogi/piece.rb', line 110

def promoted
  PromotedPiece::Tokin.new(original: self)
end