package seedu.todo.controllers;

import seedu.todo.models.TodoListDB;
import seedu.todo.ui.UiManager;
import seedu.todo.ui.views.IndexView;

public class ListController implements Controller {
    
    private static String NAME = "List";
    private static String DESCRIPTION = "Lists all tasks and events.";
    private static String COMMAND_SYNTAX = "list";
    
    private static CommandDefinition commandDefinition =
            new CommandDefinition(NAME, DESCRIPTION, COMMAND_SYNTAX); 

    public static CommandDefinition getCommandDefinition() {
        return commandDefinition;
    }

    @Override
    public float inputConfidence(String input) {
        return (input.startsWith("list")) ? 1 : 0;
    }

    @Override
    public void process(String input) {
        TodoListDB db = TodoListDB.getInstance();
        
        IndexView view = UiManager.loadView(IndexView.class);
        view.tasks = db.getAllTasks();
        view.events = db.getAllEvents();
        UiManager.renderView(view);
    }

}

@@ -355,24 +355,130 @@
 list%22;%0A    %0A
+    private static final String MESSAGE_LISTING_WHAT = %22Listing a total of %25d tasks and %25d events.%22;%0A    %0A
     private 
@@ -522,16 +522,16 @@
 ition =%0A
-
         
@@ -926,24 +926,42 @@
 );%0A        %0A
+        // Render%0A
         Inde
@@ -1086,24 +1086,24 @@
 llEvents();%0A
-
         UiMa
@@ -1125,16 +1125,215 @@
 w(view);
+%0A%0A        // Update console message%0A        String consoleMessage = String.format(MESSAGE_LISTING_WHAT, view.tasks.size(), view.events.size());%0A        UiManager.updateConsoleMessage(consoleMessage);
 %0A    %7D%0A%0A

Add ListController console message