Exemplo n.º 1
0
        public override Node ExitInExpression(Production node)
        {
            IList childValues = GetChildValues(node);

            if (childValues.Count == 1)
            {
                AddFirstChildValue(node);
                return(node);
            }

            var operand = (BaseExpressionElement)childValues[0];

            childValues.RemoveAt(0);

            var       second = childValues[0];
            InElement op;

            if (second is IList list)
            {
                op = new InElement(operand, list);
            }
            else
            {
                var invocationListElement = new InvocationListElement(childValues, context);
                op = new InElement(operand, invocationListElement);
            }

            node.AddValue(op);
            return(node);
        }
Exemplo n.º 2
0
        public override Node ExitInExpression(Production node)
        {
            IList childValues = this.GetChildValues(node);

            if (childValues.Count == 1)
            {
                this.AddFirstChildValue(node);
                return(node);
            }

            ExpressionElement operand = (ExpressionElement)childValues[0];

            childValues.RemoveAt(0);

            object    second = childValues[0];
            InElement op     = default(InElement);

            if ((second) is IList)
            {
                op = new InElement(operand, (IList)second);
            }
            else
            {
                InvocationListElement il = new InvocationListElement(childValues, _myServices);
                op = new InElement(operand, il);
            }

            node.AddValue(op);
            return(node);
        }
Exemplo n.º 3
0
        public void Sim1000ms(float dt)
        {
            int cell = Grid.PosToCell(gameObject);

            if (!Grid.IsValidCell(cell))
            {
                return;
            }
            InElement?.Invoke(dt);
        }