Esempio n. 1
0
        protected T FindItem(identifier id, bool throw_if_not_found = true)
        {
            if (values.ContainsKey(id))
            {
                return(values[id]);
            }

            if (throw_if_not_found)
            {
                throw  new RegistryEntryNotFoundException(id, type);
            }

            return(null);
        }
 public static Texture Find(identifier id)
 {
     return(Instance.FindItem(id));
 }
Esempio n. 3
0
 public static Shader Find(identifier id)
 {
     return(Instance.FindItem(id));
 }
Esempio n. 4
0
 public RegistryEntryNotFoundException(identifier identifier, string registry_name)
     : base($"An item with the identifier '{identifier}' could not be found in the {registry_name} registry.")
 {
 }
Esempio n. 5
0
 public IdentifierNotUniqueException(identifier identifier, string registry_name)
     : base($"The identifier '{identifier}' is not unique in the {registry_name} registry.")
 {
 }
Esempio n. 6
0
 public T Find(identifier id, bool throw_if_not_found = true)
 {
     return(FindItem(id, throw_if_not_found));
 }