Example #1
0
 public T GetOrDefault <T>(Actor actor)
 {
     if (actor.Destroyed)
     {
         throw new InvalidOperationException("Attempted to get trait from destroyed object ({0})".F(actor.ToString()));
     }
     return(((TraitContainer <T>)InnerGet(typeof(T))).GetOrDefault(actor.ActorID));
 }
Example #2
0
 public IEnumerable <T> WithInterface <T>(Actor actor)
 {
     if (actor.Destroyed)
     {
         throw new InvalidOperationException("Attempted to get trait from destroyed object ({0})".F(actor.ToString()));
     }
     return(((TraitContainer <T>)InnerGet(typeof(T))).GetMultiple(actor.ActorID));
 }
Example #3
0
 public bool Contains <T>(Actor actor)
 {
     if (actor.Destroyed)
     {
         throw new InvalidOperationException("Attempted to get trait from destroyed object ({0})".F(actor.ToString()));
     }
     return(((TraitContainer <T>)InnerGet(typeof(T))).GetMultiple(actor.ActorID).Count() != 0);
 }