Remove callback parameters on states.

This commit is contained in:
2023-01-03 12:09:16 +08:00
parent 7c77ba83f8
commit 723ec937ad
4 changed files with 23 additions and 28 deletions

View File

@@ -312,7 +312,7 @@ namespace Cryville.Crtr.Event {
Working = false;
}
public void Handle(StampedEvent ev, Action<StampedEvent> callback = null) {
public void Handle(StampedEvent ev) {
if (breakflag) return;
if (ev != null) {
if (ev.Unstamped is Chart.Motion) {
@@ -321,7 +321,7 @@ namespace Cryville.Crtr.Event {
mv.CloneTypeFlag = CloneType;
GetMotionValue(tev.Name).CopyTo(mv);
PlayingMotions.Add(ev, mv);
Callback(ev, callback);
Update(ev);
if (!ev.Unstamped.IsLong) {
PlayingMotions.Remove(ev);
RMVPool.Return(mv);
@@ -344,7 +344,7 @@ namespace Cryville.Crtr.Event {
if (tev.IsRelease) {
var nev = tev.Original;
if (nev is Chart.Motion) {
Callback(ev, callback);
Update(ev);
var mv = PlayingMotions[ev.Origin];
if (mv.CloneTypeFlag == CloneType) RMVPool.Return(mv);
PlayingMotions.Remove(ev.Origin);
@@ -359,15 +359,13 @@ namespace Cryville.Crtr.Event {
}
}
}
Callback(ev.Unstamped == null || ev.Unstamped.Priority >= 0 ? ev : null, callback);
Update(ev.Unstamped == null || ev.Unstamped.Priority >= 0 ? ev : null);
}
else Callback(null, callback);
else Update(null);
}
void Callback(StampedEvent ev, Action<StampedEvent> callback) {
void Update(StampedEvent ev) {
UpdateMotions();
if (callback != null)
callback(ev);
if (ev == null || ev.Unstamped != null) Handler.Update(this, ev);
else Handler.ExUpdate(this, ev);
foreach (var m in PlayingMotions)