Beispiel #1
0
        public static TypedExecutable <T> FromScript(string script,
                                                     ParserContext parserContext)
        {
            if (typeof(T) == typeof(Void))
            {
                Debug.LogError("TypedExecutable<T = Void> : Void type not allowed.");
                return(null);
            }
            Executable executable = Executable.FromScript(script, parserContext);

            if (executable == null)
            {
                Debug.LogError($"TypedExecutable<T = {typeof(T)}>.FromScript : " +
                               $"parsing error in  :\n{script}");
                return(null);
            }
            if (!Executable.TypeCompatibility <T>(executable.Type, executable.ArrayType))
            {
                Debug.LogError($"TypedExecutable<T = {typeof(T)}>.FromScript : T " +
                               $"is not compatible with {executable.Type}.");
                return(null);
            }
            return(new TypedExecutable <T>(executable));
        }
Beispiel #2
0
 private TypedExecutable(Executable executable)
 {
     this.executable = executable;
 }