Modulo:TeamBracket: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
fix uso getWidth |
aggiungo commenti |
||
Riga 155:
end
return seeds
end▼
--[[ ===============================================================================
Ritorna il valore per i parameri di larghezza (seed-widt, score-width, team-width)
===============================================================================]]
function TeamBracket:getWidth(param, default)▼
local arg = self.args[param .. '-width']▼
if not arg then return default end▼
end
Line 176 ⟶ 185:
end
--[[ ===============================================================================
▲function TeamBracket:getWidth(param, default)
Ritorna il nome completo del parametro 'argname' della squadra 'team' nel round 'round'
▲ local arg = self.args[param .. '-width']
Per esempio getTeamArgName(1, 'seed', 3) ritorna 'RD1-seed3' o ''RD1-seed03' se ci sono
▲ if not arg then return default end
10 squadre o più
▲ arg = arg .. ((tonumber(arg) and 'px') or '')
===============================================================================]]
▲end
function TeamBracket:getTeamArgName(round, argname, team)
return string.format(self.argname_pattern, round, argname, team)
end
--[[ ===============================================================================
Ritorna il valore del parametro 'argname' della squadra 'team' nel round 'round',
Per esempio getTeamArg(1, 'seed', 3) ritorna il valore del parametro 'RD1-seed3'
===============================================================================]]
function TeamBracket:getTeamArg(round, argname, team)
return self.args[self:getTeamArgName(round, argname, team)]
end
--[[ ===============================================================================
Ritorna il valore dello score dato il round, la posizione nel round (team) e il
progressivo dell'incontro.
===============================================================================]]
function TeamBracket:getScoreArg(round, team, score)
return self.args[string.format(self.scorename_pattern, round, team, score)]
end
--[[ ===============================================================================
Ritorna il nome del round 'round' o il suo nome di default se non è precisato.
===============================================================================]]
function TeamBracket:getRoundName(round)
local name = self.args['RD' .. round]
|