Module:MultiOpKai

local BaseData = require("Module:BaseData") local ShipCardKai, ShipBattleCardKai, ShipCardComboKai, EquipmentCardKai, EquipmentGraphicKai, AirUnitGraphicKai, ShipLinkKai, EquipmentLinkKai

local split = require('Module:StringOperations').split

local MultiOpKai = BaseData{}

function MultiOpKai:Wikitext(args) return self{_args = args}:process_wikitext end

function MultiOpKai:process_wikitext return (string.gsub(self._args.text, '${([^%.%!%:%}%[%]]+)!?([^%}]*)}', function (operation, args) if self[operation] then args = self:process_args(args) return self[operation](self, args) end end)) end function MultiOpKai:process_args(args) local result = {} mw.log(args) for _, arg_pair in ipairs(split(args, ":")) do       local arg = split(arg_pair, ">") if arg[2] then result[arg[1]] = arg[2] else table.insert(result, arg[1]) end end return result end

function MultiOpKai:ShipCardKai(args) if not ShipCardKai then ShipCardKai = require('Module:ShipCardKai') end return ShipCardKai:Asset(args) end

function MultiOpKai:ShipBattleCardKai(args) if not ShipBattleCardKai then ShipBattleCardKai = require('Module:ShipBattleCardKai') end return ShipBattleCardKai:Asset(args) end

function MultiOpKai:ShipCardComboKai(args) if not ShipCardComboKai then ShipCardComboKai = require('Module:ShipCardComboKai') end return ShipCardComboKai:Asset(args) end

function MultiOpKai:EquipmentCardKai(args) if not EquipmentCardKai then EquipmentCardKai = require('Module:EquipmentCardKai') end return EquipmentCardKai:Asset(args) end

function MultiOpKai:EquipmentGraphicKai(args) if not EquipmentGraphicKai then EquipmentGraphicKai = require('Module:EquipmentGraphicKai') end return EquipmentGraphicKai(args) end

function MultiOpKai:ShipLinkKai(args) if not ShipLinkKai then ShipLinkKai = require('Module:ShipLinkKai') end return ShipLinkKai:Asset(args) end

return MultiOpKai