package seedu.address.logic.commands;

import java.util.HashSet;
import java.util.Set;

import seedu.address.commons.exceptions.IllegalValueException;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.person.Name;
import seedu.address.model.person.Task;
import seedu.address.model.person.UniquePersonList;
import seedu.address.model.tag.Tag;
import seedu.address.model.tag.UniqueTagList;

/**
 * Adds a person to the address book.
 */
public class AddCommand extends Command {

    public static final String COMMAND_WORD = "add";

    public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a person to the address book. "
            + "Parameters: NAME p/PHONE e/EMAIL a/ADDRESS  [t/TAG]...\n"
            + "Example: " + COMMAND_WORD
            + " John Doe p/98765432 e/johnd@gmail.com a/311, Clementi Ave 2, #02-25 t/friends t/owesMoney";

    public static final String MESSAGE_SUCCESS = "New person added: %1$s";
    public static final String MESSAGE_DUPLICATE_PERSON = "This person already exists in the address book";

    private final Task toAdd;

    /**
     * Creates an AddCommand using raw values.
     *
     * @throws IllegalValueException if any of the raw values are invalid
     */
    public AddCommand(String name, Set<String> tags)
            throws IllegalValueException {
        final Set<Tag> tagSet = new HashSet<>();
        for (String tagName : tags) {
            tagSet.add(new Tag(tagName));
        }
        this.toAdd = new Task(
                new Name(name),
                new UniqueTagList(tagSet)
        );
    }

    @Override
    public CommandResult execute() throws CommandException {
        assert model != null;
        try {
            model.addPerson(toAdd);
            return new CommandResult(String.format(MESSAGE_SUCCESS, toAdd));
        } catch (UniquePersonList.DuplicatePersonException e) {
            throw new CommandException(MESSAGE_DUPLICATE_PERSON);
        }

    }

}

@@ -434,38 +434,36 @@
 *%0A * Adds a 
-person
+task
  to the 
 address book
@@ -450,28 +450,25 @@
  to the 
-address book
+task list
 .%0A */%0Apu
@@ -638,22 +638,20 @@
 s a 
-person
+task
  to the 
 addr
@@ -646,28 +646,25 @@
  to the 
-address book
+task list
 . %22%0A    
@@ -695,34 +695,8 @@
 AME 
-p/PHONE e/EMAIL a/ADDRESS 
  %5Bt/
@@ -767,97 +767,21 @@
 + %22 
-John Doe p/98765432 e/johnd@gmail.com a/311, Clementi Ave 2, #02-25 t/friends t/owesMoney
+exam t/CS2010
 %22;%0A%0A
@@ -834,22 +834,20 @@
  = %22New 
-person
+task
  added: 
@@ -917,22 +917,20 @@
 = %22This 
-person
+task
  already
@@ -948,20 +948,17 @@
 the 
-address book
+task list
 %22;%0A%0A

Update AddCommand strings