Class: WhiteKing

Inherits:
WhitePiece show all
Includes:
King
Defined in:
lib/king.rb

Instance Attribute Summary collapse

Attributes inherited from EmptySpace

#color

Instance Method Summary collapse

Methods included from King

#castle, #checked?, #illegal

Methods included from Moves

#diagonal, #horizontal, #move, #vertical

Methods inherited from WhitePiece

#enemy_of?, #friend_of?

Methods inherited from EmptySpace

#empty?, #enemy_of?, #friend_of?, #place_on, #remove_from, #to_coord

Constructor Details

#initialize(x, y) ⇒ WhiteKing

Returns a new instance of WhiteKing.



81
82
83
84
85
# File 'lib/king.rb', line 81

def initialize(x,y)
  super
  @start = true
  @direction = 1
end

Instance Attribute Details

#startObject (readonly)

Returns the value of attribute start.



80
81
82
# File 'lib/king.rb', line 80

def start
  @start
end

Instance Method Details

#to_sObject



87
88
89
# File 'lib/king.rb', line 87

def to_s
  "W!"
end