Beispiel #1
0
 public bool TryGetSoftCast <T>(System.Type traitType, out T key)
     where T : Key
 {
     return(this.TryGetSoftCast <T>(KeyTypeInfo <Key> .Find(traitType), out key));
 }
Beispiel #2
0
 private bool TryGet(KeyTypeInfo <Key> info, out Key key)
 {
     return(this.rootToKey.TryGetValue(info, out key));
 }
Beispiel #3
0
 public bool TryGet(System.Type traitType, out Key key)
 {
     return(this.TryGet(KeyTypeInfo <Key> .Find(traitType), out key));
 }
Beispiel #4
0
 private T GetSoftCast <T>(KeyTypeInfo <Key> info)
     where T : Key
 {
     return((T)((object)this.Get(info) as T));
 }
Beispiel #5
0
 public T GetSoftCast <T>(System.Type type)
     where T : Key
 {
     return(this.GetSoftCast <T>(KeyTypeInfo <Key> .Find(type)));
 }
Beispiel #6
0
 public Key Get(System.Type type)
 {
     return(this.Get(KeyTypeInfo <Key> .Find(type)));
 }
Beispiel #7
0
 private T GetHardCast <T>(KeyTypeInfo <Key> info)
     where T : Key
 {
     return((T)(object)this.Get(info));
 }
Beispiel #8
0
 private Key Get(KeyTypeInfo <Key> info)
 {
     return(this.rootToKey[info]);
 }
Beispiel #9
0
 public static void Add(KeyTypeInfo <Key> info)
 {
     KeyTypeInfo <Key> .Registration.dict.Add(info.Type, info);
 }
Beispiel #10
0
 public override int GetHashCode(KeyTypeInfo <Key> obj)
 {
     return(obj.Root.Type.GetHashCode());
 }
Beispiel #11
0
 public override bool Equals(KeyTypeInfo <Key> x, KeyTypeInfo <Key> y)
 {
     return(x.Root == y.Root);
 }
Beispiel #12
0
 public override int Compare(KeyTypeInfo <Key> x, KeyTypeInfo <Key> y)
 {
     return(-this.CompareForward(x, y));
 }