Skip to content

Commit

Permalink
Merge pull request #179
Browse files Browse the repository at this point in the history
Make sample data consistent with command behavior
  • Loading branch information
JJtan2002 authored Oct 28, 2024
2 parents 671b5c1 + 9ab9b32 commit 3de8afe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public static Game parseGame(String game) throws ParseException {
if (!Game.isValidGameName(trimmedGame)) {
throw new ParseException(Game.MESSAGE_CONSTRAINTS);
}
return new Game(trimmedGame, new Username(""), new SkillLevel(""), new Role(""), false);
return new Game(trimmedGame);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/model/game/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public Game(String gameName) {
requireNonNull(gameName);
checkArgument(isValidGameName(gameName), MESSAGE_CONSTRAINTS);
this.gameName = gameName;
this.username = null;
this.skillLevel = null;
this.role = null;
this.username = new Username("");
this.skillLevel = new SkillLevel("");
this.role = new Role("");
this.isFavourite = false;
}

Expand Down
15 changes: 7 additions & 8 deletions src/main/java/seedu/address/model/util/SampleDataUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class SampleDataUtil {
public static Person[] getSamplePersons() {
Game sampleGame = new Game("LoL",
new Username("LeagueGamer"), new SkillLevel("bad"), new Role("Support"), false);
new Username("LeagueGamer"), new SkillLevel("Diamond"), new Role("Support"), false);
HashMap<String, Game> sample = new HashMap<String, Game>();
sample.put("LoL", sampleGame);
return new Person[] {
Expand All @@ -37,23 +37,23 @@ public static Person[] getSamplePersons() {
getPreferredTimeSet("2100-2200")),
new Person(new Name("Bernice Yu"), new Phone("99272758"), new Email("[email protected]"),
new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"),
getTagSet("colleagues", "friends"), getGameMap("LoL"),
getTagSet("colleagues", "friends"), getGameMap("LoL", "Overwatch"),
getPreferredTimeSet("2030-2130")),
new Person(new Name("Charlotte Oliveiro"), new Phone("93210283"), new Email("[email protected]"),
new Address("Blk 11 Ang Mo Kio Street 74, #11-04"),
getTagSet("neighbours"), getGameMap("LoL"),
getTagSet("neighbours"), getGameMap("DOTA2"),
getPreferredTimeSet("1900-2100")),
new Person(new Name("David Li"), new Phone("91031282"), new Email("[email protected]"),
new Address("Blk 436 Serangoon Gardens Street 26, #16-43"),
getTagSet("family"), getGameMap("LoL"),
getTagSet("family"), getGameMap("Genshin Impact"),
getPreferredTimeSet("2100-2130", "1900-2030")),
new Person(new Name("Irfan Ibrahim"), new Phone("92492021"), new Email("[email protected]"),
new Address("Blk 47 Tampines Street 20, #17-35"),
getTagSet("classmates"), getGameMap("LoL"),
getTagSet("classmates"), getGameMap("Honkai Star Rail"),
getPreferredTimeSet("1800-2000")),
new Person(new Name("Roy Balakrishnan"), new Phone("92624417"), new Email("[email protected]"),
new Address("Blk 45 Aljunied Street 85, #11-31"),
getTagSet("colleagues"), getGameMap("LoL"),
getTagSet("colleagues"), getGameMap("Honkai Star Rail"),
getPreferredTimeSet("2100-2130"))
};
}
Expand Down Expand Up @@ -81,8 +81,7 @@ public static Set<Tag> getTagSet(String... strings) {
public static Map<String, Game> getGameMap(String... strings) {
Map<String, Game> gameMap = new HashMap<>();
Arrays.stream(strings)
.forEach((gameName) -> gameMap.put(gameName, new Game(gameName, new Username("nil"),
new SkillLevel("nil"), new Role("nil"), false)));
.forEach((gameName) -> gameMap.put(gameName, new Game(gameName)));
return gameMap;
}

Expand Down

0 comments on commit 3de8afe

Please sign in to comment.