Code cleanup.

This commit is contained in:
2023-02-09 18:18:34 +08:00
parent 7714c277fd
commit 18ff4b8e16
6 changed files with 13 additions and 41 deletions

View File

@@ -109,9 +109,7 @@ namespace Cryville.Crtr {
public float BeatOffset;
[JsonIgnore]
public abstract int Priority {
get;
}
public abstract int Priority { get; }
public ChartEvent Clone() {
return (ChartEvent)MemberwiseClone();
@@ -259,9 +257,7 @@ namespace Cryville.Crtr {
}
}
public override int Priority {
get { return 10; }
}
public override int Priority { get { return 10; } }
public class Group : EventContainer {
public List<Track> tracks = new List<Track>();
@@ -281,15 +277,11 @@ namespace Cryville.Crtr {
default: return base.GetEventsOfType(type);
}
}
public override int Priority {
get { return 10; }
}
public override int Priority { get { return 10; } }
}
public class Track : EventContainer {
public override int Priority {
get { return 10; }
}
public override int Priority { get { return 10; } }
}
public class Motion : ChartEvent {
@@ -375,9 +367,7 @@ namespace Cryville.Crtr {
[DefaultValue(0.0f)]
public float sumfix = 0.0f;
public override int Priority {
get { return -2; }
}
public override int Priority { get { return -2; } }
public Motion() {
SubmitPropOp("motion", new PropOp.String(v => motion = v));
@@ -413,9 +403,7 @@ namespace Cryville.Crtr {
default: return base.GetEventsOfType(type);
}
}
public override int Priority {
get { return 12; }
}
public override int Priority { get { return 12; } }
}
public class Judge : ChartEvent {
@@ -428,9 +416,7 @@ namespace Cryville.Crtr {
}
#pragma warning restore IDE1006
public override int Priority {
get { return 0; }
}
public override int Priority { get { return 0; } }
public Judge() {
SubmitPropSrc("name", new PropSrc.Identifier(() => Id.Key));
@@ -444,9 +430,7 @@ namespace Cryville.Crtr {
public class Signature : ChartEvent {
public float? tempo;
public override int Priority {
get { return -4; }
}
public override int Priority { get { return -4; } }
}
public List<Sound> sounds;
@@ -457,9 +441,7 @@ namespace Cryville.Crtr {
// TODO [Obsolete]
public float offset;
public override int Priority {
get { return 0; }
}
public override int Priority { get { return 0; } }
}
}
}

View File

@@ -155,8 +155,8 @@ namespace Cryville.Crtr.Event {
#if UNITY_5_6_OR_NEWER
tev.Target.Transform.SetPositionAndRotation(Position, Rotation);
#else
tev.Target.Transform.position = GetCurrentWorldPoint();
tev.Target.Transform.rotation = Quaternion.Euler(s.Direction);
tev.Target.Transform.position = Position;
tev.Target.Transform.rotation = Rotation;
#endif
skinContainer.MatchDynamic(s);
CloseAnchor();

View File

@@ -70,7 +70,6 @@ namespace Cryville.Crtr.Event {
public byte CloneType;
public ContainerState rootPrototype = null;
private ContainerState prototype = null;
public ContainerHandler Handler {
get;
@@ -140,7 +139,6 @@ namespace Cryville.Crtr.Event {
else if (ct == 3) Handler.ns = r;
else if (ct >= 16) Handler.ps = r;
else throw new InvalidOperationException("Invalid clone type");
r.prototype = this;
r.CloneType = ct;
return r;
}

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
namespace Cryville.Crtr.Event {
public class EventBus : StateBase<EventBatch>, IDisposable {
EventBus prototype = null;
public ContainerState RootState {
get;
private set;
@@ -25,7 +24,6 @@ namespace Cryville.Crtr.Event {
public EventBus Clone(byte ct, float offsetTime = 0) {
var r = (EventBus)MemberwiseClone();
r.prototype = this;
r.states = new Dictionary<EventContainer, ContainerState>();
r.activeStates = new HashSet<ContainerState>();
r.invalidatedStates = new HashSet<ContainerState>();

View File

@@ -1,7 +1,6 @@
using Cryville.Common.Math;
using Cryville.Crtr.Event;
using System;
using System.Linq;
using UnityEngine;
namespace Cryville.Crtr {
@@ -20,11 +19,7 @@ namespace Cryville.Crtr {
public override void PreInit() {
base.PreInit();
tracks = (
from c in cs.Children
where c.Value.Container is Chart.Track
select c.Value
).ToArray();
tracks = cs.TypedChildren[typeof(Chart.Track)].ToArray();
matFrame = SquareMatrix.WithPolynomialCoefficients(tracks.Length);
frame1 = new ColumnVector<Vector3>(tracks.Length);
frame2 = new ColumnVector<Vector3>(tracks.Length);

View File

@@ -97,8 +97,7 @@ namespace Cryville.Crtr {
if (s.CloneType <= 2) {
Position = GetFramePoint(s.Parent, s.Track);
Rotation = GetFrameRotation(s.Parent, s.Track);
if (s.CloneType == 2) {
if (!gogroup || !Event.IsLong) return;
if (s.CloneType == 2 && gogroup && Event.IsLong) {
foreach (var i in sgos)
i.AppendPoint(Position, Rotation);
}