Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tabulator-another
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
tabulator-another
Commits
50c04744
Commit
50c04744
authored
May 22, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix participant seq
parent
f58def0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
src/tournament-rules/rules/single-elimination.ts
src/tournament-rules/rules/single-elimination.ts
+8
-5
src/tournament-rules/rules/swiss.ts
src/tournament-rules/rules/swiss.ts
+1
-0
No files found.
src/tournament-rules/rules/single-elimination.ts
View file @
50c04744
...
...
@@ -4,7 +4,7 @@ import {
Participant
,
ParticipantScore
,
}
from
'
../../participant/entities/participant.entity
'
;
import
_
from
'
lodash
'
;
import
_
,
{
pick
}
from
'
lodash
'
;
export
class
SingleElimination
extends
TournamentRuleBase
{
totalRoundCount
()
{
...
...
@@ -27,6 +27,7 @@ export class SingleElimination extends TournamentRuleBase {
// add participants to first round
const
participants
=
_
.
sortBy
(
this
.
tournament
.
participants
,
(
p
)
=>
-
p
.
seq
,
(
p
)
=>
-
p
.
id
,
);
const
neededMatchesCount
=
...
...
@@ -58,14 +59,16 @@ export class SingleElimination extends TournamentRuleBase {
nextRound
()
{
const
finishedMatches
=
this
.
specificMatches
(
MatchStatus
.
Finished
);
const
survivedParticipants
=
this
.
tournament
.
participants
.
filter
(
const
survivedParticipants
=
_
.
sortBy
(
this
.
tournament
.
participants
.
filter
(
(
p
)
=>
!
finishedMatches
.
some
(
(
m
)
=>
m
.
participated
(
p
.
id
)
&&
m
.
winnerId
!==
p
.
id
,
),
)
.
reverse
();
),
(
p
)
=>
-
p
.
seq
,
(
p
)
=>
-
p
.
id
,
);
const
nextRoundCount
=
this
.
nextRoundCount
();
const
matches
=
this
.
specificMatches
(
MatchStatus
.
Pending
).
filter
(
(
m
)
=>
m
.
round
===
nextRoundCount
&&
!
m
.
isThirdPlaceMatch
,
...
...
src/tournament-rules/rules/swiss.ts
View file @
50c04744
...
...
@@ -34,6 +34,7 @@ export class Swiss extends TournamentRuleBase {
if
(
r
===
1
)
{
const
participants
=
_
.
sortBy
(
this
.
tournament
.
participants
,
(
p
)
=>
-
p
.
seq
,
(
p
)
=>
-
p
.
id
,
);
for
(
const
match
of
matches
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment