Prune code.
This commit is contained in:
@@ -14,9 +14,9 @@ namespace Cryville.Crtr.Event {
|
||||
|
||||
public Dictionary<EventContainer, ContainerState> Children
|
||||
= new Dictionary<EventContainer, ContainerState>();
|
||||
HashSet<EventContainer> WorkingChildren
|
||||
readonly HashSet<EventContainer> WorkingChildren
|
||||
= new HashSet<EventContainer>();
|
||||
HashSet<EventContainer> InvalidatedChildren
|
||||
readonly HashSet<EventContainer> InvalidatedChildren
|
||||
= new HashSet<EventContainer>();
|
||||
public Dictionary<Type, List<ContainerState>> TypedChildren
|
||||
= new Dictionary<Type, List<ContainerState>>();
|
||||
@@ -25,14 +25,8 @@ namespace Cryville.Crtr.Event {
|
||||
return TypedChildren[handlerType][index];
|
||||
}
|
||||
public ContainerState GetChild(EventContainer ev) {
|
||||
/*if (!Children.ContainsKey(ev)) {
|
||||
Children[ev] = prototype.FetchChildClone(ev, CloneType);
|
||||
}*/
|
||||
return Children[ev];
|
||||
}
|
||||
/*ContainerState FetchChildClone(EventContainer ev, byte ct) {
|
||||
return Children[ev].Clone(ct);
|
||||
}*/
|
||||
|
||||
void NotifyWorkingChanged(EventContainer key) {
|
||||
InvalidatedChildren.Add(key);
|
||||
@@ -56,7 +50,6 @@ namespace Cryville.Crtr.Event {
|
||||
public byte CloneType;
|
||||
private ContainerState rootPrototype = null;
|
||||
private ContainerState prototype = null;
|
||||
// public SkinManager skinManager;
|
||||
public SkinContainer skinContainer;
|
||||
public Judge judge;
|
||||
|
||||
@@ -97,7 +90,6 @@ namespace Cryville.Crtr.Event {
|
||||
}
|
||||
|
||||
void InvalidateMotion(MotionName name) {
|
||||
// if (CachedValues.ContainsKey(name))
|
||||
CachedValueStates[name] = false;
|
||||
foreach (var c in Children)
|
||||
c.Value.InvalidateMotion(name);
|
||||
@@ -113,10 +105,6 @@ namespace Cryville.Crtr.Event {
|
||||
|
||||
foreach (var m in ChartPlayer.motionRegistry)
|
||||
Values.Add(new MotionName(m.Key), new RealtimeMotionValue().Init(Parent == null ? m.Value.GlobalInitValue : m.Value.InitValue));
|
||||
|
||||
//skinManager = new SkinManager(skin, this);
|
||||
|
||||
//events.Sort((a, b) => a.Time.CompareTo(b.Time));
|
||||
}
|
||||
|
||||
static void AddChild(EventContainer c, ContainerState s, ContainerState target) {
|
||||
@@ -127,9 +115,6 @@ namespace Cryville.Crtr.Event {
|
||||
}
|
||||
|
||||
public ContainerState Clone(byte ct) {
|
||||
/*if (prototype != null)
|
||||
throw new InvalidOperationException();*/
|
||||
|
||||
var r = (ContainerState)MemberwiseClone();
|
||||
|
||||
var mvs = new Dictionary<MotionName, RealtimeMotionValue>(Values.Count);
|
||||
@@ -152,7 +137,6 @@ namespace Cryville.Crtr.Event {
|
||||
|
||||
r.Children = new Dictionary<EventContainer, ContainerState>();
|
||||
foreach (var child in Children) {
|
||||
// if (!child.Value.Working && ct != 1) continue;
|
||||
var cc = child.Value.Clone(ct);
|
||||
cc.Parent = r;
|
||||
AddChild(child.Key, cc, r);
|
||||
@@ -184,7 +168,6 @@ namespace Cryville.Crtr.Event {
|
||||
else dest.Values.Add(mv.Key, mv.Value.Clone());
|
||||
}
|
||||
|
||||
// dest.CachedValues.Clear();
|
||||
foreach (var cv in CachedValues) {
|
||||
Vector dv;
|
||||
if(dest.CachedValues.TryGetValue(cv.Key, out dv)) cv.Value.CopyTo(dv);
|
||||
@@ -224,7 +207,6 @@ namespace Cryville.Crtr.Event {
|
||||
}
|
||||
|
||||
public void AttachSystems(PdtSkin skin, Judge judge) {
|
||||
// skinManager = new SkinManager(skin);
|
||||
skinContainer = new SkinContainer(skin);
|
||||
this.judge = judge;
|
||||
}
|
||||
@@ -337,20 +319,15 @@ namespace Cryville.Crtr.Event {
|
||||
}
|
||||
|
||||
public void Handle(StampedEvent ev, Action<StampedEvent> callback = null) {
|
||||
if (breakflag) {
|
||||
// Time = toTime;
|
||||
return;
|
||||
}
|
||||
if (breakflag) return;
|
||||
if (ev != null) {
|
||||
bool flag = false;
|
||||
if (ev.Unstamped is Chart.Motion) {
|
||||
var tev = (Chart.Motion)ev.Unstamped;
|
||||
// tev._apply(Values);
|
||||
var mv = RMVPool.Rent(tev.Name);
|
||||
GetMotionValue(tev.Name).CopyTo(mv);
|
||||
PlayingMotions.Add(ev, mv);
|
||||
Callback(ev, callback);
|
||||
// UpdateMotions();
|
||||
if (!ev.Unstamped.IsLong)
|
||||
PlayingMotions.Remove(ev);
|
||||
}
|
||||
@@ -371,9 +348,7 @@ namespace Cryville.Crtr.Event {
|
||||
if (tev.IsRelease) {
|
||||
var nev = tev.Original;
|
||||
if (nev is Chart.Motion) {
|
||||
// var tnev = (Chart.Motion)nev;
|
||||
Callback(ev, callback);
|
||||
// UpdateMotions();
|
||||
PlayingMotions.Remove(ev.Origin);
|
||||
}
|
||||
else if (nev is EventContainer) {
|
||||
@@ -397,7 +372,6 @@ namespace Cryville.Crtr.Event {
|
||||
if (!flag) Callback(null, callback);
|
||||
return;
|
||||
}
|
||||
// Time = toTime;
|
||||
Callback(null, callback);
|
||||
}
|
||||
|
||||
@@ -407,21 +381,6 @@ namespace Cryville.Crtr.Event {
|
||||
callback(ev);
|
||||
if (ev == null || ev.Unstamped != null) Handler.Update(this, ev);
|
||||
else Handler.ExUpdate(this, ev);
|
||||
/*if (CloneType == 1) {
|
||||
if (ev == null || ev.Event != null) Handler.Forward(ev);
|
||||
else Handler.ExUpdate(CloneType, ev);
|
||||
}
|
||||
else if (CloneType == 0) {
|
||||
if (ev == null || ev.Event != null) Handler.Update(ev);
|
||||
else Handler.ExUpdate(CloneType, ev);
|
||||
}
|
||||
else if (CloneType == 2) {
|
||||
// TODO Do nothing atm
|
||||
}
|
||||
else if (CloneType >= 16) {
|
||||
if (ev == null || ev.Event != null) Handler.PreUpdate(CloneType, ev);
|
||||
else Handler.ExUpdate(CloneType, ev);
|
||||
}*/
|
||||
foreach (var m in PlayingMotions)
|
||||
Handler.MotionUpdate(CloneType, (Chart.Motion)m.Key.Unstamped);
|
||||
}
|
||||
|
Reference in New Issue
Block a user