Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.TVP.Golf
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.TVP.Golf
Commits
186b5415
Commit
186b5415
authored
Nov 26, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复排名
parent
e05b1ca2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
87 deletions
+15
-87
VIZ.TVP.Golf.Module/Package/GroupRanking/GroupRankingViewModelBase.cs
+1
-0
VIZ.TVP.Golf.Service/Comparer/TeamTempModelComparer.cs
+1
-1
VIZ.TVP.Golf.Service/RealData/Implementation/RealDataService.cs
+8
-64
VIZ.TVP.Golf.Service/RealData/Interface/IRealDataService.cs
+0
-17
VIZ.TVP.Golf.Storage/XML/ScoreNode.cs
+5
-5
No files found.
VIZ.TVP.Golf.Module/Package/GroupRanking/GroupRankingViewModelBase.cs
View file @
186b5415
...
@@ -169,6 +169,7 @@ namespace VIZ.TVP.Golf.Module
...
@@ -169,6 +169,7 @@ namespace VIZ.TVP.Golf.Module
int
score
=
this
.
realDataService
.
GetGroupRoundScore
(
group
.
Key
,
player1
,
player2
,
this
.
SelectedRound
);
int
score
=
this
.
realDataService
.
GetGroupRoundScore
(
group
.
Key
,
player1
,
player2
,
this
.
SelectedRound
);
temp_model
.
PlayersScore
=
this
.
realDataService
.
GetScoreString
(
score
);
temp_model
.
PlayersScore
=
this
.
realDataService
.
GetScoreString
(
score
);
temp_model
.
PlayerScoreValue
=
score
;
groupTempModels
.
Add
(
temp_model
);
groupTempModels
.
Add
(
temp_model
);
}
}
...
...
VIZ.TVP.Golf.Service/Comparer/TeamTempModelComparer.cs
View file @
186b5415
...
@@ -109,7 +109,7 @@ namespace VIZ.TVP.Golf.Service
...
@@ -109,7 +109,7 @@ namespace VIZ.TVP.Golf.Service
if
(
team1
.
Score
==
null
&&
team2
.
Score
==
null
)
if
(
team1
.
Score
==
null
&&
team2
.
Score
==
null
)
return
0
;
return
0
;
if
(
team1
.
Score
!=
null
&&
team2
.
Score
!
=
null
)
if
(
team1
.
Score
!=
null
&&
team2
.
Score
=
=
null
)
return
-
1
;
return
-
1
;
if
(
team1
.
Score
==
null
&&
team2
.
Score
!=
null
)
if
(
team1
.
Score
==
null
&&
team2
.
Score
!=
null
)
...
...
VIZ.TVP.Golf.Service/RealData/Implementation/RealDataService.cs
View file @
186b5415
...
@@ -322,10 +322,7 @@ namespace VIZ.TVP.Golf.Service
...
@@ -322,10 +322,7 @@ namespace VIZ.TVP.Golf.Service
data
.
Player1
=
player1
;
data
.
Player1
=
player1
;
RoundRealModel
real_round
=
player1
.
Rounds
.
FirstOrDefault
(
p
=>
p
.
No
==
round
);
RoundRealModel
real_round
=
player1
.
Rounds
.
FirstOrDefault
(
p
=>
p
.
No
==
round
);
if
(
this
.
IsPlayerHoleFinished
(
real_round
,
hole
))
real_score1
=
real_round
?.
Scores
.
FirstOrDefault
(
p
=>
p
.
Hole
==
hole
);
{
real_score1
=
real_round
?.
Scores
.
FirstOrDefault
(
p
=>
p
.
Hole
==
hole
);
}
}
}
if
(
player2
!=
null
)
if
(
player2
!=
null
)
...
@@ -333,10 +330,7 @@ namespace VIZ.TVP.Golf.Service
...
@@ -333,10 +330,7 @@ namespace VIZ.TVP.Golf.Service
data
.
Player2
=
player2
;
data
.
Player2
=
player2
;
RoundRealModel
real_round
=
player2
.
Rounds
.
FirstOrDefault
(
p
=>
p
.
No
==
round
);
RoundRealModel
real_round
=
player2
.
Rounds
.
FirstOrDefault
(
p
=>
p
.
No
==
round
);
if
(
this
.
IsPlayerHoleFinished
(
real_round
,
hole
))
real_score2
=
real_round
?.
Scores
.
FirstOrDefault
(
p
=>
p
.
Hole
==
hole
);
{
real_score2
=
real_round
?.
Scores
.
FirstOrDefault
(
p
=>
p
.
Hole
==
hole
);
}
}
}
if
(
round
==
1
)
if
(
round
==
1
)
...
@@ -383,50 +377,6 @@ namespace VIZ.TVP.Golf.Service
...
@@ -383,50 +377,6 @@ namespace VIZ.TVP.Golf.Service
}
}
/// <summary>
/// <summary>
/// 球员是否完成指定洞的比赛
/// </summary>
/// <param name="player">球员</param>
/// <param name="round">轮次</param>
/// <param name="hole">洞嗯呢</param>
/// <returns>是否已经完成该洞</returns>
public
bool
IsPlayerHoleFinished
(
PlayerRealModel
player
,
int
round
,
int
hole
)
{
if
(
player
==
null
||
player
.
Rounds
==
null
)
return
false
;
RoundRealModel
real_round
=
player
.
Rounds
.
FirstOrDefault
(
p
=>
p
.
No
==
hole
);
return
this
.
IsPlayerHoleFinished
(
real_round
,
hole
);
}
/// <summary>
/// 球员是否完成指定洞的比赛
/// </summary>
/// <param name="real_round">轮次真实数据</param>
/// <param name="hole">洞</param>
/// <returns>是否已经完成该洞</returns>
public
bool
IsPlayerHoleFinished
(
RoundRealModel
real_round
,
int
hole
)
{
if
(
real_round
==
null
)
return
false
;
int
total_hole
=
ApplicationDomainEx
.
HoleInfos
.
Count
;
int
thru
=
real_round
.
Thru
??
0
;
if
(
hole
>=
real_round
.
StartingTee
&&
hole
<
real_round
.
StartingTee
+
thru
)
{
return
true
;
}
if
((
real_round
.
StartingTee
+
thru
>
total_hole
)
&&
(
hole
<
(
real_round
.
StartingTee
+
thru
)
%
total_hole
))
{
return
true
;
}
return
false
;
}
/// <summary>
/// 更新队伍排名值
/// 更新队伍排名值
/// </summary>
/// </summary>
/// <param name="teams">已经完成排序的队伍</param>
/// <param name="teams">已经完成排序的队伍</param>
...
@@ -445,14 +395,11 @@ namespace VIZ.TVP.Golf.Service
...
@@ -445,14 +395,11 @@ namespace VIZ.TVP.Golf.Service
continue
;
continue
;
}
}
if
(
teams
[
i
].
TotalScoreValue
==
teams
[
i
-
1
].
TotalScoreValue
)
++
position
;
{
teams
[
i
].
Position
=
$"T
{
position
}
"
;
if
(
teams
[
i
].
TotalScoreValue
!=
teams
[
i
-
1
].
TotalScoreValue
)
}
else
{
{
teams
[
i
].
Position
=
$"
{
position
}
"
;
teams
[
i
].
Position
=
$"
{
position
}
"
;
++
position
;
}
}
}
}
}
}
...
@@ -495,14 +442,11 @@ namespace VIZ.TVP.Golf.Service
...
@@ -495,14 +442,11 @@ namespace VIZ.TVP.Golf.Service
continue
;
continue
;
}
}
if
(
groups
[
i
].
PlayerScoreValue
==
groups
[
i
-
1
].
PlayerScoreValue
)
++
position
;
{
groups
[
i
].
Position
=
$"T
{
position
}
"
;
if
(
groups
[
i
].
PlayerScoreValue
!=
groups
[
i
-
1
].
PlayerScoreValue
)
}
else
{
{
groups
[
i
].
Position
=
$"
{
position
}
"
;
groups
[
i
].
Position
=
$"
{
position
}
"
;
++
position
;
}
}
}
}
}
}
...
...
VIZ.TVP.Golf.Service/RealData/Interface/IRealDataService.cs
View file @
186b5415
...
@@ -109,23 +109,6 @@ namespace VIZ.TVP.Golf.Service
...
@@ -109,23 +109,6 @@ namespace VIZ.TVP.Golf.Service
GroupHoleStatisticsData
GetGroupHoleStatisticsData
(
string
group
,
PlayerRealModel
player1
,
PlayerRealModel
player2
,
int
round
,
int
hole
);
GroupHoleStatisticsData
GetGroupHoleStatisticsData
(
string
group
,
PlayerRealModel
player1
,
PlayerRealModel
player2
,
int
round
,
int
hole
);
/// <summary>
/// <summary>
/// 球员是否完成指定洞的比赛
/// </summary>
/// <param name="player">球员</param>
/// <param name="round">轮次</param>
/// <param name="hole">洞嗯呢</param>
/// <returns>是否已经完成该洞</returns>
bool
IsPlayerHoleFinished
(
PlayerRealModel
player
,
int
round
,
int
hole
);
/// <summary>
/// 球员是否完成指定洞的比赛
/// </summary>
/// <param name="real_round">轮次真实数据</param>
/// <param name="hole">洞</param>
/// <returns>是否已经完成该洞</returns>
bool
IsPlayerHoleFinished
(
RoundRealModel
real_round
,
int
hole
);
/// <summary>
/// 更新队伍排名值
/// 更新队伍排名值
/// </summary>
/// </summary>
/// <param name="teams">已经完成排序的队伍</param>
/// <param name="teams">已经完成排序的队伍</param>
...
...
VIZ.TVP.Golf.Storage/XML/ScoreNode.cs
View file @
186b5415
...
@@ -75,12 +75,12 @@ namespace VIZ.TVP.Golf.Storage
...
@@ -75,12 +75,12 @@ namespace VIZ.TVP.Golf.Storage
public
void
FromXElement
(
XElement
element
)
public
void
FromXElement
(
XElement
element
)
{
{
this
.
hole
=
element
.
GetAttributeValue
<
int
>(
"hole"
);
this
.
hole
=
element
.
GetAttributeValue
<
int
>(
"hole"
);
this
.
strokes
=
element
.
GetAttributeValue
<
int
>(
"strokes"
);
this
.
strokes
=
element
.
GetAttributeValue
<
int
?
>(
"strokes"
);
this
.
par
=
element
.
GetAttributeValue
<
int
>(
"par"
);
this
.
par
=
element
.
GetAttributeValue
<
int
>(
"par"
);
this
.
bunkers
=
element
.
GetAttributeValue
<
int
>(
"bunkers"
);
this
.
bunkers
=
element
.
GetAttributeValue
<
int
?
>(
"bunkers"
);
this
.
putts
=
element
.
GetAttributeValue
<
int
>(
"putts"
);
this
.
putts
=
element
.
GetAttributeValue
<
int
?
>(
"putts"
);
this
.
drive
=
element
.
GetAttributeValue
<
int
>(
"drive"
);
this
.
drive
=
element
.
GetAttributeValue
<
int
?
>(
"drive"
);
this
.
fairway
=
element
.
GetAttributeValue
<
int
>(
"fairway"
);
this
.
fairway
=
element
.
GetAttributeValue
<
int
?
>(
"fairway"
);
}
}
}
}
}
}
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