lib/engine/game/g_1862/game.rb
# returns list of combinations of stops
returns list of combinations of stops
returns list of combinations of stops
def revenue_stop_options(route)
          visits = route.visited_stops
          if train_type(route.train) == :freight
            [freight_revenue_stops(route, visits)]
          else
            all_stops = visits.select { |n| n.city? || n.offboard? }
            stop_options = []
            all_stops.combination(route.train.distance[0]['pay']) { |c| stop_options << c }
            stop_options = [[]] if stop_options.empty?
            stop_options
          end
        end
def revenue_stop_options ( route ) visits = route . visited_stops if train_type ( route . train ) == :freight [ freight_revenue_stops ( route , visits ) ] else all_stops = visits . select { | n | n . city? || n . offboard? } stop_options = [ ] all_stops . combination ( route . train . distance [ 0 ] [ 'pay' ] ) { | c | stop_options << c } stop_options = [ [ ] ] if stop_options . empty? stop_options end end
returns list of combinations of stops
returns list of combinations of stops
# OK, since local trains won't have offboards
route
<not_specific>