Move some classes to Cryville.Common.

This commit is contained in:
2023-05-03 22:51:30 +08:00
parent 8f211568be
commit b143fb49ce
90 changed files with 788 additions and 2457 deletions

View File

@@ -65,8 +65,8 @@ namespace Cryville.Crtr.Event {
get { return cs.Container; }
}
static readonly int _var_current_time = IdentifierManager.SharedInstance.Request("current_time");
static readonly int _var_invisible_bounds = IdentifierManager.SharedInstance.Request("invisible_bounds");
static readonly int _var_current_time = IdentifierManager.Shared.Request("current_time");
static readonly int _var_invisible_bounds = IdentifierManager.Shared.Request("invisible_bounds");
public readonly IntKeyedDictionary<PropSrc> PropSrcs = new IntKeyedDictionary<PropSrc>();
SkinContainer skinContainer;
protected Judge judge;
@@ -81,13 +81,13 @@ namespace Cryville.Crtr.Event {
Anchor a_cur;
Anchor a_head;
Anchor a_tail;
static readonly int _a_cur = IdentifierManager.SharedInstance.Request("cur");
static readonly int _a_head = IdentifierManager.SharedInstance.Request("head");
static readonly int _a_tail = IdentifierManager.SharedInstance.Request("tail");
static readonly int _a_cur = IdentifierManager.Shared.Request("cur");
static readonly int _a_head = IdentifierManager.Shared.Request("head");
static readonly int _a_tail = IdentifierManager.Shared.Request("tail");
double atime_head;
double atime_tail;
public Anchor RegisterAnchor(int name, bool dyn = false, int propSrcCount = 0) {
var strname = IdentifierManager.SharedInstance.Retrieve(name);
var strname = IdentifierManager.Shared.Retrieve(name);
var go = new GameObject("." + strname).transform;
go.SetParent(RootTransform, false);
var result = new Anchor(name, go, propSrcCount);
@@ -273,7 +273,7 @@ namespace Cryville.Crtr.Event {
}
public void PushAnchorEvent(double time, int name) {
if (!DynamicAnchors.ContainsKey(name))
throw new ArgumentException(string.Format("Specified anchor \"{0}\" not found", IdentifierManager.SharedInstance.Retrieve(name)));
throw new ArgumentException(string.Format("Specified anchor \"{0}\" not found", IdentifierManager.Shared.Retrieve(name)));
if (name == _a_head) atime_head = time;
else if (name == _a_tail) atime_tail = time;
DynamicAnchorSetTime[name] = time;

View File

@@ -256,7 +256,7 @@ namespace Cryville.Crtr.Event {
return (T)GetComputedValue(key);
}
static readonly int n_pt = IdentifierManager.SharedInstance.Request("pt");
static readonly int n_pt = IdentifierManager.Shared.Request("pt");
public Vector2 ScreenPoint {
get {
var mv = GetComputedValue<Vec2>(n_pt);
@@ -264,7 +264,7 @@ namespace Cryville.Crtr.Event {
}
}
static readonly int n_dir = IdentifierManager.SharedInstance.Request("dir");
static readonly int n_dir = IdentifierManager.Shared.Request("dir");
public Vector3 Direction {
get {
Vec3 r = GetComputedValue<Vec3>(n_dir);
@@ -272,7 +272,7 @@ namespace Cryville.Crtr.Event {
}
}
static readonly int n_normal = IdentifierManager.SharedInstance.Request("normal");
static readonly int n_normal = IdentifierManager.Shared.Request("normal");
public Vector3 Normal {
get {
Vec3 r = GetComputedValue<Vec3>(n_normal);
@@ -286,22 +286,22 @@ namespace Cryville.Crtr.Event {
}
}
static readonly int n_sv = IdentifierManager.SharedInstance.Request("sv");
static readonly int n_svm = IdentifierManager.SharedInstance.Request("svm");
static readonly int n_sv = IdentifierManager.Shared.Request("sv");
static readonly int n_svm = IdentifierManager.Shared.Request("svm");
public float ScrollVelocity {
get {
return GetComputedValue<Vec1>(n_sv).Value * GetComputedValue<Vec1m>(n_svm).Value;
}
}
static readonly int n_dist = IdentifierManager.SharedInstance.Request("dist");
static readonly int n_dist = IdentifierManager.Shared.Request("dist");
public float Distance {
get {
return GetComputedValue<Vec1>(n_dist).Value;
}
}
static readonly int n_track = IdentifierManager.SharedInstance.Request("track");
static readonly int n_track = IdentifierManager.Shared.Request("track");
public float Track {
get {
return GetComputedValue<Vec1>(n_track).Value;

View File

@@ -30,7 +30,7 @@ namespace Cryville.Crtr.Event {
}
}
readonly IntKeyedDictionary<ObjectPool<MotionCache>> m_buckets;
protected override IReadOnlyDictionary<int, ObjectPool<MotionCache>> Buckets { get { return m_buckets; } }
protected override IDictionary<int, ObjectPool<MotionCache>> Buckets { get { return m_buckets; } }
public MotionCachePool() {
m_buckets = new IntKeyedDictionary<ObjectPool<MotionCache>>(ChartPlayer.motionRegistry.Count);
foreach (var reg in ChartPlayer.motionRegistry)

View File

@@ -20,7 +20,7 @@ namespace Cryville.Crtr.Event {
}
}
readonly IntKeyedDictionary<ObjectPool<RealtimeMotionValue>> m_buckets;
protected override IReadOnlyDictionary<int, ObjectPool<RealtimeMotionValue>> Buckets { get { return m_buckets; } }
protected override IDictionary<int, ObjectPool<RealtimeMotionValue>> Buckets { get { return m_buckets; } }
public RMVPool() {
m_buckets = new IntKeyedDictionary<ObjectPool<RealtimeMotionValue>>(ChartPlayer.motionRegistry.Count);
foreach (var reg in ChartPlayer.motionRegistry)