Ejemplo n.º 1
0
        public GeneratorComponentIndex(IComponentIndex index)
            : base(index)
        {
            BaseIndex = index;

            GeneratorComponentIndexMap.Add(BaseIndex, this);
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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.");
            }
        }
Ejemplo n.º 4
0
 public CollectItem(ITaskIdBuilder id, IComponentIndex compIndex, IGameObjectManager goMgr)
     : base(id)
 {
     this.goMgr     = goMgr;
     this.compIndex = compIndex;
 }
Ejemplo n.º 5
0
 void OnPostInject()
 {
     index = _index;
     this.AddToIndex();
 }
Ejemplo n.º 6
0
 public static void Initialize(IComponentIndex index)
 {
     Instance = new ComponentPool(index);
 }