Skip to content

Commit

Permalink
Refactor methods to be PascalCase, make constructors public
Browse files Browse the repository at this point in the history
  • Loading branch information
lenalinke committed Apr 14, 2024
1 parent 3567b38 commit 4aca875
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ namespace i5.VirtualAgents
/// </summary>
public class TaskBundle : ITask
{
TaskBundle()
public TaskBundle()
{
TaskState State = TaskState.Waiting;
taskQueue = new List<IAgentTask>();
}

TaskBundle(List<IAgentTask> tasks)
public TaskBundle(List<IAgentTask> tasks)
{
TaskState State = TaskState.Waiting;
taskQueue = tasks;
}

TaskBundle(List<IAgentTask> tasks, List<bool> preconditions)
public TaskBundle(List<IAgentTask> tasks, List<bool> preconditions)
{
TaskState State = TaskState.Waiting;
taskQueue = tasks;
Expand Down Expand Up @@ -53,9 +53,9 @@ public TaskState EvaluateTaskState()
public void StartExecution(Agent executingAgent)
{
State = TaskState.Running;
if (checkPreconditions())
if (CheckPreconditions())
{
executeTasks(executingAgent);
ExecuteTasks(executingAgent);
}

State = TaskState.Success;
Expand All @@ -66,7 +66,7 @@ public void StartExecution(Agent executingAgent)
/// Execute all tasks in the task queue. If a task fails, the whole bundle fails. Note, that checking of preconditions is not part of this method.
/// </summary>
/// <param name="executingAgent"></param>
private void executeTasks(Agent executingAgent)
private void ExecuteTasks(Agent executingAgent)
{
foreach (IAgentTask task in taskQueue)
{
Expand All @@ -91,7 +91,7 @@ private void executeTasks(Agent executingAgent)
/// Check if all preconditions are met.
/// </summary>
/// <returns> True if all preconditions evaluate to true, otherwise false. </returns>
private bool checkPreconditions()
private bool CheckPreconditions()
{
foreach (bool condition in preconditions)
{
Expand Down

0 comments on commit 4aca875

Please sign in to comment.