Skip to content

Commit

Permalink
Merge pull request #220 from nicholasyeo/master
Browse files Browse the repository at this point in the history
Add sample data
  • Loading branch information
khor-jingqian authored Nov 9, 2020
2 parents bc1cafb + 384a623 commit 62303c6
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
4 changes: 4 additions & 0 deletions docs/team/nicholasyeo.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ convenience and utility in the long-run. Aimed at NUS students who are keen on i
the perfect solution in which the Graphical User Interface is integrated with Command Line Interface to provide a
wholesome user experience.

<div style="page-break-after: always;"></div>

## Summary of Contributions

* **New Feature**: Added Timetable and Slot classes together with their relevant implementations.
Expand Down Expand Up @@ -64,6 +66,8 @@ wholesome user experience.
* Fixed the case-sensitive issues of allowing duplicate Routine, Exercise or Lesson to be added into fitNUS.
Fixed the issue of having too long names by restricting it to maximum of 50 characters. [#187](https://github.com/AY2021S1-CS2103T-T09-2/tp/pull/187)

<div style="page-break-after: always;"></div>

## Contributions to the team-based tasks:

* Contributed to the planning and designing of the display and layout of fitNUS.
Expand Down
40 changes: 34 additions & 6 deletions src/main/java/seedu/address/model/util/SampleDataUtil.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package seedu.address.model.util;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;

import seedu.address.model.FitNus;
import seedu.address.model.ReadOnlyFitNus;
import seedu.address.model.exercise.Exercise;
import seedu.address.model.lesson.Lesson;
import seedu.address.model.routine.Routine;
import seedu.address.model.tag.Tag;

/**
Expand All @@ -15,12 +18,28 @@
public class SampleDataUtil {
public static Lesson[] getSampleLessons() {
return new Lesson[] {
new Lesson(new Name("GER1000"), getTagSet("easy")),
new Lesson(new Name("GEQ2000"), getTagSet("chill", "webcasted")),
new Lesson(new Name("GEH3000"), getTagSet("hard")),
new Lesson(new Name("GET4000"), getTagSet("priority")),
new Lesson(new Name("GES5000"), getTagSet("fun")),
new Lesson(new Name("GEX6000"), getTagSet("hard"))
new Lesson(new Name("MA1101R"), getTagSet("easy")),
new Lesson(new Name("MA1102R"), getTagSet("chill", "webcast")),
new Lesson(new Name("CS2103T"), getTagSet("project")),
new Lesson(new Name("CS2100"), getTagSet("priority")),
new Lesson(new Name("CS3243"), getTagSet("fun")),
new Lesson(new Name("CS3244"), getTagSet("hard"))
};
}

public static Routine[] getSampleRoutines() {
return new Routine[] {
new Routine(new Name("Leg Day")),
new Routine(new Name("Upper Body Workout")),
new Routine(new Name("Arm Routine"))
};
}

public static Exercise[] getSampleExercise() {
return new Exercise[] {
new Exercise(new Name("Bench Press"), new HashSet<>()),
new Exercise(new Name("Shoulder Press"), new HashSet<>()),
new Exercise(new Name("Squats"), new HashSet<>())
};
}

Expand All @@ -29,6 +48,15 @@ public static ReadOnlyFitNus getSampleFitNus() {
for (Lesson sampleLesson : getSampleLessons()) {
sampleFitNus.addLesson(sampleLesson);
}

for (Exercise sampleExercise : getSampleExercise()) {
sampleFitNus.addExercise(sampleExercise);
}

for (Routine sampleRoutine : getSampleRoutines()) {
sampleFitNus.addRoutine(sampleRoutine);
}

return sampleFitNus;
}

Expand Down

0 comments on commit 62303c6

Please sign in to comment.