]> git.tdb.fi Git - r2c2.git/commitdiff
Rename is_occupied to is_occupying
authorMikko Rasa <tdb@tdb.fi>
Sun, 30 Mar 2014 13:46:53 +0000 (16:46 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 30 Mar 2014 16:35:55 +0000 (19:35 +0300)
This reflects the function's actual purpose better.

source/libr2c2/trainrouteplanner.cpp
source/libr2c2/trainrouteplanner.h

index e8b5d90107b59b7dad25a455d0f7d4bc678c2a5b..e813b366fe88a4829d4cc155f9d731d41108d461 100644 (file)
@@ -184,7 +184,7 @@ Time::TimeDelta TrainRoutePlanner::TrainRoutingState::get_time_to_next_track() c
        return ((track->get_type().get_path_length(path)-offset)/info->speed)*Time::sec+delay;
 }
 
-bool TrainRoutePlanner::TrainRoutingState::is_occupied(Track &trk) const
+bool TrainRoutePlanner::TrainRoutingState::is_occupying(Track &trk) const
 {
        OccupiedTrack *occ = occupied_tracks;
        for(unsigned n=occ->n_tracks; n>0; --n, occ=occ->next)
@@ -362,7 +362,7 @@ bool TrainRoutePlanner::RoutingStep::check_deadlocks() const
 int TrainRoutePlanner::RoutingStep::get_occupant(Track &track) const
 {
        for(unsigned i=0; i<trains.size(); ++i)
-               if(trains[i].is_occupied(track))
+               if(trains[i].is_occupying(track))
                        return i;
 
        return -1;
index d24c3dc6a2ae54903bd4f6dd731861f9e000e110..6dab635818f0c92163188f1e93e2a6ffa80a2119 100644 (file)
@@ -69,7 +69,7 @@ private:
                ~TrainRoutingState();
 
                Msp::Time::TimeDelta get_time_to_next_track() const;
-               bool is_occupied(Track &) const;
+               bool is_occupying(Track &) const;
                bool check_arrival();
                void advance(float);
                void advance_track(unsigned);