コード例 #1
0
ファイル: GamaFunctionDefs.cs プロジェクト: jangofett4/Gama
        public GamaFunctionRef FindFunction(GamaParamList parms, bool skipHidden = false)
        {
            foreach (var cb in Callbacks)
            {
                if (cb.Parameters.Count != parms.Count)
                {
                    continue;
                }
                bool found = true;
                for (int i = 0; i < parms.Count; i++)
                {
                    if (cb.Parameters[i].Type != parms[i].Type)
                    {
                        found = false;
                        break;
                    }
                }

                if (found)
                {
                    // Skipping hidden types are useful for hiding some functions from other namespaces
                    // This won't stop this type from apparing in same namespace tho
                    if (skipHidden && cb.HasAttribute("hide"))
                    {
                        continue;
                    }
                    else
                    {
                        return(cb);
                    }
                }
            }
            return(null);
        }
コード例 #2
0
ファイル: GamaFunctionDefs.cs プロジェクト: jangofett4/Gama
 public GamaFunctionRef(GamaTypeRef ret, GamaParamList parms, GamaTypeRef ty, LLVMValueRef val, bool ismethod) : base(ty, val, true)
 {
     Blocks     = new List <ObjectGroup <GamaBlockRef> >();
     ReturnType = ret;
     Parameters = parms;
     Attributes = new GamaAttributeSet();
     IsMethod   = ismethod;
 }