diff --git a/src/main/java/seedu/address/model/project/Project.java b/src/main/java/seedu/address/model/project/Project.java index 07c53364b15..daf65beb4b0 100644 --- a/src/main/java/seedu/address/model/project/Project.java +++ b/src/main/java/seedu/address/model/project/Project.java @@ -150,6 +150,10 @@ public void assignTeam(List team) { this.team = team; } + public void setComment(List comments) { + this.comments = comments; + } + /** * Sets the task status as complete */ @@ -285,6 +289,17 @@ public void addComment(Comment comment) { public Project createEditedProject(Name newName) { List newTaskList = new ArrayList<>(this.taskList); Project newProject = new Project(newName, newTaskList); + newProject.setDeadline(this.deadlineDate); + newProject.setCategory(this.category); + newProject.assignTeam(this.team); + newProject.setComment(this.comments); + + if (this.isCompleted()) { + newProject.setComplete(); + } else { + newProject.setIncomplete(); + } + return newProject; }