Moduł:Rekordy sezon: Różnice pomiędzy wersjami
Wygląd
Nie podano opisu zmian |
Nie podano opisu zmian |
||
| (Nie pokazano 3 pośrednich wersji utworzonych przez tego samego użytkownika) | |||
| Linia 193: | Linia 193: | ||
return tekst | return tekst | ||
end | end | ||
| Linia 212: | Linia 199: | ||
-- ========================================================= | -- ========================================================= | ||
-- FUNKCJA DODAWANIA REKORDU | -- FUNKCJA DODAWANIA REKORDU | ||
-- | -- UŻYWANA PRZEZ PIŁKĘ NOŻNĄ | ||
-- ========================================================= | -- ========================================================= | ||
| Linia 230: | Linia 212: | ||
return | return | ||
end | end | ||
local lista = | local lista = | ||
tabela[miejsce] | tabela[miejsce] | ||
if #lista == 0 then | if #lista == 0 then | ||
| Linia 268: | Linia 229: | ||
local obecna = | local obecna = | ||
lista[1].wartosc | |||
| Linia 306: | Linia 265: | ||
local roznica = | local roznica = | ||
item.roznica or 0 | |||
local roznicaTekst | local roznicaTekst | ||
| Linia 377: | Linia 336: | ||
wartosc = | wartosc = | ||
tostring(item.punkty | tostring(item.punkty) .. | ||
" pkt" | " pkt" | ||
| Linia 405: | Linia 364: | ||
wartosc = | wartosc = | ||
tostring(item.asysty | tostring(item.asysty) .. | ||
" as." | " as." | ||
| Linia 412: | Linia 371: | ||
wartosc = | wartosc = | ||
tostring(item.zbiorki | tostring(item.zbiorki) .. | ||
" zb." | " zb." | ||
| Linia 419: | Linia 378: | ||
wartosc = | wartosc = | ||
tostring(item.eval | tostring(item.eval) .. | ||
" EVAL" | " EVAL" | ||
| Linia 426: | Linia 385: | ||
local pm = | local pm = | ||
item.plusminus or 0 | |||
if pm >= 0 then | if pm >= 0 then | ||
| Linia 612: | Linia 571: | ||
roznica = | roznica = | ||
roznica, | |||
wartosc = | |||
roznica, | roznica, | ||
| Linia 618: | Linia 580: | ||
wynik = | wynik = | ||
tostring( | tostring(zdobyte) .. | ||
":" .. | ":" .. | ||
tostring(stracone) | tostring(stracone) | ||
| Linia 643: | Linia 605: | ||
if roznica < 0 then | if roznica < 0 then | ||
item.wartosc = | |||
math.abs(roznica) | math.abs(roznica) | ||
item. | item.przegrana = | ||
math.abs(roznica) | |||
local lista = | |||
najwyzszaPorazka[miejsce] | |||
if #lista == 0 then | |||
miejsce | |||
przegrana, | table.insert( | ||
lista, | |||
item | |||
) | |||
else | |||
local obecna = | |||
lista[1].przegrana | |||
if item.przegrana > obecna then | |||
najwyzszaPorazka[miejsce] = { | |||
item | |||
} | |||
elseif item.przegrana == obecna then | |||
table.insert( | |||
lista, | |||
item | |||
) | |||
end | |||
end | |||
end | end | ||
| Linia 724: | Linia 710: | ||
) | ) | ||
-- ===================================================== | |||
-- REKORDY INDYWIDUALNE | |||
-- KAŻDA STATYSTYKA MA WŁASNY REKORD | |||
-- ===================================================== | |||
local rekordy = { | local rekordy = { | ||
| Linia 760: | Linia 751: | ||
-- ===================================================== | |||
-- DODAWANIE REKORDU KOSZYKARSKIEGO | |||
-- ===================================================== | |||
local function dodajRekordKoszykarski( | |||
tabela, | |||
miejsce, | |||
wartosc, | |||
item | |||
) | |||
if wartosc == nil then | |||
return | |||
end | |||
local lista = | |||
tabela[miejsce] | |||
if not lista then | |||
return | |||
end | |||
if #lista == 0 then | |||
miejsce = | table.insert( | ||
lista, | |||
{ | |||
zawodnik = item.zawodnik, | |||
mecz = item.mecz, | |||
data = item.data, | |||
miejsce = item.miejsce, | |||
tekst = item.tekst, | |||
wynik = item.wynik, | |||
wartosc = wartosc, | |||
minuty_format = item.minuty_format, | |||
punkty = item.punkty, | |||
minuty = item.minuty, | |||
asysty = item.asysty, | |||
zbiorki = item.zbiorki, | |||
eval = item.eval, | |||
plusminus = item.plusminus | |||
} | |||
) | |||
return | |||
end | |||
local obecna = | |||
lista[1].wartosc | |||
if wartosc > obecna then | |||
zbiorki = | tabela[miejsce] = { | ||
{ | |||
zawodnik = item.zawodnik, | |||
mecz = item.mecz, | |||
data = item.data, | |||
miejsce = item.miejsce, | |||
tekst = item.tekst, | |||
wynik = item.wynik, | |||
wartosc = wartosc, | |||
minuty_format = item.minuty_format, | |||
punkty = item.punkty, | |||
minuty = item.minuty, | |||
asysty = item.asysty, | |||
zbiorki = item.zbiorki, | |||
eval = item.eval, | |||
plusminus = item.plusminus | |||
} | |||
} | |||
elseif wartosc == obecna then | |||
table.insert( | |||
lista, | |||
{ | |||
zawodnik = item.zawodnik, | |||
mecz = item.mecz, | |||
data = item.data, | |||
miejsce = item.miejsce, | |||
tekst = item.tekst, | |||
wynik = item.wynik, | |||
wartosc = wartosc, | |||
minuty_format = item.minuty_format, | |||
punkty = item.punkty, | |||
minuty = item.minuty, | |||
asysty = item.asysty, | |||
zbiorki = item.zbiorki, | |||
eval = item.eval, | |||
plusminus = item.plusminus | |||
} | } | ||
) | |||
end | |||
end | |||
-- ===================================================== | |||
-- PRZETWARZANIE STATYSTYK ZAWODNIKÓW | |||
-- ===================================================== | |||
if zawodnicy then | |||
for _, row in ipairs(zawodnicy) do | |||
local miejsce = | |||
miejsceMeczu( | |||
row, | |||
druzyna | |||
) | ) | ||
if miejsce then | |||
-- ========================================= | |||
-- KAŻDA WARTOŚĆ POBIERANA OSOBNO | |||
-- ========================================= | |||
local punkty = | |||
liczba(row.gol) | |||
local minuty = | |||
liczba(row.minuty) | |||
local asysty = | |||
liczba(row.asysta) | |||
local zbiorki = | |||
liczba(row.zbiorka) | |||
local eval = | |||
liczba(row.eval) | |||
local plusminus = | |||
liczba(row.plusminus) | |||
local item = { | |||
zawodnik = | |||
row.zawodnik or "", | |||
mecz = | |||
row.mecz or "", | |||
data = | |||
row.data or "", | |||
miejsce = | |||
miejsce, | |||
tekst = | |||
nazwaMeczu(row), | |||
wynik = | |||
row.wynik or "", | |||
minuty_format = | |||
row.minuty_format or "", | |||
punkty = | |||
punkty, | |||
minuty = | |||