mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-27 05:54:13 -05:00
* Initial * CSS lint * Test CI * Add 1v1, 2v2, and 3v3 Tags (#1771) * Initial * CSS lint * Test CI * Rename step --------- Co-authored-by: xi <104683822+ximk@users.noreply.github.com>
35 lines
507 B
TypeScript
35 lines
507 B
TypeScript
import { ordinal } from "openskill";
|
|
import { sql } from "~/db/sql";
|
|
|
|
const stm = sql.prepare(/* sql */ `
|
|
insert into "Skill" ("mu", "season", "sigma", "ordinal", "userId", "matchesCount")
|
|
values (
|
|
@mu,
|
|
@season,
|
|
@sigma,
|
|
@ordinal,
|
|
@userId,
|
|
0
|
|
)
|
|
`);
|
|
|
|
export function addInitialSkill({
|
|
mu,
|
|
sigma,
|
|
season,
|
|
userId,
|
|
}: {
|
|
mu: number;
|
|
sigma: number;
|
|
season: number;
|
|
userId: number;
|
|
}) {
|
|
stm.run({
|
|
mu,
|
|
sigma,
|
|
season,
|
|
ordinal: ordinal({ mu, sigma }),
|
|
userId,
|
|
});
|
|
}
|