Sha256: 098c7b3aaf5409807df9c1a443af9862a9103fd78b3c126febd54cb19129e882

Contents?: true

Size: 626 Bytes

Versions: 2

Compression:

Stored size: 626 Bytes

Contents

# encoding: UTF-8
require_relative 'player'

# Das Ergebnis eines Spieles. Ist im `GameState#condition` zu finden, wenn das Spiel beendet wurde.
class Condition
  # @!attribute [r] winner
  # @return [Player] Spieler, der das Spiel gewonnen hat.
  attr_reader :winner

  # @!attribute [r] reason
  # @return [String] Grund fuer Spielende
  attr_reader :reason

  # Initializes the winning Condition with a player
  # @param winner [Player] winning player
  # @param reason [String] why the player has won
  def initialize(winner, reason)
    @winner = winner
    @reason = reason
  end

  def draw?
    @winner.nil?
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
software_challenge_client-20.2.4 lib/software_challenge_client/condition.rb
software_challenge_client-20.2.3 lib/software_challenge_client/condition.rb