public override void CollectDataFromChildren() { if (ChildNodes.Count() > 0) { UnionKindOpt = ParseEnum <UnionKind>((ChildNodes.First <ISqlNode>() as SqlKeyNode).Text); } }
protected override object DoEvaluate(ScriptThread thread) { Object.LpObject[] items = null; thread.CurrentNode = this; if (ChildNodes.Count() > 0) { items = (Object.LpObject[])ChildNodes.First().Evaluate(thread); } thread.CurrentNode = Parent; return((items == null) ? Object.LpArray.initialize() : Object.LpArray.initialize(items)); }
protected override object DoEvaluate(ScriptThread thread) { thread.CurrentNode = this; string result = ""; if (ChildNodes.Count() > 0) { result = ChildNodes.First().Evaluate(thread).ToString(); } thread.CurrentNode = Parent; return("[" + result + "]"); }
protected override object DoEvaluate(ScriptThread thread) { thread.CurrentNode = this; Object.LpObject result; if (ChildNodes.Count() > 0) { var assoc = ChildNodes.First(); var pairs = (Dictionary <Object.LpObject, Object.LpObject>)assoc.Evaluate(thread); result = Object.LpHash.initialize(pairs); } else { result = Object.LpHash.initialize(); } thread.CurrentNode = Parent; return(result); }
public void AddEntity(Entity entity) { if (HasChild) { ChildNodes.First(n => n.AABB.IsIntersectWithPoint(entity.Pos)).AddEntity(entity); return; } if (Entities.Count < MaxCount) { Entities.Add(entity); } else { ChildNodes = DivideAABB().Select(b => new OctantNode(b, MaxCount, Level + 1)).ToArray(); Entities.ForEach(AddEntity); Entities.Clear(); } }
public override void CollectDataFromChildren() { switch ((ChildNodes.First <ISqlNode>() as SqlKeyNode).Text.ToUpper()) { case "+": UnOp = UnOp.Plus; break; case "-": UnOp = UnOp.Minus; break; case "~": UnOp = UnOp.Tilde; break; case "NOT": UnOp = UnOp.Not; break; } }
public override void CollectDataFromChildren() => TransactionEndType = ParseEnum <TransactionEndType>(ChildNodes.First().Tokens.First().Text);
public override void CollectDataFromChildren() { switch ((ChildNodes.First <ISqlNode>() as SqlKeyNode).Text.ToUpper()) { case "+": BinOp = BinOp.Plus; break; case "-": BinOp = BinOp.Minus; break; case "*": BinOp = BinOp.Multiply; break; case "/": BinOp = BinOp.Divide; break; case "%": BinOp = BinOp.Modulo; break; case "&": BinOp = BinOp.BitAnd; break; case "|": BinOp = BinOp.BitOr; break; case "^": BinOp = BinOp.ExclusiveOr; break; case "=": BinOp = BinOp.Equal; break; case ">": BinOp = BinOp.Greater; break; case "<": BinOp = BinOp.Less; break; case ">=": BinOp = BinOp.EqualGreater; break; case "<=": BinOp = BinOp.EqualLess; break; case "!=": BinOp = BinOp.NotEqual; break; case "AND": BinOp = BinOp.And; break; case "OR": BinOp = BinOp.Or; break; } }
public override void CollectDataFromChildren() { var type = (ChildNodes.First <ISqlNode>() as SqlKeyNode).Text; FieldType = ParseEnum <DataType>(type); }