summaryrefslogtreecommitdiff
path: root/lib/Travel
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travel')
-rw-r--r--lib/Travel/Status/DE/DBWagenreihung.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/DBWagenreihung.pm b/lib/Travel/Status/DE/DBWagenreihung.pm
index c879d14..5308961 100644
--- a/lib/Travel/Status/DE/DBWagenreihung.pm
+++ b/lib/Travel/Status/DE/DBWagenreihung.pm
@@ -86,6 +86,23 @@ sub error {
return $self->{errstr};
}
+sub direction {
+ my ($self) = @_;
+
+ my @wagons = $self->wagons;
+
+ if ( not @wagons ) {
+ return undef;
+ }
+
+ if ( $wagons[0]->{position}{start_percent}
+ > $wagons[-1]{position}{start_percent} )
+ {
+ return 0;
+ }
+ return 100;
+}
+
sub sections {
my ($self) = @_;