[AY1920S1-CS2113-T09-1] Hustler#91
[AY1920S1-CS2113-T09-1] Hustler#91yzia2000 wants to merge 808 commits intonusCS2113-AY1920S1:masterfrom
Conversation
seanieyap
left a comment
There was a problem hiding this comment.
Overall good job. Just some coding quality issues like magic numbers and commenting issues.
| taskType = "deadline"; | ||
| break; |
| taskType = "event"; | ||
| break; |
| ui.show_message("/" + timeCommand + " is an invalid addition to /add"); | ||
| return; |
|
|
||
| Hustler.saveStorage(); | ||
| } catch (CommandLineException | IOException e) { | ||
|
|
| public class CommandLog { | ||
|
|
||
| private static ArrayList<String> commandlog; | ||
| private static boolean isRestoring = false; | ||
|
|
||
| public CommandLog() { | ||
| commandlog = new ArrayList<String>(); | ||
| } | ||
|
|
||
| public static void recordCommand(String command) { | ||
| commandlog.add(command); | ||
| } | ||
|
|
||
| public static void restoreData(int numberOfCommandsToUndo) { | ||
| isRestoring = true; | ||
| int restoreDataUntil = commandlog.size() - numberOfCommandsToUndo; | ||
|
|
||
| if (restoreDataUntil >= 0) { | ||
| for (int i = 0; i < restoreDataUntil; i++) { | ||
| try { | ||
| CommandParser parser = new CommandParser(); | ||
|
|
||
| Command command = parser.parse(commandlog.get(i)); | ||
| command.execute(); | ||
|
|
||
| Hustler.saveStorage(); | ||
| } catch (CommandLineException | IOException e) { | ||
|
|
||
| } | ||
| } | ||
|
|
||
| while (commandlog.size() > restoreDataUntil) { | ||
| commandlog.remove(restoreDataUntil); | ||
| } | ||
| } else { | ||
| System.out.println("Error! You are attempting to undo more commands than is possible!"); | ||
| } | ||
| isRestoring = false; | ||
| } | ||
|
|
||
| public static boolean isRestoring() { | ||
| return isRestoring; | ||
| } |
There was a problem hiding this comment.
Missing header comments. All non trivial methods should have javadoc format header comments. You have done so for the rest of the classes but not here.
| suffix = "st"; | ||
| break; |
| /** | ||
| * Reminder list that contains tasks that are overdue. | ||
| */ | ||
| private static ArrayList<Task> overDueList = new ArrayList<>(); | ||
| /** | ||
| * Reminder list that contain tasks with less than 30 minutes or less till deadline. | ||
| */ | ||
| private static ArrayList<Task> lastDayList = new ArrayList<>(); | ||
| /** | ||
| * Reminder list htat contain tasks with less than 24 hours or less till deadline. | ||
| */ | ||
| private static ArrayList<Task> lastThirtyMinutesList = new ArrayList<>(); | ||
| /** | ||
| * 24 hours converted to seconds. | ||
| */ | ||
| private static final int TWENTY_FOUR_HOURS = 86400; | ||
| /** | ||
| * 30 minutes converted to seconds. | ||
| */ | ||
| private static final int THIRTY_MINUTES = 1800; |
There was a problem hiding this comment.
New lines should seperate these since they have comments
| if (!done && checkDeadline || checkEvent || checkRange) { | ||
| if (checkOverdue(i)) { | ||
| overDueList.add(list.get(i)); | ||
| } | ||
| } |
There was a problem hiding this comment.
These two if statements can be combined into one.
| public static void displayReminders() { | ||
| if (!overDueList.isEmpty()) { | ||
| if (overDueList.size() == 1) { | ||
| System.out.println("\t_____________________________________"); |
There was a problem hiding this comment.
These lines can be saved into some variable since they are used so many times. Also to avoid "magic strings"; if you need to change these in the future, it would be a hassle to do so to all of them.
| this.tag.toString() + " " + | ||
| this.getDescription(); |
|
Please code this PR after reading my comments. |
Fixed null pointer exception
# Conflicts: # src/main/java/seedu/hustler/game/avatar/Inventory.java # src/main/java/seedu/hustler/logic/command/avatar/CheckAvatarCommand.java # src/main/java/seedu/hustler/logic/parser/anomaly/AddCommandAnomaly.java
Rename statusTypes.java to StatusTypes.java
… into branch-Achievements
Fixed small checkstyle error
TaskStorageTest fix
… into branch-Achievements
undo fixes
Fixed checkstyle errors for JUNIT testing
[AY1920S1-CS2113T-T09-1]-jingkang97-Fixed checkstyle for reminders
Fixed reminders checkstyle
fixed comments
final checkstyle fix
fixed checkstyle
Fixed Recommended Schedule bug for test cases
@ngjiewu
@nystera
@jingkang97
@EnriqueKhai
@yzia2000