Line 46: |
Line 46: |
| !colspan="4"|Equipment | | !colspan="4"|Equipment |
| ]=] | | ]=] |
| + | |
| + | -- [[Category:Todo]]: really need something better here |
| | | |
| -- can count for scoring | | -- can count for scoring |
Line 71: |
Line 73: |
| } | | } |
| | | |
− | local function getFleetType(fleet) | + | local moreQuickHardcode = { |
| + | ['Winter 2019 Event'] = { |
| + | ['4 DD'] = { 'Kazagumo' }, |
| + | ['1CVL 2DE'] = { 'Shinyou' }, |
| + | } |
| + | } |
| + | |
| + | local function getFleetType(fleet, name) |
| for k, v in pairs(friendTypes) do | | for k, v in pairs(friendTypes) do |
| + | for i, ship in ipairs(v) do |
| + | if _.ifindBy(fleet, function (e) return _.startsWith(e.ship, ship) end) then |
| + | return k |
| + | end |
| + | end |
| + | end |
| + | for k, v in pairs(moreQuickHardcode[name] or {}) do |
| for i, ship in ipairs(v) do | | for i, ship in ipairs(v) do |
| if _.ifindBy(fleet, function (e) return _.startsWith(e.ship, ship) end) then | | if _.ifindBy(fleet, function (e) return _.startsWith(e.ship, ship) end) then |
Line 99: |
Line 115: |
| for i, e in pairs(data) do | | for i, e in pairs(data) do |
| if not args.map or _.ifind(e.maps, args.map) then | | if not args.map or _.ifind(e.maps, args.map) then |
− | local fleetType = getFleetType(e.fleet) | + | local fleetType = getFleetType(e.fleet, args.friend) |
| groups[fleetType] = groups[fleetType] or {} | | groups[fleetType] = groups[fleetType] or {} |
| table.insert(groups[fleetType], e) | | table.insert(groups[fleetType], e) |