示例#1
0
        public static MultiNodes BuildTable(EntityDef e, List <Semantics.Node> l)
        {
            var Lines = l.Select(n => new TableLine {
                Nodes = n.Stem.Children.Select(c => TableLineNode.CreateSingleLineLiteral(new SingleLineLiteral {
                    Text = c.Stem.Children.Single().Leaf
                })).ToList(), SingleLineComment = TreeFormat.Optional <SingleLineComment> .Empty
            }).ToList();
            var TableNodes = new TableNodes
            {
                ChildHead = new SingleLineLiteral {
                    Text = e.Name
                },
                ChildFields = e.Fields.Where(f => f.Attribute.OnColumn).Select(c => new SingleLineLiteral {
                    Text = c.Name
                }).ToList(),
                SingleLineComment = TreeFormat.Optional <SingleLineComment> .Empty,
                Children          = Lines,
                EndDirective      = TreeFormat.Optional <EndDirective> .Empty
            };
            var Table = new MultiLineNode
            {
                Head = new SingleLineLiteral {
                    Text = e.CollectionName
                },
                SingleLineComment = TreeFormat.Optional <SingleLineComment> .Empty,
                Children          = new List <MultiNodes> {
                    MultiNodes.CreateTableNodes(TableNodes)
                },
                EndDirective = TreeFormat.Optional <EndDirective> .Empty
            };

            return(MultiNodes.CreateNode(Node.CreateMultiLineNode(Table)));
        }
示例#2
0
        /// <summary>
        /// sagt allen verwalteten Objekten Bescheid, dass sie ticken dürfen *g*
        /// </summary>
        public void Tick(double tickLength)
        {
            MultiLineNode temNode = new MultiLineNode();
            foreach (LineNode ln in nodes)
                {
                    temNode.m_MultiLineNode = ln;
                    temNode.ticLength = tickLength;
                    //ThreadPool.QueueUserWorkItem(new WaitCallback(MultiTick), temNode);
                    ln.Tick(tickLength);
                }

            int bucketNumber = GlobalTime.Instance.currentCycleTick;
            foreach (NodeConnection nc in _connections)
                {
                nc.GatherStatistics(bucketNumber);
                }
        }