Changes

m
Remove some hard-coding.
Line 70: Line 70:     
function NanaminFleet:Infobox(args)
 
function NanaminFleet:Infobox(args)
     local ships = {
+
     local ships = {}
        --When you have no idea how to do dynamic variable naming...hard-coding.
+
    for i = 1, 6 do
        ship1 = Ship(args.ships.ship1.name, args.ships.ship1.remodel),
+
         ships[i] = Ship(args.ships[i].name, args.ships[i].remodel)
         ship2 = Ship(args.ships.ship2.name, args.ships.ship2.remodel),
+
     end
        ship3 = Ship(args.ships.ship3.name, args.ships.ship3.remodel),
  −
        ship4 = Ship(args.ships.ship4.name, args.ships.ship4.remodel),
  −
        ship5 = Ship(args.ships.ship5.name, args.ships.ship5.remodel),
  −
        ship6 = Ship(args.ships.ship6.name, args.ships.ship6.remodel)
  −
     }
   
     return format(self._template)
 
     return format(self._template)
 
end
 
end
    
return NanaminFleet
 
return NanaminFleet
48

edits