Private
Public Access
Added Variable Values
This commit is contained in:
1 parent
3a979f8faa
commit
e0ff2ab464
2 files changed
+28
-15
No files matched your search
+5
-2
@@ -89,7 +89,7 @@
|
|||||||
<Compile Include="Verbs\DrawingVerbs\ResetPen.cs" />
|
<Compile Include="Verbs\DrawingVerbs\ResetPen.cs" />
|
||||||
<Compile Include="Verbs\DrawingVerbs\Square.cs" />
|
<Compile Include="Verbs\DrawingVerbs\Square.cs" />
|
||||||
<Compile Include="Verbs\DrawingVerbs\Triangle.cs" />
|
<Compile Include="Verbs\DrawingVerbs\Triangle.cs" />
|
||||||
<Compile Include="Verbs\Value\Expression.cs" />
|
<Compile Include="Verbs\Value\ValueTypes\ExpressionValue.cs" />
|
||||||
<Compile Include="Verbs\Value\DeclareVariable.cs" />
|
<Compile Include="Verbs\Value\DeclareVariable.cs" />
|
||||||
<Compile Include="Verbs\Value\UpdateVariable.cs" />
|
<Compile Include="Verbs\Value\UpdateVariable.cs" />
|
||||||
<Compile Include="Verbs\Value\ValueFactory.cs" />
|
<Compile Include="Verbs\Value\ValueFactory.cs" />
|
||||||
@@ -100,6 +100,7 @@
|
|||||||
<Compile Include="Verbs\Value\ValueTypes\ColorValue.cs" />
|
<Compile Include="Verbs\Value\ValueTypes\ColorValue.cs" />
|
||||||
<Compile Include="Verbs\Value\ValueTypes\DoubleValue.cs" />
|
<Compile Include="Verbs\Value\ValueTypes\DoubleValue.cs" />
|
||||||
<Compile Include="Verbs\Value\ValueTypes\IntValue.cs" />
|
<Compile Include="Verbs\Value\ValueTypes\IntValue.cs" />
|
||||||
|
<Compile Include="Verbs\Value\ValueTypes\VariableValue.cs" />
|
||||||
<Compile Include="Windows\AboutWindow.cs">
|
<Compile Include="Windows\AboutWindow.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -207,6 +208,8 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Resources\logo.ico" />
|
<Content Include="Resources\logo.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
<ItemGroup>
|
||||||
|
<Folder Include="Exceptions\" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
+23
-13
@@ -1,38 +1,48 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Advanced_Software_Engineering.Verbs.Value.ValueTypes {
|
namespace Advanced_Software_Engineering.Verbs.Value.ValueTypes {
|
||||||
class VariableValue : IValue {
|
|
||||||
|
public class VariableValue : IValue {
|
||||||
|
private Drawer drawer;
|
||||||
|
private string variableName;
|
||||||
|
|
||||||
|
public VariableValue(Drawer drawer, string variableName) {
|
||||||
|
this.variableName = variableName;
|
||||||
|
if (!drawer.CheckVariableExists(variableName)) throw new Exception("Tried to access " + variableName + " before it was assigned. ");
|
||||||
|
this.drawer = drawer;
|
||||||
|
}
|
||||||
|
|
||||||
|
private IValue get() {
|
||||||
|
return drawer.GetVariable(variableName);
|
||||||
|
}
|
||||||
|
|
||||||
public string GetDescription() {
|
public string GetDescription() {
|
||||||
throw new NotImplementedException();
|
return get().GetDescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetOriginalType() {
|
public string GetOriginalType() {
|
||||||
throw new NotImplementedException();
|
return get().GetOriginalType();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool isInitialised() {
|
public bool isInitialised() {
|
||||||
throw new NotImplementedException();
|
return get().isInitialised();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ToBool() {
|
public bool ToBool() {
|
||||||
throw new NotImplementedException();
|
return get().ToBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Color ToColor() {
|
public Color ToColor() {
|
||||||
throw new NotImplementedException();
|
return get().ToColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double ToDouble() {
|
public double ToDouble() {
|
||||||
throw new NotImplementedException();
|
return get().ToDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int ToInt() {
|
public int ToInt() {
|
||||||
throw new NotImplementedException();
|
return get().ToInt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user