Skip to content

Commit

Permalink
new features
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoWQ222 committed Apr 27, 2024
1 parent fffc7c1 commit 4b2af77
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions logic/Server/GameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ protected async Task<double[]> GetLadderScore(int mode, double[] scores)
else return new double[0];
}

protected double[] Cal(double[] orgScore , double[] competitionScore)
protected double[] Cal(double[] orgScore, double[] competitionScore)
{
// 调整顺序,让第一个元素成为获胜者,便于计算
bool reverse = false; // 记录是否需要调整
Expand Down Expand Up @@ -204,7 +204,7 @@ protected double[] Cal(double[] orgScore , double[] competitionScore)
resScore[0] = orgScore[0] + Math.Round(competitionScore[0] * competitionScore[0] * firstnerGet * (1 - Math.Tanh(delta)) * correct); // 胜者所加天梯分
resScore[1] = orgScore[1] - Math.Round(
(competitionScore[0] - competitionScore[1]) * (competitionScore[0] - competitionScore[1]) * secondrGet * (1 - Math.Tanh(delta)) * correct); // 败者所扣天梯分
// 如果换过,再换回来
// 如果换过,再换回来
if (reverse)
{
double t = resScore[1];
Expand All @@ -213,7 +213,7 @@ protected double[] Cal(double[] orgScore , double[] competitionScore)
}
return resScore;
}


private void OnGameEnd()
{
Expand All @@ -225,7 +225,7 @@ private void OnGameEnd()
: options.ResultFileName + ".json");
int[] scores = GetScore();
double[] doubleArray = scores.Select(x => (double)x).ToArray();
if(options.Mode==2)
if (options.Mode == 2)
scores = GetLadderScore(options.Mode, doubleArray).Result;

Check failure on line 229 in logic/Server/GameServer.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-logic

Cannot implicitly convert type 'double[]' to 'int[]'

Check failure on line 229 in logic/Server/GameServer.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-logic

Cannot implicitly convert type 'double[]' to 'int[]'
SendGameResult(scores, options.Mode);
endGameSem.Release();
Expand Down

0 comments on commit 4b2af77

Please sign in to comment.