Example #1
0
        public T Get(MapTypeKey key)
        {
            if (!TryGet(key, out var type))
            {
                throw new KeyNotFoundException($"This set does not contain the specified key: {key}");
            }

            return(type);
        }
Example #2
0
 public bool TryGet(MapTypeKey key, out T type) =>
 _byKey.TryGetValue(key, out type);
Example #3
0
 public T this[MapTypeKey key] => Get(key);
Example #4
0
 public bool Contains(MapTypeKey key) =>
 _byKey.ContainsKey(key);
Example #5
0
 public MapTypeInfo(AreaKey area, Type declaredType)
 {
     DeclaredType = declaredType;
     Key          = MapTypeKey.From(area, ReadName());
     State        = new MapTypeState(declaredType);
 }