Esempio n. 1
0
        //Infers the type of the persistant routine that matches best with the contents of the PersistantRoutineDatum provided as the parameter
        private static PersistantRoutineType InferType(PersistantRoutineDatum dat)
        {
            if (dat == null)
            {
                return(PersistantRoutineType.None);
            }

            //does not have a scene to invoke on
            if (dat.ScenesToInvokeOn == null || dat.ScenesToInvokeOn.Length == 0)
            {
                if (dat.InvokeAfterEverySceneLoad)
                {
                    return(PersistantRoutineType.BlindPersistant);
                }
                else if (dat.BlindInvocationCount > 0)
                {
                    return(PersistantRoutineType.BlindMultipleInvocations);
                }
                return(PersistantRoutineType.BlindOneShot);
            }

            if (dat.ScenesToInvokeOn.Length == 1)
            {
                return(PersistantRoutineType.OneShot);
            }

            if (dat.ScenesToInvokeOn.Length > 1)
            {
                return(PersistantRoutineType.MultipleInvocations);
            }

            return(PersistantRoutineType.None);
        }
Esempio n. 2
0
 /// <summary>
 /// Infers and creates a persistant routine based on the datum provided as parameter
 /// </summary>
 /// <param name="dat"></param>
 /// <returns></returns>
 public static IPersistantRoutine GetPersistantRoutine(PersistantRoutineDatum dat)
 {
     return(GetPersistantRoutine(InferType(dat), SSL_Utils.PersistantRoutineCompiler.CreateRoutine(dat), dat.ScenesToInvokeOn));
 }