public GeneratorComponentIndex(IComponentIndex index) : base(index) { BaseIndex = index; GeneratorComponentIndexMap.Add(BaseIndex, this); }
public ComponentPool(IComponentIndex index) { components = new Dictionary <string, Func <IBaseUIComponent> >(); AddNativeComponents(); foreach (var obj in index.Components) { var component = obj.Component.Create(); components.Add(obj.Component.ComponentName, () => component); } }
public override void ConnectComponents(IDomain domain, IDynamic currentDynamic, IReadOnlyCollection <IComponent> components) { base.ConnectComponents(domain, currentDynamic, components); if (Index == null) { throw new ParsingException(200, Source, $"StatePanel has no index."); } IComponent FoundComponent = null; foreach (IComponent Item in components) { if (Item.Source.Name == Index) { FoundComponent = Item; break; } } if (FoundComponent is IComponentIndex AsIndexComponent) { IObjectPropertyIndex IndexObjectProperty = AsIndexComponent.IndexObjectProperty; if (IndexObjectProperty is IObjectPropertyBoolean AsBooleanProperty) { if (Items.Count != 2) { throw new ParsingException(201, Source, $"StatePanel is referencing '{Index}' but doesn't have the two items expected for a boolean property."); } } else if (Items.Count < 2) { throw new ParsingException(202, Source, $"StatePanel must have at least two items."); } Component = AsIndexComponent; Component.SetIsUsed(); } else if (FoundComponent == null) { throw new ParsingException(171, Source, $"StatePanel is referencing '{Index}' but this index doesn't exist."); } else { throw new ParsingException(172, Source, $"StatePanel is referencing '{Index}' but this component is not an index."); } }
public CollectItem(ITaskIdBuilder id, IComponentIndex compIndex, IGameObjectManager goMgr) : base(id) { this.goMgr = goMgr; this.compIndex = compIndex; }
void OnPostInject() { index = _index; this.AddToIndex(); }
public static void Initialize(IComponentIndex index) { Instance = new ComponentPool(index); }