Sha256: 07e3f3115205c75d295c0552d8660db79c5984610560b1c1f078203dfe662a5f

Contents?: true

Size: 575 Bytes

Versions: 4

Compression:

Stored size: 575 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 winer [Player] winning player
  def initialize(winner, reason)
    @winner = winner
    @reason = reason
  end

  def draw?
    @winner.nil?
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
software_challenge_client-20.2.2 lib/software_challenge_client/condition.rb
software_challenge_client-20.2.1 lib/software_challenge_client/condition.rb
software_challenge_client-20.2.0 lib/software_challenge_client/condition.rb
software_challenge_client-19.1.0 lib/software_challenge_client/condition.rb