summaryrefslogtreecommitdiff
path: root/src/linkgraph
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2013-10-15 17:32:31 +0000
committerfonsinchen <fonsinchen@openttd.org>2013-10-15 17:32:31 +0000
commit5ab204c8a170e692835e126daa00987c5f0217b6 (patch)
treecbbdbd9b6e60f264650e2745da17278ae173eedd /src/linkgraph
parenta6fe1f2f63c51379dfae0cf947bc9e1adc7800a8 (diff)
downloadopenttd-5ab204c8a170e692835e126daa00987c5f0217b6.tar.xz
(svn r25867) -Fix [FS#5764]: Shift dates on link graphs when using scenario editor date tool.
Diffstat (limited to 'src/linkgraph')
-rw-r--r--src/linkgraph/linkgraphschedule.cpp13
-rw-r--r--src/linkgraph/linkgraphschedule.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/linkgraph/linkgraphschedule.cpp b/src/linkgraph/linkgraphschedule.cpp
index 7e2c66f8f..366a3c517 100644
--- a/src/linkgraph/linkgraphschedule.cpp
+++ b/src/linkgraph/linkgraphschedule.cpp
@@ -126,6 +126,19 @@ void LinkGraphSchedule::SpawnAll()
}
/**
+ * Shift all dates (join dates and edge annotations) of link graphs and link
+ * graph jobs by the number of days given.
+ * @param interval Number of days to be added or subtracted.
+ */
+void LinkGraphSchedule::ShiftDates(int interval)
+{
+ LinkGraph *lg;
+ FOR_ALL_LINK_GRAPHS(lg) lg->ShiftDates(interval);
+ LinkGraphJob *lgj;
+ FOR_ALL_LINK_GRAPH_JOBS(lgj) lgj->ShiftJoinDate(interval);
+}
+
+/**
* Create a link graph schedule and initialize its handlers.
*/
LinkGraphSchedule::LinkGraphSchedule()
diff --git a/src/linkgraph/linkgraphschedule.h b/src/linkgraph/linkgraphschedule.h
index 911fa389a..25c56904f 100644
--- a/src/linkgraph/linkgraphschedule.h
+++ b/src/linkgraph/linkgraphschedule.h
@@ -62,6 +62,7 @@ public:
void SpawnNext();
void JoinNext();
void SpawnAll();
+ void ShiftDates(int interval);
/**
* Queue a link graph for execution.