Ejemplo n.º 1
0
    private void DestroyAction(TimeInversibleAction action)
    {
        int storageIndex = actionsStorage.FindIndex(t => t.Item1 == action);

        if (storageIndex >= 0)
        {
            LogDebug("Destroying action: " + action.ToString());
            GameObject actionObject = actionsStorage[storageIndex].Item2;
            actionsStorage.RemoveAt(storageIndex);
            Destroy(actionObject);
        }
        else
        {
            LogError($"The following action was not destroyed since it's not one of this object's actions: {action}");
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Actions call this method when then completed backwards. It is generally a propert time to discard them
 /// as they will not be played again.
 /// </summary>
 internal void SignalActionCompletedBackwards(TimeInversibleAction action)
 {
     DestroyAction(action);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Signals that an action could not start. This may be due to the player creating time paradoxes.
 /// These failed actions should probably be discarded in such case.
 /// </summary>
 internal void SignalActionStartFailed(TimeInversibleAction action)
 {
     Log($"The following action could not start and will be discarded: {action}");
     DestroyAction(action);
 }