Class: ConsoleShogi::Gin
- Inherits:
-
Piece
- Object
- Piece
- ConsoleShogi::Gin
show all
- Defined in:
- lib/console_shogi/piece.rb
Constant Summary
collapse
- NUMBER =
4
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?
Instance Method Details
#base_moves ⇒ Object
155
156
157
158
159
160
161
162
163
|
# File 'lib/console_shogi/piece.rb', line 155
def base_moves
[
{x: -1, y: -1},
{x: 0, y: -1},
{x: 1, y: -1},
{x: 1, y: 1},
{x: -1, y: 1}
]
end
|
165
166
167
|
# File 'lib/console_shogi/piece.rb', line 165
def can_promote?
true
end
|
169
170
171
|
# File 'lib/console_shogi/piece.rb', line 169
def promoted
PromotedPiece::Narigin.new(original: self)
end
|