Changes
Refactor out formatting
local EquipmentData = BaseData()
local EquipmentData = BaseData()
function EquipmentData:name(raw)
function EquipmentData:name()
return self:format_stat(self._name, raw)
return self._name
end
end
function EquipmentData:link(raw)
function EquipmentData:link()
if self._page then
if self._page then
return mw.ustring.format(self._aliased_link, self._page, self:name())
return self._page, self:name()
else
else
return mw.ustring.format(self._simple_link, self:name())
return self:name()
end
end
end
end
function EquipmentData:id(raw)
function EquipmentData:id()
return self:format_stat(self._id, raw)
return self._id
end
end
function EquipmentData:japanese_name(raw)
function EquipmentData:japanese_name()
return self:format_stat(self._japanese_name, raw)
return self._japanese_name
end
end
function EquipmentData:type(raw)
function EquipmentData:type()
return self:format_type(self._type, raw)
return self._type
end
end
function EquipmentData:rarity(raw)
function EquipmentData:rarity()
return self:format_rarity(self._rarity, raw)
return self._rarity
end
end
function EquipmentData:stars()
function EquipmentData:stars()
return self._stars or self:rarity(true)
return self._stars or self:rarity()
end
end
end
end
function EquipmentData:card(raw)
function EquipmentData:card()
return self:format_image(self._card, nil, raw)
return self._card
end
end
function EquipmentData:icon(raw)
function EquipmentData:icon()
return self:format_image(self:format_icon(self._icon, raw), nil, raw)
return self._icon
end
end
function EquipmentData:firepower(raw)
function EquipmentData:firepower()
return self:format_stat(self._firepower, raw)
return self._firepower
end
end
function EquipmentData:bombing(raw)
function EquipmentData:bombing()
return self:format_stat(self._bombing, raw)
return self._bombing
end
end
function EquipmentData:torpedo(raw)
function EquipmentData:torpedo()
return self:format_stat(self._torpedo, raw)
return self._torpedo
end
end
function EquipmentData:aa(raw)
function EquipmentData:aa()
return self:format_stat(self._aa, raw)
return self._aa
end
end
function EquipmentData:armor(raw)
function EquipmentData:armor()
return self:format_stat(self._armor, raw)
return self._armor
end
end
function EquipmentData:asw(raw)
function EquipmentData:asw()
return self:format_stat(self._asw, raw)
return self._asw
end
end
function EquipmentData:shelling_accuracy(raw)
function EquipmentData:shelling_accuracy()
return self:format_stat(self._shelling_accuracy, raw)
return self._shelling_accuracy
end
end
function EquipmentData:torpedo_accuracy(raw)
function EquipmentData:torpedo_accuracy()
return self:format_stat(self._torpedo_accuracy, raw)
return self._torpedo_accuracy
end
end
function EquipmentData:los(raw)
function EquipmentData:los()
return self:format_stat(self._los, raw)
return self._los
end
end
function EquipmentData:speed(raw)
function EquipmentData:speed()
return self:format_speed(self._speed, raw)
return self._speed
end
end
function EquipmentData:luck(raw)
function EquipmentData:luck()
return self:format_stat(self._luck, raw)
return self._luck
end
end
function EquipmentData:range(raw)
function EquipmentData:range()
return self:format_range(self._range, raw)
return self._range
end
end
function EquipmentData:scrap_fuel(raw)
function EquipmentData:scrap_fuel()
return self:format_stat(self._scrap_fuel, raw)
return self._scrap_fuel
end
end
function EquipmentData:scrap_ammo(raw)
function EquipmentData:scrap_ammo()
return self:format_stat(self._scrap_ammo, raw)
return self._scrap_ammo
end
end
function EquipmentData:scrap_steel(raw)
function EquipmentData:scrap_steel()
return self:format_stat(self._scrap_steel, raw)
return self._scrap_steel
end
end
function EquipmentData:scrap_bauxite(raw)
function EquipmentData:scrap_bauxite()
return self:format_stat(self._scrap_bauxite, raw)
return self._scrap_bauxite
end
end
function EquipmentData:upgradable(raw)
function EquipmentData:upgradable()
return not not self._upgradable
return not not self._upgradable
end
end
function EquipmentData:create(equip)
function EquipmentData:create(equip)