Created IfChunk

This commit is contained in:
Lukasz Baldyga committed 2020-11-30 09:29:23 +00:00
1 parent 17b05c827a
commit 1d9fed93a1
2 files changed
+13 -2

No files matched your search

@@ -91,6 +91,7 @@
<Compile Include="Verbs\DrawingVerbs\Actions\ResetPen.cs" /> <Compile Include="Verbs\DrawingVerbs\Actions\ResetPen.cs" />
<Compile Include="Verbs\DrawingVerbs\Shape\Square.cs" /> <Compile Include="Verbs\DrawingVerbs\Shape\Square.cs" />
<Compile Include="Verbs\DrawingVerbs\Shape\Triangle.cs" /> <Compile Include="Verbs\DrawingVerbs\Shape\Triangle.cs" />
<Compile Include="Verbs\Flow\IfChunk.cs" />
<Compile Include="Verbs\Value\ValueObjects\PointValue.cs" /> <Compile Include="Verbs\Value\ValueObjects\PointValue.cs" />
<Compile Include="Verbs\Value\ValueStorage.cs" /> <Compile Include="Verbs\Value\ValueStorage.cs" />
<Compile Include="Verbs\Value\ValueTypes\ComparisonValue.cs" /> <Compile Include="Verbs\Value\ValueTypes\ComparisonValue.cs" />
@@ -1,7 +1,17 @@
namespace Advanced_Software_Engineering.Verbs.Flow { using Advanced_Software_Engineering.Verbs.Value;
class IfChunk : VerbChunk, IVerb {
namespace Advanced_Software_Engineering.Verbs.Flow {
public class IfChunk : VerbChunk, IVerb {
IValue conditional;
public IfChunk(IValue conditional) : base() {
this.conditional = conditional;
}
public void ExecuteVerb() {
if (conditional.ToBool()) base.ExecuteVerb();
}
} }
} }