상속: BcsEntityNode
예제 #1
0
        protected override void VisitComponent(BcsComponentNode bcsComponent)
        {
            var item = new MenuItem() { Title = $"Component: {bcsComponent.Name}::{bcsComponent?.Location?.Name ?? string.Empty}" };

            AddToTree(bcsComponent, item);
        }
예제 #2
0
 protected override void VisitComponent(BcsComponentNode bcsComponent)
 {
     ResolveFromParent(bcsComponent);
 }
예제 #3
0
        private void CreateComponents()
        {
            var components = DefinitionFile.Entities.Where(e => e.States.SourceText.IsEmptyOrWhitespace() && !e.Composition.SourceText.Contains("."));

            foreach (var component in components)
            {
                var componentNode = new BcsComponentNode()
                {
                    Name = component.Id
                };

                if (!component.Composition.SourceText.IsEmptyOrWhitespace())
                {
                    var componentAgents = component.Composition.SourceText.Split('|').Select(name =>
                    {
                        name = name.Trim();

                        var matchingAgent = DefinitionFile.AtomicAgents.SingleOrDefault(agent => agent.Name == name);
                        if (matchingAgent == null)
                        {
                            componentNode.Errors.Add(new NodeError($"Failed to find matching agent named {name} in the definition file."));
                            var dummyAgent = new BcsAtomicAgentNode() { Name = name };
                            DefinitionFile.AtomicAgents.Add(dummyAgent);
                            return dummyAgent;
                        }
                        return matchingAgent;
                    }).ToList();

                    componentNode.AtomicAgents.AddRange(componentAgents);
                }

                DefinitionFile.Components.Add(componentNode);
            }
        }
예제 #4
0
 protected abstract void VisitComponent(BcsComponentNode bcsComponent);
예제 #5
0
        public void CreateComplexes()
        {
            var complexes = DefinitionFile.Entities.Where(e => e.States.SourceText.IsEmptyOrWhitespace() && e.Composition.SourceText.Contains("."));

            foreach (var complex in complexes)
            {
                var complexNode = new BcsComplexNode() { Name = complex.Name };

                var compoennts = complex.Composition.SourceText.Split('.').Select(name =>
                {
                    name = name.Trim();

                    var matchingComponent = DefinitionFile.Components.SingleOrDefault(component => component.Name == name);
                    if (matchingComponent == null)
                    {
                        complexNode.Errors.Add(new NodeError($"Failed to find matching component named {name} in the definition file."));
                        var dummyComponent = new BcsComponentNode() { Name = name };
                        DefinitionFile.Components.Add(dummyComponent);
                        return dummyComponent;
                    }
                    return matchingComponent;
                }).ToList();

                complexNode.Components.AddRange(compoennts);
                DefinitionFile.Complexes.Add(complexNode);
            }
        }