-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from no-1-noob/TriangleOfDoom
BL: Triangle PP Calculation
- Loading branch information
Showing
16 changed files
with
223 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using beatleaderapi; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace PPPredictor.Data | ||
{ | ||
public class PPPStarRating | ||
{ | ||
private double _stars = 0; | ||
private double _predictedAcc = 0; | ||
private double _passRating = 0; | ||
private double _accRating = 0; | ||
private double _techRating = 0; | ||
private Dictionary<string, double> _modifiersRating = new Dictionary<string, double>(); | ||
|
||
[DefaultValue(0)] | ||
public double Stars { get => _stars; set => _stars = value; } | ||
[DefaultValue(0)] | ||
public double PredictedAcc { get => _predictedAcc; set => _predictedAcc = value; } | ||
[DefaultValue(0)] | ||
public double PassRating { get => _passRating; set => _passRating = value; } | ||
[DefaultValue(0)] | ||
public double AccRating { get => _accRating; set => _accRating = value; } | ||
[DefaultValue(0)] | ||
public double TechRating { get => _techRating; set => _techRating = value; } | ||
[DefaultValue(null)] | ||
public Dictionary<string, double> ModifiersRating { get => _modifiersRating; set => _modifiersRating = value; } | ||
|
||
public PPPStarRating() | ||
{ | ||
} | ||
|
||
public PPPStarRating(double starRating) | ||
{ | ||
_stars = _predictedAcc = _passRating = _accRating = _techRating = starRating; | ||
} | ||
|
||
public PPPStarRating(DifficultyDescription beatLeaderDifficulty) | ||
{ | ||
_predictedAcc = beatLeaderDifficulty.PredictedAcc.GetValueOrDefault(); | ||
_passRating = beatLeaderDifficulty.PassRating.GetValueOrDefault(); | ||
_accRating = beatLeaderDifficulty.AccRating.GetValueOrDefault(); | ||
_techRating = beatLeaderDifficulty.TechRating.GetValueOrDefault(); | ||
_modifiersRating = beatLeaderDifficulty.ModifiersRating ?? null; | ||
} | ||
|
||
public bool IsRanked() | ||
{ | ||
return _predictedAcc > 0 || _passRating > 0 || _accRating > 0 || _techRating > 0 || _stars > 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.