Class: Player
- Inherits:
-
Object
- Object
- Player
- Defined in:
- lib/software_challenge_client/player.rb
Overview
Ein Spieler
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
Der Name des Spielers, hat keine Auswirkungen auf das Spiel.
-
#type ⇒ PlayerType
readonly
Erster (PlayerType::ONE) oder zweiter (PlayerType::TWO) Spieler.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(type, name) ⇒ Player
constructor
Konstruktor.
Constructor Details
#initialize(type, name) ⇒ Player
Konstruktor
17 18 19 20 |
# File 'lib/software_challenge_client/player.rb', line 17 def initialize(type, name) @type = type @name = name end |
Instance Attribute Details
#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 |
#type ⇒ PlayerType (readonly)
Returns erster (PlayerType::ONE) oder zweiter (PlayerType::TWO) Spieler.
12 13 14 |
# File 'lib/software_challenge_client/player.rb', line 12 def type @type end |
Instance Method Details
#==(other) ⇒ Object
22 23 24 |
# File 'lib/software_challenge_client/player.rb', line 22 def ==(other) color == other.color end |