Ejemplo 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));
 }
Ejemplo n.º 3
0
 public static Shader Find(identifier id)
 {
     return(Instance.FindItem(id));
 }
Ejemplo 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.")
 {
 }
Ejemplo n.º 5
0
 public IdentifierNotUniqueException(identifier identifier, string registry_name)
     : base($"The identifier '{identifier}' is not unique in the {registry_name} registry.")
 {
 }
Ejemplo n.º 6
0
 public T Find(identifier id, bool throw_if_not_found = true)
 {
     return(FindItem(id, throw_if_not_found));
 }