-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathGoalInspector.java
More file actions
26 lines (26 loc) · 968 Bytes
/
GoalInspector.java
File metadata and controls
26 lines (26 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.mkpro;
import com.mkpro.models.Goal;
import java.util.List;
import java.nio.file.Paths;
public class GoalInspector {
public static void main(String[] args) {
CentralMemory memory = new CentralMemory();
String projectPath = Paths.get("").toAbsolutePath().toString();
System.out.println("Project Path: " + projectPath);
List<Goal> goals = memory.getGoals(projectPath);
if (goals.isEmpty()) {
System.out.println("No goals found.");
} else {
for (Goal goal : goals) {
printGoal(goal, 0);
}
}
}
private static void printGoal(Goal goal, int depth) {
String indent = " ".repeat(depth);
System.out.println(indent + "- [" + goal.getStatus() + "] " + goal.getDescription());
for (Goal sub : goal.getSubGoals()) {
printGoal(sub, depth + 1);
}
}
}