public void Execute(AInteractiveObjectAction aInteractiveObjectAction) { if (this._interactiveObjectActionExecutionLockSystem.AreInteractiveObjectActionsLocked()) { this._interactiveObjectActionExecutionLockSystem.AddInteractiveObjectActionToLockedQueue(aInteractiveObjectAction); } else { if (!this.InteractiveObjectActionStates.ContainsKey(aInteractiveObjectAction.InteractiveObjectActionUniqueID)) { this.InteractiveObjectActionStates[aInteractiveObjectAction.InteractiveObjectActionUniqueID] = new InteractiveObjectActionState(); } var InteractiveObjectActionState = this.InteractiveObjectActionStates[aInteractiveObjectAction.InteractiveObjectActionUniqueID]; if (!InteractiveObjectActionState.IsInteractiveObjectActionOnCooldown() && !InteractiveObjectActionState.IsInteractiveObjectActionCurrentlyRunning()) { InteractiveObjectActionState = new InteractiveObjectActionState(aInteractiveObjectAction, new CooldownActionState(aInteractiveObjectAction.CoreInteractiveObjectActionDefinition)); InteractiveObjectActionState.GetInteractiveObjectActionReference().FirstExecution(); this.InteractiveObjectActionStates[aInteractiveObjectAction.InteractiveObjectActionUniqueID] = InteractiveObjectActionState; } } }
public void AddInteractiveObjectActionToLockedQueue(AInteractiveObjectAction aInteractiveObjectAction) { this.LockedBufferInteractiveObjectActionsExecuted.Push(aInteractiveObjectAction); }
/// <summary> /// Called from <see cref="InteractiveObjectActionEndedCleanupSystem"/> when the <see cref="_aInteractiveObjectActionReference"/> is considered done. /// </summary> public void ClearInteractiveObjectAction() { this._aInteractiveObjectActionReference.Dispose(); this._aInteractiveObjectActionReference = null; }
public InteractiveObjectActionState(AInteractiveObjectAction aInteractiveObjectActionReference, CooldownActionState cooldownActionState) { _aInteractiveObjectActionReference = aInteractiveObjectActionReference; CooldownActionState = cooldownActionState; }