Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/engine/game/g_18_india/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1031,8 +1031,8 @@ def variable_city_revenue(route, stops)
variable_city_stops.count * [max_non_variable_value, 0].max * train_multiplier
end

def connection_bonus(route, _stops)
visited_location_names = route.visited_stops.map { |stop| stop.tile.location_name }.compact
def connection_bonus(_route, stops)
visited_location_names = stops.map { |stop| stop.tile.location_name }.compact

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strongly recommend: Add state-based fixture test

Since 18India has existing fixtures, please add a test case that:

  1. Runs a 4E train that visits but does not pay for both cities of a bonus pair
  2. Confirms R+ does not appear
  3. Runs a 4E that pays for both cities
  4. Confirms R+ appears

Alternative: If setting up the game state is complex, a unit test for connection_bonus method verifying it uses the stops parameter (not route.visited_stops) would also work.

return 0 if visited_location_names.count < 2

# Delhi, Kochi => 100 [G8, G36]
Expand Down
Loading