Line 47: |
Line 47: |
| ]=] | | ]=] |
| | | |
− | -- [[Category:Todo]]: really need something better here | + | -- [[Category:Todo]]: need something better here |
− | | |
− | -- can count for scoring
| |
− | -- can store fleet types in ship data modules
| |
| local friendTypes = { | | local friendTypes = { |
− | ['DesDiv 31'] = { | + | ['Early Fall 2018 Event'] = { |
− | 'Kishinami', | + | ['DesDiv 31'] = { |
− | 'Naganami', | + | 'Kishinami', |
| + | 'Naganami', |
| + | }, |
| + | ['Europe Fleet'] = { |
| + | 'Gotland', |
| + | 'Italia', |
| + | 'Littorio', |
| + | 'Nelson', |
| + | 'Pola', |
| + | 'Roma', |
| + | 'Warspite', |
| + | 'Zara', |
| + | 'Commandant Teste', |
| + | }, |
| + | ['US Fleet'] = { |
| + | 'Intrepid', |
| + | 'Saratoga' |
| + | } |
| }, | | }, |
− | ['Europe Fleet'] = {
| |
− | 'Gotland',
| |
− | 'Italia',
| |
− | 'Littorio',
| |
− | 'Nelson',
| |
− | 'Pola',
| |
− | 'Roma',
| |
− | 'Warspite',
| |
− | 'Zara',
| |
− | 'Commandant Teste',
| |
− | },
| |
− | ['US Fleet'] = {
| |
− | 'Intrepid',
| |
− | 'Saratoga'
| |
− | }
| |
− | }
| |
− |
| |
− | local moreQuickHardcode = {
| |
| ['Winter 2019 Event'] = { | | ['Winter 2019 Event'] = { |
− | ['4 DD'] = { 'Kazagumo' }, | + | ['Minegumo'] = { 'Minegumo' }, |
− | ['1CVL 2DE'] = { 'Shinyou' }, | + | ['Kishinami'] = { 'Kishinami' }, |
| + | ['Fujinami'] = { 'Fujinami' }, |
| + | ['Isokaze'] = { 'Isokaze' }, |
| + | ['Yamato'] = { 'Yamato' }, |
| + | ['Kazagumo'] = { 'Kazagumo' }, |
| + | ['Shinyou'] = { 'Shinyou' }, |
| } | | } |
| } | | } |
| | | |
| local function getFleetType(fleet, name) | | local function getFleetType(fleet, name) |
− | for k, v in pairs(friendTypes) do | + | for k, v in pairs(friendTypes[name] or {}) 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 |