Sha256: 3d71e9d96d256f26f7c514b5e7045044b667e8444034311a41cd8bc19527ceab
Contents?: true
Size: 700 Bytes
Versions: 9
Compression:
Stored size: 700 Bytes
Contents
# encoding: UTF-8 # frozen_string_literal: true 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 # Überprüfe ob es ein Unentschieden gab def draw? @winner.nil? end end
Version data entries
9 entries across 9 versions & 1 rubygems