From 3cb58ca6b115782e0c1e07cf36c836b219b6fc4e Mon Sep 17 00:00:00 2001 From: Lukasz Baldyga Date: Wed, 2 Dec 2020 23:11:16 +0000 Subject: [PATCH] Implemented non implemented methods --- .../Verbs/Flow/MethodChunk.cs | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Advanced Software Engineering/Advanced Software Engineering/Verbs/Flow/MethodChunk.cs b/Advanced Software Engineering/Advanced Software Engineering/Verbs/Flow/MethodChunk.cs index 2443090..ea93969 100644 --- a/Advanced Software Engineering/Advanced Software Engineering/Verbs/Flow/MethodChunk.cs +++ b/Advanced Software Engineering/Advanced Software Engineering/Verbs/Flow/MethodChunk.cs @@ -6,45 +6,49 @@ namespace Advanced_Software_Engineering.Verbs.Flow { public class MethodChunk : VerbChunk, IVerb, IValue { ValueStorage valueStorage; - VariableValue[] variableValues; + bool init = false; - public MethodChunk(VariableValue[] variableValues, ValueStorage valueStorage) : base() { + public MethodChunk(ValueStorage valueStorage) : base() { this.valueStorage = valueStorage; - this.variableValues = variableValues; } public new void ExecuteVerb() { valueStorage.IncreaseStack(); base.ExecuteVerb(); valueStorage.DecreaseStack(); + init = true; + } + + public IValue GetResult() { + return valueStorage.GetVariable("res"); } public IValue Clone() { - throw new System.NotImplementedException(); + return GetResult().Clone(); } public string GetOriginalType() { - throw new System.NotImplementedException(); + return GetResult().GetOriginalType(); } public bool isInitialised() { - throw new System.NotImplementedException(); + return init; } public bool ToBool() { - throw new System.NotImplementedException(); + return GetResult().ToBool(); } public Color ToColor() { - throw new System.NotImplementedException(); + return GetResult().ToColor(); } public double ToDouble() { - throw new System.NotImplementedException(); + return GetResult().ToDouble(); } public int ToInt() { - throw new System.NotImplementedException(); + return GetResult().ToInt(); } } }