Пример #1
0
        public static bool MatchConstant <T>(this ILNode node, out T value)
        {
            ILValue ret;

            if (node.MatchConstant(out ret) && ret.Value is T)
            {
                value = (T)ret.Value;
                return(true);
            }
            value = default(T);
            return(false);
        }
Пример #2
0
        public static bool MatchIntConstant(this ILNode node, out int value)
        {
            ILValue ret;

            if (node.MatchConstant(out ret) && (ret.Type == GM_Type.Short || ret.Type == GM_Type.Int))
            {
                value = (int)ret.Value;
                return(true);
            }
            value = default(int);
            return(false);
        }