summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2011-04-19 15:00:11 +0000
committersmatz <smatz@openttd.org>2011-04-19 15:00:11 +0000
commit6e011e9e682801beb3301654f19e05dd76eaf9f8 (patch)
treea913e07ec47c313796c84826aef69236d240b287
parent64cd6a62a2d819b0867162971ce9c9436fe734c0 (diff)
downloadopenttd-6e011e9e682801beb3301654f19e05dd76eaf9f8.tar.xz
(svn r22348) -Codechange: split ship-specific part of yapf_node.hpp to yapf_node_ship.hpp
-rw-r--r--projects/openttd_vs100.vcxproj1
-rw-r--r--projects/openttd_vs100.vcxproj.filters3
-rw-r--r--projects/openttd_vs80.vcproj4
-rw-r--r--projects/openttd_vs90.vcproj4
-rw-r--r--source.list1
-rw-r--r--src/pathfinder/yapf/yapf_node.hpp17
-rw-r--r--src/pathfinder/yapf/yapf_node_ship.hpp32
-rw-r--r--src/pathfinder/yapf/yapf_ship.cpp1
8 files changed, 46 insertions, 17 deletions
diff --git a/projects/openttd_vs100.vcxproj b/projects/openttd_vs100.vcxproj
index 7584a8c2b..936689b6c 100644
--- a/projects/openttd_vs100.vcxproj
+++ b/projects/openttd_vs100.vcxproj
@@ -1079,6 +1079,7 @@
<ClInclude Include="..\src\pathfinder\yapf\yapf_node.hpp" />
<ClInclude Include="..\src\pathfinder\yapf\yapf_node_rail.hpp" />
<ClInclude Include="..\src\pathfinder\yapf\yapf_node_road.hpp" />
+ <ClInclude Include="..\src\pathfinder\yapf\yapf_node_ship.hpp" />
<ClCompile Include="..\src\pathfinder\yapf\yapf_rail.cpp" />
<ClCompile Include="..\src\pathfinder\yapf\yapf_road.cpp" />
<ClCompile Include="..\src\pathfinder\yapf\yapf_ship.cpp" />
diff --git a/projects/openttd_vs100.vcxproj.filters b/projects/openttd_vs100.vcxproj.filters
index 0020eb189..587e3f698 100644
--- a/projects/openttd_vs100.vcxproj.filters
+++ b/projects/openttd_vs100.vcxproj.filters
@@ -2457,6 +2457,9 @@
<ClInclude Include="..\src\pathfinder\yapf\yapf_node_road.hpp">
<Filter>YAPF</Filter>
</ClInclude>
+ <ClInclude Include="..\src\pathfinder\yapf\yapf_node_ship.hpp">
+ <Filter>YAPF</Filter>
+ </ClInclude>
<ClCompile Include="..\src\pathfinder\yapf\yapf_rail.cpp">
<Filter>YAPF</Filter>
</ClCompile>
diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj
index fb84d3e50..79212eeab 100644
--- a/projects/openttd_vs80.vcproj
+++ b/projects/openttd_vs80.vcproj
@@ -3683,6 +3683,10 @@
>
</File>
<File
+ RelativePath=".\..\src\pathfinder\yapf\yapf_node_ship.hpp"
+ >
+ </File>
+ <File
RelativePath=".\..\src\pathfinder\yapf\yapf_rail.cpp"
>
</File>
diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj
index 0ee69329c..c6487d6cb 100644
--- a/projects/openttd_vs90.vcproj
+++ b/projects/openttd_vs90.vcproj
@@ -3680,6 +3680,10 @@
>
</File>
<File
+ RelativePath=".\..\src\pathfinder\yapf\yapf_node_ship.hpp"
+ >
+ </File>
+ <File
RelativePath=".\..\src\pathfinder\yapf\yapf_rail.cpp"
>
</File>
diff --git a/source.list b/source.list
index 970a53d7d..cc3562e55 100644
--- a/source.list
+++ b/source.list
@@ -880,6 +880,7 @@ pathfinder/yapf/yapf_destrail.hpp
pathfinder/yapf/yapf_node.hpp
pathfinder/yapf/yapf_node_rail.hpp
pathfinder/yapf/yapf_node_road.hpp
+pathfinder/yapf/yapf_node_ship.hpp
pathfinder/yapf/yapf_rail.cpp
pathfinder/yapf/yapf_road.cpp
pathfinder/yapf/yapf_ship.cpp
diff --git a/src/pathfinder/yapf/yapf_node.hpp b/src/pathfinder/yapf/yapf_node.hpp
index 0ed3748e5..0eb9802de 100644
--- a/src/pathfinder/yapf/yapf_node.hpp
+++ b/src/pathfinder/yapf/yapf_node.hpp
@@ -81,21 +81,4 @@ struct CYapfNodeT {
}
};
-/** Yapf Node for ships */
-template <class Tkey_>
-struct CYapfShipNodeT
- : CYapfNodeT<Tkey_, CYapfShipNodeT<Tkey_> >
-{
-
-};
-
-/* now define two major node types (that differ by key type) */
-typedef CYapfShipNodeT<CYapfNodeKeyExitDir> CYapfShipNodeExitDir;
-typedef CYapfShipNodeT<CYapfNodeKeyTrackDir> CYapfShipNodeTrackDir;
-
-/* Default NodeList types */
-typedef CNodeList_HashTableT<CYapfShipNodeExitDir , 14, 16> CShipNodeListExitDir;
-typedef CNodeList_HashTableT<CYapfShipNodeTrackDir, 16, 20> CShipNodeListTrackDir;
-
-
#endif /* YAPF_NODE_HPP */
diff --git a/src/pathfinder/yapf/yapf_node_ship.hpp b/src/pathfinder/yapf/yapf_node_ship.hpp
new file mode 100644
index 000000000..3fbc299f7
--- /dev/null
+++ b/src/pathfinder/yapf/yapf_node_ship.hpp
@@ -0,0 +1,32 @@
+/* $Id$ */
+
+/*
+ * This file is part of OpenTTD.
+ * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
+ * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/** @file yapf_node_ship.hpp Node tailored for ship pathfinding. */
+
+#ifndef YAPF_NODE_SHIP_HPP
+#define YAPF_NODE_SHIP_HPP
+
+/** Yapf Node for ships */
+template <class Tkey_>
+struct CYapfShipNodeT
+ : CYapfNodeT<Tkey_, CYapfShipNodeT<Tkey_> >
+{
+
+};
+
+/* now define two major node types (that differ by key type) */
+typedef CYapfShipNodeT<CYapfNodeKeyExitDir> CYapfShipNodeExitDir;
+typedef CYapfShipNodeT<CYapfNodeKeyTrackDir> CYapfShipNodeTrackDir;
+
+/* Default NodeList types */
+typedef CNodeList_HashTableT<CYapfShipNodeExitDir , 14, 16> CShipNodeListExitDir;
+typedef CNodeList_HashTableT<CYapfShipNodeTrackDir, 16, 20> CShipNodeListTrackDir;
+
+
+#endif /* YAPF_NODE_SHIP_HPP */
diff --git a/src/pathfinder/yapf/yapf_ship.cpp b/src/pathfinder/yapf/yapf_ship.cpp
index 51fc84944..69f1ce2c5 100644
--- a/src/pathfinder/yapf/yapf_ship.cpp
+++ b/src/pathfinder/yapf/yapf_ship.cpp
@@ -13,6 +13,7 @@
#include "../../ship.h"
#include "yapf.hpp"
+#include "yapf_node_ship.hpp"
/** Node Follower module of YAPF for ships */
template <class Types>