# File lib/libttc.rb, line 266 def capture(other_piece) if @position = other_piece.position @contains << other_piece @contains += other_piece.contains other_piece.contains = [] other_piece.captured = true else raise(InvalidCaptureError, "Piece #{self.name} cannot capture #{other_piece.name}: different locations") end end