Skip to content

Commit

Permalink
trying to refactor tick list getter
Browse files Browse the repository at this point in the history
  • Loading branch information
glowingstone124 committed Oct 1, 2024
1 parent a80f7f0 commit 46ef0b3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/vip/qoriginal/quantumplugin/MSPTCalculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

public class MSPTCalculator implements Listener {
/** 最终展现在返回结果的MilliSecond Per Tick值 */
public static float mspt = 0f;
public static ArrayList<Float> recent_60tick = new ArrayList<>();
public static ArrayList<Float> tick_list = new ArrayList<>();
/** 记录一个游戏刻开始的毫秒时间 */
private static long starttime = 0;
/** 记录上一次 <code>mspt > 77</code> 的时间 */
Expand Down Expand Up @@ -95,7 +97,7 @@ public static float getR3s() {
return result;
}
public static ArrayList<Float> getRecent60t(){
return recent_60tick;
return tick_list;
}
private static String f(int i) {
if(i>=10) return i+"";
Expand Down Expand Up @@ -136,4 +138,10 @@ private static void someExtraWorks() {
}
}
}
public static void add_to_tick_list(float f) {
if (tick_list.size() >= 60) {
tick_list.removeFirst();
}
tick_list.add(f);
}
}

0 comments on commit 46ef0b3

Please sign in to comment.