Leaguepedia | League of Legends Esports Wiki
[checked revision][checked revision]
(+ inline)
(finalExtends)
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
local Class = require('Module:Class').Class
+
local p = require('Module:EntityAbstract'):finalExtends()
local MarkupObject = require('Module:MarkupObjectClass')
 
   
  +
p.objectType = 'Champion'
local Champion = Class(MarkupObject)
 
  +
p.cssClass = 'champion-object'
 
p.defaultlength = 'display'
  +
p.imagelength = 'link'
  +
p.filePattern = '%sSquare.png'
 
p.imagesizes = { default = 25, display = 25, inline = 20, }
   
function Champion:new(str, opts)
+
function p:name(opts)
  +
if not opts then opts = {} end
self:super(str, 'Champion', opts)
 
  +
return opts.display or self:get(opts.len or self.defaultlength)
if self.unknown then
 
error('Unrecognized champion name: ' .. tostring(str))
 
end
 
self.vars.exception = false
 
self.defaultlength = 'display'
 
self.imagesizes = { display = 25, inline = 20, }
 
 
end
 
end
   
return Champion
+
return p

Revision as of 05:40, 24 August 2020

Edit the documentation or categories for this module.

If you are an editor wanting to update the list of champions, see {{Championnames}}m


local p = require('Module:EntityAbstract'):finalExtends()

p.objectType = 'Champion'
p.cssClass = 'champion-object'
p.defaultlength = 'display'
p.imagelength = 'link'
p.filePattern = '%sSquare.png'
p.imagesizes = { default = 25, display = 25, inline = 20, }

function p:name(opts)
	if not opts then opts = {} end
	return opts.display or self:get(opts.len or self.defaultlength)
end

return p