public void Add(RuntimicSystemModel conversion, SemanticGenericParameterTypeDefinitionsMask_I definitions, List <SemanticGenericParameterTypeDefinitionMask_I> inputList)
 {
     for (int i = 0; i < inputList.Count; i++)
     {
         Add(conversion, definitions, inputList[i]);
     }
 }
        public void Clear(ILConversion conversion, SemanticGenericParameterTypeDefinitionsMask_I definitions)
        {
            definitions.ByName.Clear();

            definitions.ByPosition.Clear();

            definitions.All.Clear();
        }
        public string[] GetNames(RuntimicSystemModel conversion, SemanticGenericParameterTypeDefinitionsMask_I definitions)
        {
            var all = definitions.All;

            string[] nameList = new string[all.Count];

            for (int i = 0; i < all.Count; i++)
            {
                var tp = all[i];

                nameList[i] = tp.Name;
            }

            return(nameList);
        }
        public void Add(RuntimicSystemModel conversion, SemanticGenericParameterTypeDefinitionsMask_I definitions, SemanticGenericParameterTypeDefinitionMask_I typeParameter)
        {
            if (typeParameter.TypeParameterKind == TypeParameterKind.Unknown)
            {
                throw new Exception("Type parameter kind is set to unknown");
            }

            if (typeParameter.Position < 0)
            {
                throw new Exception("Position cannot be a negative number.  Make sure it is set to value greater than or equal to zero when creating the parameter.");
            }

            definitions.ByName.Add(typeParameter.Name, typeParameter);

            definitions.ByPosition.Add(typeParameter.Position, typeParameter);

            definitions.All.Add(typeParameter);
        }
        public SemanticGenericParameterTypeDefinitionMask_I GetOrThrow(RuntimicSystemModel conversion, SemanticGenericParameterTypeDefinitionsMask_I definitions, string name)
        {
            var result = Get(conversion, definitions, name);

            if (result == null)
            {
                throw new Exception($"Could not find type parameter with name {name}");
            }

            return(result);
        }
        public SemanticGenericParameterTypeDefinitionMask_I Get(RuntimicSystemModel conversion, SemanticGenericParameterTypeDefinitionsMask_I definitions, int position)
        {
            if (definitions.ByPosition.TryGetValue(position, out SemanticGenericParameterTypeDefinitionMask_I typeParameter))
            {
                return(typeParameter);
            }

            return(null);
        }
        public SemanticGenericParameterTypeDefinitionMask_I Get(RuntimicSystemModel conversion, SemanticGenericParameterTypeDefinitionsMask_I definitions, string name)
        {
            if (definitions.ByName.TryGetValue(name, out SemanticGenericParameterTypeDefinitionMask_I typeParameter))
            {
                return(typeParameter);
            }

            return(null);
        }