Skip to content

SendouQ match · Modules

3 modules · 17 exports · 5 repositories · 13 e2e tests · 1 route

Who imports who · hover a node
Depends onSendouQ match modulesUsed byRejoinVote7 exportsSendouQMatch5 exportsSkillDifference5 exportsActions1 fileRepositories1 fileComponents6 filesRoutes1 fileSendouQ.serversendouq

RejoinVote

app/features/sendouq-match/core/RejoinVote.ts

No overview comment at the top of the file.

Imports
SendouQMatch
Used by
1 action1 repository2 components

Types

interface

RejoinVote

no JSDoc:5
export interface RejoinVote {
	userId: number;
	isContinuing: boolean;
}

Functions & values

function

result

:13

ONGOING until every member of a full group has voted, then RESOLVED with the ids continuing, or FAILED if too few to form a viable group.

export function result(votes: RejoinVote[])
Unit tests (3)
function

agreedNominatedUserId

:36

The one player both teams named as a cause of the cancellation, or null when they named nobody in common or agreed on more than one.

export function agreedNominatedUserId(nominationsByTeam: number[][])
Unit tests (1)
function

userContinueStatus

:46

The user's vote, or null if they have not voted.

export function userContinueStatus(votes: RejoinVote[], userId: number)
Unit tests (2)
function

canCastVote

:51

Whether the user may still cast isContinuing: a first vote while ongoing, or changing a yes to a no; a no is final.

export function canCastVote(
	votes: RejoinVote[],
	userId: number,
	isContinuing: boolean,
)
Unit tests (5)
function

extractOwnGroupVotesFromSendouqMatch

:65

Votes cast within the viewer's own group, or null if they are in neither side of the match.

export function extractOwnGroupVotesFromSendouqMatch(
	match: Pick<SQMatch, "groupAlpha" | "groupBravo">,
	userId: number,
): RejoinVote[] | null
Unit tests (2)
function

currentUserIds

:94

Group member ids minus anyone who voted against continuing.

export function currentUserIds(
	votes: RejoinVote[],
	groupMemberIds: number[],
): number[]
Unit tests (1)

SendouQMatch

app/features/sendouq-match/core/SendouQMatch.ts

No overview comment at the top of the file.

Imports
no other modules
Used by
1 action1 route1 repository2 modules3 components

Functions & values

function

score

:6

Each group's map win count and whether one has reached the best-of's required wins.

export function score(match: {
	mapList: Array<{ winnerGroupId: number | null }>;
	groupAlpha: { id: number };
	groupBravo: { id: number };
})
Unit tests (3)
function

allMembers

:28

Members of both groups of the match, alpha's first.

export function allMembers<T>(match: {
	groupAlpha: { members: T[] };
	groupBravo: { members: T[] };
}): T[]
function

resolveGroupMemberOf

:36

The user's side of the match, or null if in neither group.

export function resolveGroupMemberOf(args: {
	groupAlpha: { members: { id: number }[] };
	groupBravo: { members: { id: number }[] };
	userId: number | null | undefined;
}): "ALPHA" | "BRAVO" | null
function

groupTier

:55

Tier a group held when its match started, from the snapshot taken then (thresholds shift with the season's distribution). undefined for matches predating the snapshot.

export function groupTier(group: {
	tierName: TierName | null;
	tierIsPlus: DBBoolean;
})
function

memberTier

:68

Tier a member held when their match started, snapshotted the same way as {@link groupTier}. "CALCULATING" when they had too few ranked sets of the season to have a tier.

export function memberTier(member: {
	tierName: TierName | "CALCULATING" | null;
	tierIsPlus: DBBoolean;
})

SkillDifference

app/features/sendouq-match/core/SkillDifference.ts

No overview comment at the top of the file.

Imports
no other modules
Used by
1 repository1 module1 component

Types

type

UserSkillDifference

no JSDoc:12
export type UserSkillDifference =
	| {
			calculated: true;
			spDiff: number;
			oldSp?: number;
			newSp?: number;
	  }
	| CalculatingSkill;
type

GroupSkillDifference

no JSDoc:21
export type GroupSkillDifference =
	| {
			calculated: true;
			oldSp: number;
			newSp: number;
	  }
	| CalculatingSkill;
interface

RatingChange

:30

A rating a match produced with the one it replaced (two consecutive season Skill rows). previous* are null for the season's first rating.

export interface RatingChange {
	ordinal: number;
	previousOrdinal: number | null;
	previousMatchesCount: number | null;
}

Functions & values

function

forUser

:37

What a match did to one player's SP, as their match page shows it.

export function forUser(change: RatingChange): UserSkillDifference
Unit tests (3)
function

forGroup

:53

What a match did to one group's team SP, as their match page shows it.

export function forGroup(change: RatingChange): GroupSkillDifference
Unit tests (2)