Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/08/16 12:04:25 (8 years ago)
Author:
pkimmesw
Message:

#2665 Set .NET version to 4.5, C# version to 5.0, Added expression templates and factory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Integer/IntegerPushExpression.cs

    r14323 r14328  
    1 using HeuristicLab.Algorithms.PushGP.Stack;
     1using HeuristicLab.Algorithms.PushGP.Interpreter;
    22
    3 namespace HeuristicLab.Algorithms.PushGP.Expressions
     3namespace HeuristicLab.Algorithms.PushGP.Expressions.Integer
    44{
    55    public class IntegerPushExpression : Expression
    66    {
    7         public IntegerPushExpression(long value) : base(OpCode.IntegerPush)
     7        private readonly long value;
     8        public IntegerPushExpression(long value)
    89        {
    9             this.Value = value;
     10            this.value = value;
    1011        }
    1112
    12         public long Value { get; }
     13        public override bool IsCodeOp { get { return false; } }
    1314
    14         public override void Eval(IInterpreterService interpreterService)
     15        public override void Eval(IInterpreter interpreter)
    1516        {
    16             interpreterService.IntegerStack.Push(Value);
     17            interpreter.IntegerStack.Push(this.value);
    1718        }
    1819
    1920        public override string ToString()
    2021        {
    21             return $"{this.Value}";
     22            return this.value.ToString();
    2223        }
    2324    }
Note: See TracChangeset for help on using the changeset viewer.