public StackValueOperation(StackValueOperationType type, StackValueType valueType, IEnumerable <StackValue> operands) { ProcessedValue = true; ValueType = valueType; if (operands == null) { Operands = new List <StackValue>(); } else { Operands = new List <StackValue>(operands); } OperationType = type; }
public StackValueOperation(StackValueOperationType type, StackValueType valueType, IEnumerable<StackValue> operands) { ProcessedValue = true; ValueType = valueType; if (operands == null) { Operands = new List<StackValue>(); } else { Operands = new List<StackValue>(operands); } OperationType = type; }
private void VectorOperation(StackValueOperationType type, Stack<StackValue> stack) { var vec1 = new StackValue[3]; var vec2 = new StackValue[3]; if (type != StackValueOperationType.FromF) { vec1[0] = stack.Pop(); vec1[1] = stack.Pop(); vec1[2] = stack.Pop(); if (type != StackValueOperationType.Neg) { vec2[0] = stack.Pop(); vec2[1] = stack.Pop(); vec2[2] = stack.Pop(); stack.Push(new StackValueOperation(type, StackValueType.Float, new[] {vec1[2], vec2[2]})); stack.Push(new StackValueOperation(type, StackValueType.Float, new[] {vec1[1], vec2[1]})); stack.Push(new StackValueOperation(type, StackValueType.Float, new[] {vec1[0], vec2[0]})); } else { stack.Push(new StackValueOperation(type, StackValueType.Float, new[] {vec1[2]})); stack.Push(new StackValueOperation(type, StackValueType.Float, new[] {vec1[1]})); stack.Push(new StackValueOperation(type, StackValueType.Float, new[] {vec1[0]})); } } else { vec1[0] = stack.Pop(); stack.Push(vec1[0]); stack.Push(vec1[0]); stack.Push(vec1[0]); } }
private void VectorOperation(StackValueOperationType type, Stack <StackValue> stack) { var vec1 = new StackValue[3]; var vec2 = new StackValue[3]; if (type != StackValueOperationType.FromF) { vec1[0] = stack.Pop(); vec1[1] = stack.Pop(); vec1[2] = stack.Pop(); if (type != StackValueOperationType.Neg) { vec2[0] = stack.Pop(); vec2[1] = stack.Pop(); vec2[2] = stack.Pop(); stack.Push(new StackValueOperation(type, StackValueType.Float, new[] { vec1[2], vec2[2] })); stack.Push(new StackValueOperation(type, StackValueType.Float, new[] { vec1[1], vec2[1] })); stack.Push(new StackValueOperation(type, StackValueType.Float, new[] { vec1[0], vec2[0] })); } else { stack.Push(new StackValueOperation(type, StackValueType.Float, new[] { vec1[2] })); stack.Push(new StackValueOperation(type, StackValueType.Float, new[] { vec1[1] })); stack.Push(new StackValueOperation(type, StackValueType.Float, new[] { vec1[0] })); } } else { vec1[0] = stack.Pop(); stack.Push(vec1[0]); stack.Push(vec1[0]); stack.Push(vec1[0]); } }
public StackValueOperation(StackValueOperationType type) : this(type, StackValueType.Unknown, null) { }