Class: SetMove

Inherits:
Object
  • Object
show all
Includes:
HasHints
Defined in:
lib/software_challenge_client/set_move.rb

Overview

Ein SetMove platziert einen Stein auf dem Spielbrett

Instance Attribute Summary collapse

Attributes included from HasHints

#hints

Instance Method Summary collapse

Methods included from HasHints

#add_hint

Constructor Details

#initialize(piece) ⇒ SetMove

Erstellt ein neuen leeren Legezug.



12
13
14
15
# File 'lib/software_challenge_client/set_move.rb', line 12

def initialize(piece)
  @piece = piece
  @hints = []
end

Instance Attribute Details

#pieceObject (readonly)

Returns the value of attribute piece.



9
10
11
# File 'lib/software_challenge_client/set_move.rb', line 9

def piece
  @piece
end

Instance Method Details

#==(other) ⇒ Object



17
18
19
# File 'lib/software_challenge_client/set_move.rb', line 17

def ==(other)
  piece == other.piece
end

#to_sObject



21
22
23
# File 'lib/software_challenge_client/set_move.rb', line 21

def to_s
  "SetMove(#{piece}"
end