Class: Player
- Inherits:
-
Object
- Object
- Player
- Defined in:
- lib/software_challenge_client/player.rb
Overview
Ein Spieler
Instance Attribute Summary collapse
-
#amber ⇒ Integer
Anzahl Bernsteine die dieser Spieler gesammelt hat.
-
#color ⇒ Color
readonly
Erster (Color::RED) oder zweiter (Color::BLUE) Spieler.
-
#name ⇒ String
readonly
Der Name des Spielers, hat keine Auswirkungen auf das Spiel.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(color, name, amber = 0) ⇒ Player
constructor
Konstruktor.
Constructor Details
#initialize(color, name, amber = 0) ⇒ Player
Konstruktor
22 23 24 25 26 |
# File 'lib/software_challenge_client/player.rb', line 22 def initialize(color, name, amber = 0) @color = color @name = name @amber = amber end |
Instance Attribute Details
#amber ⇒ Integer
Returns Anzahl Bernsteine die dieser Spieler gesammelt hat.
16 17 18 |
# File 'lib/software_challenge_client/player.rb', line 16 def amber @amber end |
#color ⇒ Color (readonly)
Returns erster (Color::RED) oder zweiter (Color::BLUE) Spieler.
12 13 14 |
# File 'lib/software_challenge_client/player.rb', line 12 def color @color end |
#name ⇒ String (readonly)
Returns der Name des Spielers, hat keine Auswirkungen auf das Spiel.
8 9 10 |
# File 'lib/software_challenge_client/player.rb', line 8 def name @name end |
Instance Method Details
#==(other) ⇒ Object
28 29 30 |
# File 'lib/software_challenge_client/player.rb', line 28 def ==(other) color == other.color end |