From ed73c47d591ddaca19028b758be2a2d991a5f944 Mon Sep 17 00:00:00 2001 From: Lukasz Baldyga Date: Fri, 4 Dec 2020 17:10:59 +0000 Subject: [PATCH] Documented ForChunk --- .../Verbs/Flow/ForChunk.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Advanced Software Engineering/Advanced Software Engineering/Verbs/Flow/ForChunk.cs b/Advanced Software Engineering/Advanced Software Engineering/Verbs/Flow/ForChunk.cs index 7373b44..c113a6a 100644 --- a/Advanced Software Engineering/Advanced Software Engineering/Verbs/Flow/ForChunk.cs +++ b/Advanced Software Engineering/Advanced Software Engineering/Verbs/Flow/ForChunk.cs @@ -2,22 +2,39 @@ using System.Collections.Generic; namespace Advanced_Software_Engineering.Verbs.Flow { + /// + /// A ForChunk is similar to a . It executes a specific number of times. + /// public class ForChunk : VerbChunk, IVerbChunk, IVerb { private readonly IValue conditional; private readonly ValueStorage valueStorage; + /// + /// A For Loop object + /// + /// The ValueStorage for increasing and decreasing the stack + /// Preferably , the number of times the loop should execute. public ForChunk(ValueStorage valueStorage, IValue conditional) : base() { this.conditional = conditional; this.valueStorage = valueStorage; valueStorage.IncreaseStack(); } + /// + /// A For Loop object + /// + /// The ValueStorage for increasing and decreasing the stack + /// Preferably , the number of times the loop should execute. + /// A verb to execute in a single line public ForChunk(ValueStorage valueStorage, IValue conditional, IVerb oneLineVerb) : base(new List { oneLineVerb }) { this.conditional = conditional; this.valueStorage = valueStorage; valueStorage.IncreaseStack(); } + /// + /// Executes the chunk the number of specified times + /// public new void ExecuteVerb() { int iterations = conditional.ToInt();