private IMathExpression similar(IMathExpression e, Types innerType, Types outerType) { bool isAdd = outerType == Types.Addition; List <Helper> tmp = repeatatives(e, isAdd); if (tmp.Count == e.getOperands().Count) { return(e); } List <IExpressionType> list = new List <IExpressionType>(); foreach (var h in tmp) { if (h.count == 1) { list.Add(h.expression); continue; } List <IExpressionType> operands = new List <IExpressionType>(); operands.Add(h.expression); operands.Add(new Number(h.count)); list.Add(new Function(innerType, operands, "")); } if (list.Count == 1) { return((IMathExpression)list[0]); } return(new Function(outerType, list, "")); }
public override void ExportCode(ActionBranch currentAction, ActionBranch nextAction, ILimnorCodeCompiler compiler, IMethodCompile methodToCompile, System.CodeDom.CodeMemberMethod method, System.CodeDom.CodeStatementCollection statements, bool debug) { IMathExpression mathExp = MathExp; if (mathExp != null) { CodeExpression ceCondition = null; if (Condition != null) { ceCondition = Condition.ExportCode(methodToCompile); if (ceCondition != null) { ceCondition = CompilerUtil.ConvertToBool(Condition.DataType, ceCondition); } } CodeExpression ce = mathExp.ReturnCodeExpression(methodToCompile); if (ce != null) { if (ceCondition == null) { statements.Add(new CodeMethodReturnStatement(ce)); } else { CodeConditionStatement cd = new CodeConditionStatement(); cd.Condition = ceCondition; cd.TrueStatements.Add(new CodeMethodReturnStatement(ce)); statements.Add(cd); } } } }
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value) { if (context != null && context.Instance != null && provider != null) { IWindowsFormsEditorService service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (service != null) { IWithProject mc = context.Instance as IWithProject; if (mc == null) { MathNode.Log(new DesignerException("{0} does not implement IWithProject", context.Instance.GetType())); } else { if (mc.Project == null) { MathNode.Log(new DesignerException("Project not set for {0} [{1}]", mc, mc.GetType())); } else { Rectangle rc = new Rectangle(System.Windows.Forms.Cursor.Position, new Size(20, 60)); IMathExpression im = value as IMathExpression; if (im == null) { im = new MathNodeRoot(); } } } } } return(value); }
public IActionResult EvaluateExpression([FromBody, SwaggerRequestBody("The request that contains the expression and variables")] ExpressionRequest request) { if (!this.ModelState.IsValid) { this.logger.LogError("This model doesn't look right to me!"); throw new ArgumentException("Your request body wasn't proper! "); } this.logger.LogInformation($"All looks good. Let's start parsing: {request.Expression}."); MathExpressionBuilder builder = new MathExpressionBuilder(request.Expression); IMathExpression parsedExpression = builder.GenerateExpression(); this.logger.LogDebug("Yup. Looks like a legit expression."); foreach (var variable in request.VariableEntries) { builder.SetVariable(variable.Name, variable.Value.ToString()); this.logger.LogDebug("Setting variable {0} with {1}", variable.Name, variable.Value); } ExpressionResponse response = new ExpressionResponse { AdjustedExpression = parsedExpression.ToString(), Expression = request.Expression, VariableEntries = request.VariableEntries, ValueGenerated = parsedExpression.EvaluateExpression() }; return(this.Ok(response)); }
private IMathExpression integateCos(IMathExpression coeff) { List <IExpressionType> list = new List <IExpressionType>(); list.Add(_param); return(new Function(Types.FuncExpression, list, "sin")); }
/// <summary> /// called when loading the group /// </summary> /// <param name="item"></param> public void ImportMathItem(MathExpItem item) { bLoading = true; this.Name = item.Name; this.Location = item.Location; this.Size = item.Size; this.mathExp = item.MathExpression; if (Site != null) { Site.Name = item.Name; } mathExp.GenerateInputVariables(); mathExp.PrepareDrawInDiagram(); if (OutputPorts != null) { for (int i = 0; i < OutputPorts.Length; i++) { OutputPorts[i].Owner = this; OutputPorts[i].Label.Visible = false; OutputPorts[i].RestoreLocation(); } } createImage(); bLoading = false; }
private static ObjectAction GetSatelliteShootAction( Dictionary <string, DTDanmakuImage> spriteNameToImageDictionary, Dictionary <string, EnemyObjectTemplate> enemyObjectTemplates, GuidGenerator guidGenerator) { IMathExpression initialShootCooldownInMillis = MathExpression.RandomInteger(6000); IMathExpression shootCooldownInMillis = MathExpression.Add(5000, MathExpression.RandomInteger(1000)); string cooldownVariableName = guidGenerator.NextGuid(); ObjectAction initialStartCooldownAction = ObjectAction.SetNumericVariable(cooldownVariableName, initialShootCooldownInMillis); ObjectAction startCooldownAction = ObjectAction.SetNumericVariable(cooldownVariableName, shootCooldownInMillis); ObjectAction decrementCooldownAction = ObjectAction.SetNumericVariable(cooldownVariableName, MathExpression.Subtract(MathExpression.Variable(cooldownVariableName), MathExpression.ElapsedMillisecondsPerIteration())); ObjectAction createBulletAction = SpawnSatelliteBullet( spriteNameToImageDictionary: spriteNameToImageDictionary, enemyObjectTemplates: enemyObjectTemplates, guidGenerator: guidGenerator); var createBulletWhenCooldownFinishedAction = ObjectAction.Condition( condition: BooleanExpression.LessThanOrEqualTo(MathExpression.Variable(cooldownVariableName), MathExpression.Constant(0)), action: ObjectAction.Union(startCooldownAction, createBulletAction)); return(ObjectAction.ConditionalNextAction( currentAction: initialStartCooldownAction, condition: BooleanExpression.True(), nextAction: ObjectAction.Union(decrementCooldownAction, createBulletWhenCooldownFinishedAction))); }
public override void CreateJavaScript(StringCollection methodToCompile, Dictionary <string, StringCollection> formsumissions, string nextActionInput, string indent) { IMathExpression mathExp = MathExp; if (mathExp != null) { string ce = mathExp.ReturnJavaScriptCodeExpression(methodToCompile); if (!string.IsNullOrEmpty(ce)) { string ceCondition = null; if (Condition != null) { ceCondition = Condition.CreateJavaScriptCode(methodToCompile); } if (string.IsNullOrEmpty(ceCondition)) { methodToCompile.Add(indent); methodToCompile.Add(ce); } else { methodToCompile.Add(indent); methodToCompile.Add("if("); methodToCompile.Add(ceCondition); methodToCompile.Add(") {\r\n"); methodToCompile.Add(indent); methodToCompile.Add("\t"); methodToCompile.Add(ce); methodToCompile.Add("\r\n"); methodToCompile.Add(indent); methodToCompile.Add("}\r\n"); } } } }
public override void CreatePhpScript(StringCollection methodToCompile) { IMathExpression mathExp = MathExp; if (mathExp != null) { string ce = mathExp.ReturnPhpScriptCodeExpression(methodToCompile); if (!string.IsNullOrEmpty(ce)) { string ceCondition = null; if (Condition != null) { ceCondition = Condition.CreatePhpScriptCode(methodToCompile); } if (string.IsNullOrEmpty(ceCondition)) { methodToCompile.Add(ce); } else { methodToCompile.Add("if("); methodToCompile.Add(ceCondition); methodToCompile.Add(")\r\n{\r\n"); methodToCompile.Add(ce); methodToCompile.Add("\r\n}\r\n"); } } } }
private List <IMathExpression> ReduceExponents(List <IMathExpression> expressions, params OperationType[] desiredOperationTypes) { List <IMathExpression> reducedExpressions = new List <IMathExpression>(); bool requiresEvaluation = false; foreach (IMathExpression expression in expressions) { if (!requiresEvaluation) { BinaryExpression binaryExpression = expression as BinaryExpression; if (binaryExpression == null || desiredOperationTypes.All(x => x != binaryExpression.Operator)) { reducedExpressions.Add(expression); continue; // Skip the rest and move to the next iteration. } requiresEvaluation = true; int index = reducedExpressions.Count - 1; IMathExpression leftExpression = reducedExpressions[index]; reducedExpressions.RemoveAt(index); binaryExpression.LeftExpression = leftExpression; reducedExpressions.Add(binaryExpression); } else { requiresEvaluation = false; int index = reducedExpressions.Count - 1; BinaryExpression rightExpression = reducedExpressions[index] as BinaryExpression; rightExpression.RightExpression = expression; } } return(reducedExpressions); }
public IExpressionType doVarDefenition(Equation eq) { Context ctx = Context.getInstance(); Computator comp = new Computator(); // если опредлено как отложенные, то пропускаем if (eq.isDelayed()) { eq.setDelayed(false); return(eq); } // иначе вычисляем List <IExpressionType> lst = new List <IExpressionType>(); IMathExpression operand = (IMathExpression)eq.getOperands()[1].doOperation(comp); lst.Add(eq.getOperands()[0]); lst.Add(operand); Equation ne = new Equation(lst, false); // change context ctx.changeVariable(((Variable)ne.getOperands()[0]).getValue(), ctx.getCurrPath(), ne); return(ne); }
public override void ExportJavaScriptCode(ActionBranch currentAction, ActionBranch nextAction, StringCollection jsCode, StringCollection methodToCompile, JsMethodCompiler data) { IMathExpression mathExp = MathExp; if (mathExp != null) { string ce = mathExp.ReturnJavaScriptCodeExpression(methodToCompile); if (!string.IsNullOrEmpty(ce)) { string target = null; string output = null; if (nextAction != null) { if (nextAction.UseInput) { methodToCompile.Add("var "); methodToCompile.Add(currentAction.OutputCodeName); methodToCompile.Add("="); methodToCompile.Add(ce); methodToCompile.Add(";\r\n"); output = currentAction.OutputCodeName; } } IVariable v = mathExp.OutputVariable; if (v != null) { string ceCondition = null; if (Condition != null) { ceCondition = Condition.CreateJavaScriptCode(methodToCompile); } target = v.ExportJavaScriptCode(methodToCompile); string jsLine; if (output != null) { jsLine = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}={1};\r\n", target, currentAction.OutputCodeName); } else { jsLine = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}={1};\r\n", target, ce); } if (string.IsNullOrEmpty(ceCondition)) { methodToCompile.Add(jsLine); } else { methodToCompile.Add("if("); methodToCompile.Add(ceCondition); methodToCompile.Add(")\r\n{\r\n"); methodToCompile.Add(jsLine); methodToCompile.Add("\r\n}\r\n"); } } } } }
public static ObjectAction SetFacingDirection(IMathExpression facingDirectionInMillidegrees) { ObjectAction action = new ObjectAction(); action.ObjectActionType = Type.SetFacingDirection; action.SetFacingDirectionInMillidegrees = facingDirectionInMillidegrees; return(action); }
public static ObjectAction DecreaseSpeed(IMathExpression speedInMillipixelsPerMillisecond) { ObjectAction action = new ObjectAction(); action.ObjectActionType = Type.DecreaseSpeed; action.SpeedInMillipixelsPerMillisecond = speedInMillipixelsPerMillisecond; return(action); }
private IMathExpression integateAbsoluteTerm(IMathExpression exp) { List <IExpressionType> list = new List <IExpressionType>(); list.Add((Number)exp); list.Add(_param); return(new Function(Types.Multiplication, list, "")); }
public bool compare(IMathExpression e) { if (getType() != e.getType()) { return(false); } return(true); }
public static BooleanExpression LessThanOrEqualTo(IMathExpression leftSide, IMathExpression rightSide) { BooleanExpression expression = new BooleanExpression(); expression.BooleanExpressionType = Type.LessThanOrEqualTo; expression.MathLeftSide = leftSide; expression.MathRightSide = rightSide; return(expression); }
public static ObjectAction DisplayBossHealthBar(IMathExpression healthBarMeterNumber, IMathExpression healthBarMilliPercentage) { ObjectAction action = new ObjectAction(); action.ObjectActionType = Type.DisplayBossHealthBar; action.BossHealthBarMeterNumber = healthBarMeterNumber; action.BossHealthBarMilliPercentage = healthBarMilliPercentage; return(action); }
public void LoadMathExpression(IMathExpression data) { mathExp = data; this.Name = data.Name; this.Site.Name = data.Name; mathExp.PrepareDrawInDiagram(); // createImage(); }
public static ObjectAction SetPosition(IMathExpression xMillis, IMathExpression yMillis) { ObjectAction action = new ObjectAction(); action.ObjectActionType = Type.SetPosition; action.SetXMillisPosition = xMillis; action.SetYMillisPosition = yMillis; return(action); }
public static ObjectAction StrafeMove(IMathExpression moveToXMillis, IMathExpression moveToYMillis) { ObjectAction action = new ObjectAction(); action.ObjectActionType = Type.StrafeMove; action.MoveToXMillis = moveToXMillis; action.MoveToYMillis = moveToYMillis; return(action); }
public static BooleanExpression GreaterThan(IMathExpression leftSide, IMathExpression rightSide) { BooleanExpression expression = new BooleanExpression(); expression.BooleanExpressionType = Type.GreaterThan; expression.MathLeftSide = leftSide; expression.MathRightSide = rightSide; return(expression); }
public static ObjectAction SetParentNumericVariable(string variableName, IMathExpression variableValue) { ObjectAction action = new ObjectAction(); action.ObjectActionType = Type.SetParentNumericVariable; action.SetVariableName = variableName; action.SetNumericVariableValue = variableValue; return(action); }
public static BooleanExpression NotEqual(IMathExpression leftSide, IMathExpression rightSide) { BooleanExpression expression = new BooleanExpression(); expression.BooleanExpressionType = Type.NotEqual; expression.MathLeftSide = leftSide; expression.MathRightSide = rightSide; return(expression); }
public static ObjectAction SpawnBarrageEnemy( IMathExpression xMillis, Dictionary <string, DTDanmakuImage> spriteNameToImageDictionary, Dictionary <string, EnemyObjectTemplate> enemyObjectTemplates, Dictionary <string, DTDanmakuSound> soundNameToSoundDictionary, GuidGenerator guidGenerator) { // Should be called first so it sets the "can shoot" variable that the shootBullet action will need ObjectAction moveAction = GetMoveAndSetCanShootVariableAction( xMillis: xMillis, guidGenerator: guidGenerator); ObjectAction shootAction = GetShootBulletAction( spriteNameToImageDictionary: spriteNameToImageDictionary, enemyObjectTemplates: enemyObjectTemplates, guidGenerator: guidGenerator); ObjectAction destroyAction = ObjectActionGenerator.DestroyWhenHpIsZeroAndMaybeDropPowerUp( chanceToDropPowerUpInMilliPercent: 15 * 1000, spriteNameToImageDictionary: spriteNameToImageDictionary, enemyObjectTemplates: enemyObjectTemplates, soundNameToSoundDictionary: soundNameToSoundDictionary, guidGenerator: guidGenerator); string spriteName = guidGenerator.NextGuid(); spriteNameToImageDictionary.Add(spriteName, DTDanmakuImage.BarrageEnemyShip); List <ObjectBox> damageBoxes = new List <ObjectBox>(); damageBoxes.Add(new ObjectBox(lowerXMillis: -46500, upperXMillis: 46500, lowerYMillis: 0, upperYMillis: 40000)); damageBoxes.Add(new ObjectBox(lowerXMillis: -31500, upperXMillis: 31500, lowerYMillis: -35000, upperYMillis: 30000)); List <ObjectBox> collisionBoxes = new List <ObjectBox>(); collisionBoxes.Add(new ObjectBox(lowerXMillis: -10000, upperXMillis: 10000, lowerYMillis: -25000, upperYMillis: 25000)); collisionBoxes.Add(new ObjectBox(lowerXMillis: -25000, upperXMillis: 25000, lowerYMillis: -10000, upperYMillis: 10000)); EnemyObjectTemplate enemyObjectTemplate = EnemyObjectTemplate.Enemy( action: ObjectAction.Union(moveAction, shootAction, destroyAction), initialMilliHP: MathExpression.Add(MathExpression.Constant(38000), MathExpression.RandomInteger(MathExpression.Constant(10000))), damageBoxes: damageBoxes, collisionBoxes: collisionBoxes, spriteName: spriteName); string templateName = guidGenerator.NextGuid(); enemyObjectTemplates.Add(templateName, enemyObjectTemplate); return(ObjectAction.SpawnChild( childXMillis: MathExpression.Constant(-1000 * 1000), childYMillis: MathExpression.Constant(-1000 * 1000), childObjectTemplateName: templateName, childInitialNumericVariables: null, childInitialBooleanVariables: null)); }
public override void ExportCode(ActionBranch currentAction, ActionBranch nextAction, ILimnorCodeCompiler compiler, IMethodCompile methodToCompile, CodeMemberMethod method, CodeStatementCollection statements, bool debug) { IMathExpression mathExp = MathExp; if (mathExp != null) { CodeExpression ceCondition = null; if (Condition != null) { ceCondition = Condition.ExportCode(methodToCompile); if (ceCondition != null) { ceCondition = CompilerUtil.ConvertToBool(Condition.DataType, ceCondition); } } CodeExpression ce = mathExp.ReturnCodeExpression(methodToCompile); if (ce != null) { CodeExpression target = null; CodeVariableDeclarationStatement output = null; if (nextAction != null) { if (nextAction.UseInput) { output = new CodeVariableDeclarationStatement(currentAction.OutputType.TypeString, currentAction.OutputCodeName, ce); statements.Add(output); } } IVariable v = mathExp.OutputVariable; if (v != null) { CodeStatement cs; target = v.ExportCode(methodToCompile); if (output != null) { cs = new CodeAssignStatement(target, new CodeVariableReferenceExpression(currentAction.OutputCodeName)); } else { cs = new CodeAssignStatement(target, ce); } if (ceCondition == null) { statements.Add(cs); } else { CodeConditionStatement cd = new CodeConditionStatement(); cd.Condition = ceCondition; cd.TrueStatements.Add(cs); statements.Add(cd); } } } } }
public static MathExpressionOffset GetOffset( IMathExpression millipixels, IMathExpression movementDirectionInMillidegrees) { return(new MathExpressionOffset { DeltaXInMillipixels = MathExpression.Divide(MathExpression.Multiply(millipixels, MathExpression.SineScaled(movementDirectionInMillidegrees)), MathExpression.Constant(1000L)), DeltaYInMillipixels = MathExpression.Divide(MathExpression.Multiply(millipixels, MathExpression.CosineScaled(movementDirectionInMillidegrees)), MathExpression.Constant(1000L)) }); }
public static TExpression AsExpressionType <TExpression>(this IMathExpression <TExpression> e) where TExpression : class, IMathExpression <TExpression> { if (e is TExpression ret) { return(ret); } throw new Exception("Expression does not inherit from its generic type parameter TExpression."); }
private static ObjectAction GetShootBulletAction( Dictionary <string, DTDanmakuImage> spriteNameToImageDictionary, Dictionary <string, EnemyObjectTemplate> enemyObjectTemplates, GuidGenerator guidGenerator) { IMathExpression initialShootCooldownInMillis = MathExpression.RandomInteger(2750); IMathExpression shootCooldownInMillis = MathExpression.Add(1750, MathExpression.RandomInteger(1000)); string cooldownVariableName = guidGenerator.NextGuid(); string childObjectTemplateName = guidGenerator.NextGuid(); string enemyBulletSpriteName = guidGenerator.NextGuid(); IMathExpression facingAngleInMillidegrees = DTDanmakuMath.GetMovementDirectionInMillidegrees( currentX: MathExpression.XMillis(), currentY: MathExpression.YMillis(), desiredX: MathExpression.PlayerXMillis(), desiredY: MathExpression.Min(MathExpression.PlayerYMillis(), 300 * 1000)); DTDanmakuMath.MathExpressionOffset deltaXAndY = DTDanmakuMath.GetOffset( millipixels: MathExpression.Constant(40000), movementDirectionInMillidegrees: facingAngleInMillidegrees); ObjectAction initialStartCooldownAction = ObjectAction.SetNumericVariable(cooldownVariableName, initialShootCooldownInMillis); ObjectAction startCooldownAction = ObjectAction.SetNumericVariable(cooldownVariableName, shootCooldownInMillis); ObjectAction decrementCooldownAction = ObjectAction.SetNumericVariable(cooldownVariableName, MathExpression.Subtract(MathExpression.Variable(cooldownVariableName), MathExpression.ElapsedMillisecondsPerIteration())); ObjectAction createBulletAction = ObjectAction.SpawnChild( childXMillis: MathExpression.Add(MathExpression.XMillis(), deltaXAndY.DeltaXInMillipixels), childYMillis: MathExpression.Add(MathExpression.YMillis(), deltaXAndY.DeltaYInMillipixels), childObjectTemplateName: childObjectTemplateName, childInitialNumericVariables: null, childInitialBooleanVariables: null); List <ObjectBox> collisionBoxes = new List <ObjectBox>(); collisionBoxes.Add(new ObjectBox(lowerXMillis: -4000, upperXMillis: 4000, lowerYMillis: -4000, upperYMillis: 4000)); enemyObjectTemplates.Add(childObjectTemplateName, EnemyObjectTemplate.EnemyBullet( action: ObjectAction.Union(GetBulletMovementAction(guidGenerator: guidGenerator), GetBulletAnimationAction(guidGenerator: guidGenerator)), initialMilliHP: null, damageBoxes: null, collisionBoxes: collisionBoxes, spriteName: enemyBulletSpriteName)); spriteNameToImageDictionary.Add(enemyBulletSpriteName, DTDanmakuImage.EliteSniperEnemyBullet); var createBulletWhenCooldownFinishedAction = ObjectAction.Condition( condition: BooleanExpression.LessThanOrEqualTo(MathExpression.Variable(cooldownVariableName), MathExpression.Constant(0)), action: ObjectAction.Union(startCooldownAction, createBulletAction)); return(ObjectAction.ConditionalNextAction( currentAction: initialStartCooldownAction, condition: BooleanExpression.True(), nextAction: ObjectAction.Union(decrementCooldownAction, createBulletWhenCooldownFinishedAction))); }
public static ObjectAction SpawnEliteOrbiterEnemy( IMathExpression xMillis, Dictionary <string, DTDanmakuImage> spriteNameToImageDictionary, Dictionary <string, EnemyObjectTemplate> enemyObjectTemplates, Dictionary <string, DTDanmakuSound> soundNameToSoundDictionary, GuidGenerator guidGenerator) { ObjectAction moveAction = GetMoveAction( xMillis: xMillis); ObjectAction destroyAction = ObjectActionGenerator.DestroyWhenHpIsZeroAndMaybeDropPowerUp( chanceToDropPowerUpInMilliPercent: 15 * 1000, spriteNameToImageDictionary: spriteNameToImageDictionary, enemyObjectTemplates: enemyObjectTemplates, soundNameToSoundDictionary: soundNameToSoundDictionary, guidGenerator: guidGenerator); string spriteName = guidGenerator.NextGuid(); spriteNameToImageDictionary.Add(spriteName, DTDanmakuImage.EliteOrbiterEnemyShip); List <ObjectBox> damageBoxes = new List <ObjectBox>(); damageBoxes.Add(new ObjectBox(lowerXMillis: -68000, upperXMillis: 68000, lowerYMillis: -30000, upperYMillis: 50000)); damageBoxes.Add(new ObjectBox(lowerXMillis: -46000, upperXMillis: 46000, lowerYMillis: -48000, upperYMillis: 68000)); damageBoxes.Add(new ObjectBox(lowerXMillis: -26000, upperXMillis: 26000, lowerYMillis: -68000, upperYMillis: 74000)); List <ObjectBox> collisionBoxes = new List <ObjectBox>(); collisionBoxes.Add(new ObjectBox(lowerXMillis: -58000, upperXMillis: 58000, lowerYMillis: -35000, upperYMillis: 50000)); ObjectAction spawnOrbiterSatellitesAction = GetSpawnOrbiterSatellitesAction( spriteNameToImageDictionary: spriteNameToImageDictionary, enemyObjectTemplates: enemyObjectTemplates, guidGenerator: guidGenerator); EnemyObjectTemplate enemyObjectTemplate = EnemyObjectTemplate.Enemy( action: ObjectAction.Union(moveAction, spawnOrbiterSatellitesAction, destroyAction), initialMilliHP: MathExpression.Add(MathExpression.Constant(45000), MathExpression.RandomInteger(MathExpression.Constant(15000))), damageBoxes: damageBoxes, collisionBoxes: collisionBoxes, spriteName: spriteName); string templateName = guidGenerator.NextGuid(); enemyObjectTemplates.Add(templateName, enemyObjectTemplate); return(ObjectAction.SpawnChild( childXMillis: MathExpression.Constant(-1000 * 1000), childYMillis: MathExpression.Constant(-1000 * 1000), childObjectTemplateName: templateName, childInitialNumericVariables: null, childInitialBooleanVariables: null)); }
public MathOperation(IMathExpression leftOperand, char operationChar, IMathExpression rightOperand) { this.leftOperand = leftOperand; this.operationChar = operationChar; this.rightOperand = rightOperand; }
public ExpressionStackItem(IMathExpression expression) : this(expression, 0, false) { }
public ExpressionStackItem(IMathExpression expression, double value, bool evaluated) { Expression = expression; Value = value; IsEvaluated = evaluated; }
public OperatorStackItem(IMathExpression expression, OperatorPrecedence precedence) { Expression = expression; Precedence = precedence; }