forked from tobymao/18xx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
98 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../g_1858/graph' | ||
|
||
module Engine | ||
module Game | ||
module G18CH | ||
class Graph < G1858::Graph | ||
private | ||
|
||
def path_node(path, entity) | ||
node = G1858::Part::PathNode.new(path) | ||
return node unless path.hex == @game.gotthard | ||
|
||
# The pre-printed Gotthard hex is a special case. It is a home hex | ||
# for two private railways (FOB and GB) and it has two paths, one | ||
# broad gauge and one metre (narrow) gauge. FOB is only allowed to | ||
# trace routes from this hex using the metre gauge path, and GB can | ||
# only use the broad gauge path. | ||
return node if (path.track == :broad && entity == @game.gb_minor) || | ||
(path.track == :narrow && entity == @game.fob_minor) | ||
end | ||
end | ||
end | ||
end | ||
end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.