From 3b3c72e17a541d14f063c4c4f9093f42b271ff08 Mon Sep 17 00:00:00 2001 From: "Jan \"Yenya\" Kasprzak" Date: Sun, 13 Feb 2011 22:19:35 +0100 Subject: [PATCH] RaceParser: compare our and controller unit standing and timing --- SCX/RaceParser.pm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/SCX/RaceParser.pm b/SCX/RaceParser.pm index 51f0676..90ae735 100644 --- a/SCX/RaceParser.pm +++ b/SCX/RaceParser.pm @@ -132,5 +132,29 @@ sub controller_status { } } +sub standings { + my ($self, @order) = @_; + + return 0; # for now + for my $i (0..$#order) { + my $car_id = $order[$i]; + if ($self->track->car($car_id)->{order} != $i) { + print $self->now(), " car $car_id out of order (we: ", + $self->track->car($car_id)->{order}, + ", controller unit: $i)\n"; + } + } +} + +sub car_lap_time { + my ($self, $car_id, $lap, $time) = @_; + + if ($self->track->car($car_id)->{lap} != $lap) { + print $self->now(), " car $car_id lap mismatch - we: ", + $self->track->car($car_id)->{lap}, + ", controller unit: $lap\n"; + } +} + 1; -- 2.43.5