Class: Player

Inherits:
Object
  • Object
show all
Defined in:
lib/software_challenge_client/player.rb

Overview

Ein Spieler

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(color, name) ⇒ Player

Konstruktor

Parameters:



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

def initialize(color, name)
  @color = color
  @name = name
end

Instance Attribute Details

#colorPlayerColor (readonly)

Returns die Farbe des Spielers, Rot oder Blau.

Returns:

  • (PlayerColor)

    die Farbe des Spielers, Rot oder Blau



11
12
13
# File 'lib/software_challenge_client/player.rb', line 11

def color
  @color
end

#nameString (readonly)

Returns der Name des Spielers, hat keine Auswirkungen auf das Spiel.

Returns:

  • (String)

    der Name des Spielers, hat keine Auswirkungen auf das Spiel



7
8
9
# File 'lib/software_challenge_client/player.rb', line 7

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



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

def ==(other)
  color == other.color
end