public void RemoveAction(BaseAction action) { Application.Current.ActionManager.RemoveAction(action, this); }
internal void RemoveAction(BaseAction action, Node target) { if (action == null || target == null) return; HashElement element; if (targets.TryGetValue(target, out element)) { int limit = element.ActionStates.Count; bool actionFound = false; for (int i = 0; i < limit; i++) { var actionState = element.ActionStates[i]; if (actionState.Action == action && actionState.OriginalTarget == target) { RemoveActionAtIndex(i, element); actionFound = true; break; } } } }
protected ActionState(BaseAction action, Node target) { this.Action = action; this.Target = target; this.OriginalTarget = target; }
public ActionState AddAction(BaseAction action, Node target, bool paused = false) { Debug.Assert(action != null); Debug.Assert(target != null); HashElement element; if (!targets.TryGetValue(target, out element)) { element = new HashElement(); element.Paused = paused; element.Target = target; targets.Add(target, element); targetsAvailable = true; } ActionAllocWithHashElement(element); var isActionRunning = false; foreach (var existingState in element.ActionStates) { if (existingState.Action == action) { isActionRunning = true; break; } } Debug.Assert(!isActionRunning, "Action is already running for this target."); var state = action.StartAction(target); element.ActionStates.Add(state); return state; }