Skip to content

Commit

Permalink
System18: Remove discarded trains from the game in correct way
Browse files Browse the repository at this point in the history
  • Loading branch information
vandamm committed Oct 13, 2024
1 parent 92f2c63 commit 62c4286
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
11 changes: 3 additions & 8 deletions lib/engine/game/g_system18/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ class Game < Game::Base
BANKRUPTCY_ENDS_GAME_AFTER = :one
STATUS_TEXT = {}.freeze
TILE_UPGRADES_MUST_USE_MAX_EXITS = [].freeze
DISCARDED_TRAINS = :remove

def find_map_name
optional_rules&.find { |r| r.to_s.include?('map_') }&.to_s&.delete_prefix('map_')&.downcase
Expand Down Expand Up @@ -460,7 +461,7 @@ def operating_steps
GSystem18::Step::Token,
Engine::Step::Route,
GSystem18::Step::Dividend,
GSystem18::Step::DiscardTrain,
Engine::Step::DiscardTrain,
GSystem18::Step::BuyTrain,
]
else
Expand All @@ -475,7 +476,7 @@ def operating_steps
GSystem18::Step::Token,
Engine::Step::Route,
GSystem18::Step::Dividend,
GSystem18::Step::DiscardTrain,
Engine::Step::DiscardTrain,
GSystem18::Step::BuyTrain,
[Engine::Step::BuyCompany, { blocks: true }],
]
Expand Down Expand Up @@ -692,12 +693,6 @@ def place_home_token(corporation)

send("map_#{map_name}_place_home_token", corporation)
end

def remove_discarded_train?(train)
return true unless respond_to?("map_#{map_name}_remove_discarded_train?")

send("map_#{map_name}_remove_discarded_train?", train)
end
end
end
end
Expand Down
22 changes: 0 additions & 22 deletions lib/engine/game/g_system18/step/discard_train.rb

This file was deleted.

0 comments on commit 62c4286

Please sign in to comment.