Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
deprecated-tabulator-backend
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
deprecated-tabulator-backend
Commits
485d2019
Commit
485d2019
authored
Jan 15, 2023
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ranking
parent
26677bd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
src/tournament-rules/rules/single-elimination.ts
src/tournament-rules/rules/single-elimination.ts
+0
-1
src/tournament/entities/Tournament.entity.ts
src/tournament/entities/Tournament.entity.ts
+7
-2
No files found.
src/tournament-rules/rules/single-elimination.ts
View file @
485d2019
...
...
@@ -4,7 +4,6 @@ import {
Participant
,
ParticipantScore
,
}
from
'
../../participant/entities/participant.entity
'
;
import
*
as
path
from
'
path
'
;
export
class
SingleElimination
extends
TournamentRuleBase
{
totalRoundCount
()
{
...
...
src/tournament/entities/Tournament.entity.ts
View file @
485d2019
...
...
@@ -27,6 +27,7 @@ import { ApiProperty, PartialType } from '@nestjs/swagger';
import
{
Match
}
from
'
../../match/entities/match.entity
'
;
import
{
TournamentRules
}
from
'
../../tournament-rules/rule-map
'
;
import
_
from
'
lodash
'
;
import
{
RenameClass
}
from
'
nicot/dist/src/utility/rename-class
'
;
export
enum
TournamentRule
{
SingleElimination
=
'
SingleElimination
'
,
...
...
@@ -78,7 +79,10 @@ export class Tournament extends DescBase {
@
NotChangeable
()
@
Column
(
'
jsonb
'
,
{
comment
:
'
规则设定
'
,
default
:
{}
})
@
ApiProperty
({
type
:
PartialType
(
RuleSettings
),
required
:
false
})
@
ApiProperty
({
type
:
RenameClass
(
PartialType
(
RuleSettings
),
'
RuleSettingsPartial
'
),
required
:
false
,
})
ruleSettings
:
RuleSettings
;
@
EnumColumn
(
TournamentVisibility
,
{
...
...
@@ -190,10 +194,11 @@ export class Tournament extends DescBase {
p
.
score
=
new
ParticipantScore
();
Object
.
assign
(
p
.
score
,
rule
.
participantScore
(
p
));
});
_
.
sortBy
(
this
.
participants
=
_
.
sortBy
(
this
.
participants
,
(
p
)
=>
-
p
.
score
.
score
,
(
p
)
=>
-
p
.
score
.
tieBreaker
,
(
p
)
=>
p
.
id
,
);
this
.
participants
.
forEach
((
p
,
i
)
=>
{
p
.
score
.
rank
=
i
+
1
;
...
...
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