Class: Rchess::Paths::Rook
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(params) ⇒ Rook
constructor
A new instance of Rook.
- #paths ⇒ Object
Methods inherited from Base
#destinations, #srcBox, #srcDirection, threaten_destinations_from_coord
Constructor Details
#initialize(params) ⇒ Rook
Returns a new instance of Rook.
4 5 6 7 |
# File 'lib/rchess/paths/rook.rb', line 4 def initialize(params) @power = params.fetch(:power, 8) super(params) end |
Instance Method Details
#paths ⇒ Object
9 10 11 |
# File 'lib/rchess/paths/rook.rb', line 9 def paths [linear_paths].flatten(1) end |