package seedu.taskitty.logic.commands;

import seedu.taskitty.commons.core.Messages;
import seedu.taskitty.commons.core.UnmodifiableObservableList;
import seedu.taskitty.model.task.ReadOnlyTask;
import seedu.taskitty.model.task.UniqueTaskList.TaskNotFoundException;

/**
 * Deletes a person identified using it's last displayed index from the address book.
 */
public class DeleteCommand extends Command {

    public static final String COMMAND_WORD = "delete";

    public static final String MESSAGE_USAGE = COMMAND_WORD
            + ": Deletes the task identified by the index number used in the last task listing.\n"
            + "Parameters: INDEX (must be a positive integer)\n"
            + "Example: " + COMMAND_WORD + " 1";

    public static final String MESSAGE_DELETE_TASK_SUCCESS = "Deleted Task: %1$s";

    public final int targetIndex;

    public DeleteCommand(int targetIndex) {
        this.targetIndex = targetIndex;
    }


    @Override
    public CommandResult execute() {

        UnmodifiableObservableList<ReadOnlyTask> lastShownList = model.getFilteredTaskList();
        if (lastShownList.size() < targetIndex) {
            indicateAttemptToExecuteIncorrectCommand();
            return new CommandResult(Messages.MESSAGE_INVALID_TASK_DISPLAYED_INDEX);
        }

        ReadOnlyTask taskToDelete = lastShownList.get(targetIndex - 1);

        try {
            model.deleteTask(taskToDelete);
        } catch (TaskNotFoundException pnfe) {
            assert false : "The target task cannot be missing";
        }

        return new CommandResult(String.format(MESSAGE_DELETE_TASK_SUCCESS, taskToDelete));
    }

}

@@ -455,16 +455,209 @@
 delete%22;
+%0A    %0A    public static final String CATEGORY_CHARS = %22t%7Cd%7Ce%22;%0A    %0A    public static final int TODO_INDEX = 0;%0A    %0A    public static final String%5B%5D CATEGORIES = %7B%22Todo%22, %22Deadline%22, %22Event%22%7D;
 %0A%0A    pu
@@ -762,16 +762,39 @@
  by the 
+category character and 
 index nu
@@ -858,16 +858,54 @@
 ameters:
+ CATEGORY(default to 't' if not given)
  INDEX (
@@ -979,16 +979,39 @@
 WORD + %22
+ %22 + CATEGORY_CHARS + %22
  1%22;%0A%0A  
@@ -1081,22 +1081,72 @@
 eted
- Task: %251
+%22 + %22 %251$s: %252
 $s%22;%0A
+    %0A    public final int categoryIndex;%0A    
 %0A   
@@ -1176,16 +1176,20 @@
 tIndex;%0A
+    
 %0A    pub
@@ -1237,33 +1237,247 @@
     
-this.targetIndex = target
+// default to Todo category if no given category%0A        this(targetIndex, TODO_INDEX);%0A    %7D%0A    %0A    public DeleteCommand(int targetIndex, int categoryIndex) %7B%0A        this.targetIndex = targetIndex;%0A        this.categoryIndex = category
 Inde
@@ -1538,16 +1538,71 @@
 ute() %7B%0A
+        assert categoryIndex %3E= 0 && categoryIndex %3C 3;
 %0A       
@@ -2218,16 +2218,43 @@
 SUCCESS,
+ CATEGORIES%5BcategoryIndex%5D,
  taskToD

Update DeleteCommand to accept addition parameter for different cateogires