File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
src/main/java/com/github/elic0de/thejpspit Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public void onEnable() {
5353 "Please check the supplied database credentials in the config file" );
5454 }
5555
56- ratingHelper = new KillRatingHelper (0.5 );
56+ ratingHelper = new KillRatingHelper (0 );
5757 queueManager = new QueueManager ();
5858
5959 //queueTask = new QueueTask();
Original file line number Diff line number Diff line change 66
77public class KillRatingHelper {
88
9- private static final double roundingFactor = 10000 ;
9+ // 少数第二で四捨五入
10+ private static final double roundingFactor = 10 ;
1011 private final double defaultRating ;
1112
1213 public KillRatingHelper (double defaultRating ) {
1314 this .defaultRating = defaultRating ;
1415 }
1516
1617 public void initRating (PitPlayer player ) {
17- player .setRating (calculateWinningRatio (player ));
18+ player .setRating (calculateKillingRatio (player ));
1819 }
1920
20- private double calculateWinningRatio (PitPlayer player ) {
21+ private double calculateKillingRatio (PitPlayer player ) {
2122 long deaths = player .getDeaths ();
2223 long kills = player .getKills ();
2324 long total = deaths + kills ;
2425 if (deaths >= 0 && kills >= 0 && total > 0 ) {
25- return round ((double ) kills / total * roundingFactor ) / roundingFactor ;
26+ return round ((double ) kills / deaths * roundingFactor ) / roundingFactor ;
2627 } else {
2728 return defaultRating ;
2829 }
You can’t perform that action at this time.
0 commit comments