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