+sub race_setup {
+ my ($self, $rounds) = @_;
+
+ if ($rounds) {
+ $self->{gui}->rounds('0/' . $rounds);
+ $self->{race_rounds} = $rounds;
+ } else {
+ $self->{gui}->rounds('0');
+ $self->{race_rounds} = 0;
+ }
+ $self->{race_time} = 0;
+ $self->{best_lap} = undef;
+
+ $self->{gui}->show_semaphore(undef);
+ $self->{race_running} = 0;
+ $self->{start_in_progress} = 0;
+
+ $self->{gui}->time('00:00');
+ $self->{gui}->best_lap('0.00');
+
+ for my $car (0..5) {
+ $self->car($car)->set_order($car);
+ }
+}