Unify VecPtComp with Vec1, and VecPt with Vec2.

This commit is contained in:
2023-04-18 09:45:46 +08:00
parent a2c5850fcd
commit f54564c567
4 changed files with 48 additions and 333 deletions

View File

@@ -586,6 +586,16 @@ namespace Cryville.Crtr {
DirectoryInfo dir = info.chartFile.Directory;
Logger.Log("main", 0, "Load/WorkerThread", "Loading chart: {0}", info.chartFile);
motionRegistry = new Dictionary<Identifier, MotionRegistry> {
{ new Identifier("pt") , new MotionRegistry(typeof(Vec2)) },
{ new Identifier("dir") , new MotionRegistry(typeof(Vec3)) },
{ new Identifier("normal") , new MotionRegistry(typeof(Vec3)) },
{ new Identifier("sv") , new MotionRegistry(new Vec1(0f), new Vec1(hitRect.height)) },
{ new Identifier("svm") , new MotionRegistry(new Vec1m(1f)) },
{ new Identifier("dist") , new MotionRegistry(new Vec1(0f), new Vec1(float.PositiveInfinity)) },
{ new Identifier("track") , new MotionRegistry(typeof(Vec1)) },
};
using (StreamReader reader = new StreamReader(info.chartFile.FullName, Encoding.UTF8)) {
chart = JsonConvert.DeserializeObject<Chart>(reader.ReadToEnd(), new JsonSerializerSettings() {
MissingMemberHandling = MissingMemberHandling.Error