From 4aca8750ea9f3f01e13336465cc08d918ea24b71 Mon Sep 17 00:00:00 2001 From: Lena Linke <130255332+lenalinke@users.noreply.github.com> Date: Mon, 15 Apr 2024 01:23:50 +0200 Subject: [PATCH] Refactor methods to be PascalCase, make constructors public --- .../Scripts/ScheduleBasedExecution/TaskBundle.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Assets/Virtual Agents Framework/Runtime/Scripts/ScheduleBasedExecution/TaskBundle.cs b/Assets/Virtual Agents Framework/Runtime/Scripts/ScheduleBasedExecution/TaskBundle.cs index 8c9e59a..51c1925 100644 --- a/Assets/Virtual Agents Framework/Runtime/Scripts/ScheduleBasedExecution/TaskBundle.cs +++ b/Assets/Virtual Agents Framework/Runtime/Scripts/ScheduleBasedExecution/TaskBundle.cs @@ -11,19 +11,19 @@ namespace i5.VirtualAgents /// public class TaskBundle : ITask { - TaskBundle() + public TaskBundle() { TaskState State = TaskState.Waiting; taskQueue = new List(); } - TaskBundle(List tasks) + public TaskBundle(List tasks) { TaskState State = TaskState.Waiting; taskQueue = tasks; } - TaskBundle(List tasks, List preconditions) + public TaskBundle(List tasks, List preconditions) { TaskState State = TaskState.Waiting; taskQueue = tasks; @@ -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; @@ -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. /// /// - private void executeTasks(Agent executingAgent) + private void ExecuteTasks(Agent executingAgent) { foreach (IAgentTask task in taskQueue) { @@ -91,7 +91,7 @@ private void executeTasks(Agent executingAgent) /// Check if all preconditions are met. /// /// True if all preconditions evaluate to true, otherwise false. - private bool checkPreconditions() + private bool CheckPreconditions() { foreach (bool condition in preconditions) {