Beispiel #1
0
 public SessionComponentDescription(IsSessionComponent attr, Type componentClass, Assembly assembly) : base(attr, componentClass, assembly)
 {
     ConditionFunc = GetMethodsInTypeWith <SessionComponentIf>(componentClass)
                     .Where(x => x.IsStatic)
                     .Select(x => MethodToFunc <bool>(x))
                     .DefaultIfEmpty(() => true)
                     .First();
     EventMethods = EventMethods.Where(x => x.Attr is HandlesSessionEvents).ToList();
 }
Beispiel #2
0
 public EntityComponentDescription(IsEntityComponent attr, Type componentClass, Assembly assembly) : base(attr, componentClass, assembly)
 {
     BuilderTypes = attr.BuilderTypes.Select(x => (MyObjectBuilderType)x).ToList();
     BuilderTypes.Sort((x, y) => x.GetHashCode().CompareTo(y.GetHashCode()));
     ConditionFunc = GetMethodsInTypeWith <EntityComponentIf>(componentClass)
                     .Where(method => method.IsStatic)
                     .Select(method => MethodToFunc <TEntity, bool>(method))
                     .DefaultIfEmpty(x => true)
                     .First();
     EventMethods = EventMethods.Where(x => x.Attr is HandlesEntityEvents).ToList();
 }