Class: Rchess::Paths::Rook

Inherits:
Base
  • Object
show all
Defined in:
lib/rchess/paths/rook.rb

Instance Attribute Summary

Attributes inherited from Base

#board, #coord

Instance Method Summary collapse

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

#pathsObject



9
10
11
# File 'lib/rchess/paths/rook.rb', line 9

def paths
  [linear_paths].flatten(1)
end