Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tabulator-another-web
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-web
Commits
6d18e1ab
Commit
6d18e1ab
authored
Aug 10, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复比分
parent
fc7834d4
Pipeline
#40063
passed with stages
in 1 minute and 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
34 deletions
+1
-34
src/script/participant.ts
src/script/participant.ts
+1
-28
src/script/post.ts
src/script/post.ts
+0
-6
No files found.
src/script/participant.ts
View file @
6d18e1ab
...
...
@@ -22,6 +22,7 @@ class Participant {
this
.
id
=
obj
.
id
;
this
.
deckbuf
=
obj
.
deckbuf
??
''
;
this
.
quit
=
obj
.
quit
??
false
;
this
.
score
=
obj
.
score
;
if
(
obj
.
deckbuf
)
this
.
deck
=
YGOProDeck
.
fromUpdateDeckPayload
(
Base64
.
toUint8Array
(
this
.
deckbuf
));
}
...
...
@@ -44,34 +45,6 @@ class Participant {
const
data
=
this
.
deck
?.
toYdkString
()
??
''
;
return
new
Blob
([
data
],
{
type
:
'
text/plain
'
});
}
getScore
=
(
matches
:
Array
<
Match
>
,
t
:
Tournament
)
:
void
=>
{
const
max
=
Math
.
max
(...
matches
.
filter
(
i
=>
i
.
status
==
'
Finished
'
||
i
.
status
==
'
Running
'
).
map
(
i
=>
i
.
round
));
const
joins
=
matches
.
filter
(
i
=>
this
.
id
==
i
.
player1
.
id
||
this
.
id
==
i
.
player2
.
id
);
const
m
=
{
win
:
joins
.
filter
(
i
=>
this
.
id
==
i
.
winnerId
&&
i
.
status
==
"
Finished
"
).
length
,
draw
:
joins
.
filter
(
i
=>
i
.
winnerId
===
null
&&
i
.
status
==
"
Finished
"
).
length
,
lose
:
joins
.
filter
(
i
=>
i
.
winnerId
!==
null
&&
i
.
winnerId
!=
this
.
id
&&
i
.
status
==
"
Finished
"
).
length
,
bye
:
max
-
joins
.
length
};
this
.
score
=
{
score
:
m
.
win
*
t
.
ruleSettings
.
winScore
+
m
.
draw
*
t
.
ruleSettings
.
drawScore
+
m
.
bye
*
t
.
ruleSettings
.
byeScore
,
win
:
m
.
win
,
draw
:
m
.
draw
,
bye
:
m
.
bye
,
lose
:
m
.
lose
}
}
getTieBreaker
=
(
participants
:
Array
<
Participant
>
,
matches
:
Array
<
Match
>
)
:
void
=>
{
let
tieBreaker
=
0
;
matches
.
filter
(
i
=>
this
.
id
==
i
.
player1
.
id
||
this
.
id
==
i
.
player2
.
id
).
forEach
(
i
=>
{
const
id
=
this
.
id
==
i
.
player1
.
id
?
i
.
player2
.
id
:
i
.
player1
.
id
;
const
p
=
participants
.
find
(
p
=>
p
.
id
==
id
)?.
score
.
score
??
0
;
tieBreaker
+=
p
;
});
this
.
score
.
tieBreaker
=
tieBreaker
;
}
}
export
default
Participant
;
src/script/post.ts
View file @
6d18e1ab
...
...
@@ -108,12 +108,6 @@ class TabulatorAPI {
response
.
data
.
data
.
matches
.
forEach
((
i
:
MatchObject
)
=>
{
matches
.
push
(
new
Match
(
i
,
participants
));
});
participants
.
forEach
(
i
=>
{
i
.
getScore
(
matches
,
tournament
);
});
participants
.
forEach
(
i
=>
{
i
.
getTieBreaker
(
participants
,
matches
);
});
if
(
tournament
.
status
!=
'
Ready
'
)
{
participants
.
sort
((
a
,
b
)
=>
{
return
b
.
score
.
score
-
a
.
score
.
score
...
...
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