Ejemplo n.º 1
0
        public AreaInstance Visit(AreaInstance area, IEnumerable <int> path)
        {
            if (area.Path.IsEquivalentTo(path))
            {
                return(area);
            }

            return(area.Components.Select(c => c.Accept(this, path)).FirstOrDefault(a => a != null));
        }
Ejemplo n.º 2
0
        public ComponentInstance Visit(AreaInstance area, IEnumerable <int> path)
        {
            if (!path.Any())
            {
                return(area);
            }

            if (area.Components.Count() < path.First())
            {
                throw new KolaException("No component at specified path");
            }

            return(area.Components.ElementAt(path.First()).Accept(this, path.Skip(1)));
        }