forked from nusCS2113-AY1819S2/addressbook-level3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nusCS2113-AY1819S2#47 from yingrong1996/ForPrject
Code edited to fit code style (Done)
- Loading branch information
Showing
76 changed files
with
843 additions
and
638 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,33 @@ | ||
package seedu.addressbook.commands; | ||
|
||
import seedu.addressbook.data.exception.IllegalValueException; | ||
import seedu.addressbook.data.person.*; | ||
import seedu.addressbook.data.tag.Tag; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
import seedu.addressbook.data.exception.IllegalValueException; | ||
import seedu.addressbook.data.player.Address; | ||
import seedu.addressbook.data.player.Email; | ||
import seedu.addressbook.data.player.Name; | ||
import seedu.addressbook.data.player.Person; | ||
import seedu.addressbook.data.player.Phone; | ||
import seedu.addressbook.data.player.ReadOnlyPerson; | ||
import seedu.addressbook.data.player.UniquePersonList; | ||
import seedu.addressbook.data.tag.Tag; | ||
|
||
/** | ||
* Adds a person to the address book. | ||
* Adds a player to the address book. | ||
*/ | ||
public class AddCommand extends Command { | ||
|
||
public static final String COMMAND_WORD = "add"; | ||
|
||
public static final String MESSAGE_USAGE = COMMAND_WORD + ":\n" + "Adds a person to the address book. " | ||
public static final String MESSAGE_USAGE = COMMAND_WORD + ":\n" + "Adds a player to the address book. " | ||
+ "Contact details can be marked private by prepending 'p' to the prefix.\n\t" | ||
+ "Parameters: NAME [p]p/PHONE [p]e/EMAIL [p]a/ADDRESS [t/TAG]...\n\t" | ||
+ "Example: " + COMMAND_WORD | ||
+ " John Doe p/98765432 e/[email protected] 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"; | ||
public static final String MESSAGE_SUCCESS = "New player added: %1$s"; | ||
public static final String MESSAGE_DUPLICATE_PERSON = "This player already exists in the address book"; | ||
|
||
private final Person toAdd; | ||
|
||
|
@@ -48,7 +54,9 @@ public AddCommand(String name, | |
); | ||
} | ||
|
||
public AddCommand(Person toAdd) { this.toAdd = toAdd; } | ||
public AddCommand(Person toAdd) { | ||
this.toAdd = toAdd; | ||
} | ||
|
||
public ReadOnlyPerson getPerson() { | ||
return toAdd; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.