Code cleanup.

This commit is contained in:
2022-10-02 16:25:45 +08:00
parent 6fb7b97bd8
commit 5fb135bfa5
16 changed files with 26 additions and 29 deletions

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
namespace Cryville.Crtr.Event {
internal class RMVPool {
private class Bucket : ObjectPool<RealtimeMotionValue> {
MotionRegistry _reg;
readonly MotionRegistry _reg;
public Bucket(string name, int capacity) : base(capacity) {
_reg = ChartPlayer.motionRegistry[name];
}
@@ -19,7 +19,7 @@ namespace Cryville.Crtr.Event {
_buckets.Add(reg.Key, new Bucket(reg.Key, 4096));
}
Dictionary<RealtimeMotionValue, string> _rented = new Dictionary<RealtimeMotionValue, string>();
readonly Dictionary<RealtimeMotionValue, string> _rented = new Dictionary<RealtimeMotionValue, string>();
public RealtimeMotionValue Rent(MotionName name) {
var n = name.MainName;
var obj = _buckets[n].Rent();