Changes
Refactor
local Formatting = require('Module:Formatting')
local Formatting = require('Module:Formatting')
local ShipAsset = require('Module:ShipAsset')
local ShipGraphicKai = {}
local ShipGraphicKai = ShipAsset{}
function ShipGraphicKai:create_ship(args)
function ShipGraphicKai:get_source(ship, args)
return args.damaged and ship:cg_damaged() or ship:cg()
end
end
function ShipGraphicKai:graphic(ship, args, link)
function ShipGraphicKai:get(ship, args, link)
if not args then
if not args then
args = ship
args = ship
ship = args.ship
ship = args.ship
end
end
return Formatting:format_image{args.damaged and ship:cg_damaged() or ship:cg(), size = args.size, link = link, caption = args.caption}
return Formatting:format_image{self:get_source(ship, args), size = args.size, link = link, caption = args.caption}
end
end
return ShipGraphicKai
return ShipGraphicKai