예제 #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);
        }
예제 #2
0
 public bool TryGet(MapTypeKey key, out T type) =>
 _byKey.TryGetValue(key, out type);
예제 #3
0
 public T this[MapTypeKey key] => Get(key);
예제 #4
0
 public bool Contains(MapTypeKey key) =>
 _byKey.ContainsKey(key);
예제 #5
0
 public MapTypeInfo(AreaKey area, Type declaredType)
 {
     DeclaredType = declaredType;
     Key          = MapTypeKey.From(area, ReadName());
     State        = new MapTypeState(declaredType);
 }