+sub init
+{
+ my $self=shift;
+ for my $i (0..21)
+ {
+ for my $player_idx (0..($self->{player_count}-1))
+ {
+ my $zahl = $i>20?25:$i;
+ next if $zahl > 0 and not gueltig($zahl);
+ $self->get_player($player_idx)->{score}->{$zahl}=0;
+ }
+ }
+}
+
+sub win_condition
+{
+ my ($self) = @_;
+ for my $i (keys %{$self->get_current_player()->{score}})
+ {
+ next if not $i;
+ return if $self->get_current_player()->{score}->{$i}<3;
+ }
+ my $score = $self->get_current_player()->{score}->{0};
+ for my $player_idx (0..($self->{player_count}-1))
+ {
+ next if not $self->get_player($player_idx)->{active};
+ return if $score > $self->get_player($player_idx)->{score}->{0};
+ }
+ return 1;
+}
+