Files
crtr/Assets/Cryville/Crtr/Event/RMVPool.cs

21 lines
630 B
C#

using Cryville.Common;
using Cryville.Common.Buffers;
namespace Cryville.Crtr.Event {
internal class RMVPool : CategorizedPool<Identifier, RealtimeMotionValue> {
private class Bucket : ObjectPool<RealtimeMotionValue> {
readonly MotionRegistry _reg;
public Bucket(string name, int capacity) : base(capacity) {
_reg = ChartPlayer.motionRegistry[name];
}
protected override RealtimeMotionValue Construct() {
return new RealtimeMotionValue().Init(_reg.InitValue);
}
}
public RMVPool() {
foreach (var reg in ChartPlayer.motionRegistry)
Buckets.Add(reg.Key, new Bucket(reg.Key, 4096));
}
}
}