Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item and ItemList Feature #23

Merged
merged 4 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test {
}

application {
mainClass.set("seedu.duke.Duke")
mainClass.set("seedu.binbash.Duke")
}

shadowJar {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.duke;
package seedu.binbash;

import java.util.Scanner;

Expand Down
24 changes: 24 additions & 0 deletions src/main/java/seedu/binbash/Item.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package seedu.binbash;

public class Item {
private final String itemName;
private final String itemDescription;

public Item(String itemName, String itemDescription) {
this.itemName = itemName;
this.itemDescription = itemDescription;
}

public String getItemName() {
return itemName;
}

public String getItemDescription() {
return itemDescription;
}

@Override
public String toString() {
return itemName + ": " + itemDescription;
}
}
28 changes: 28 additions & 0 deletions src/main/java/seedu/binbash/ItemList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package seedu.binbash;

import java.util.List;
import java.util.ArrayList;

public class ItemList {
private final List<Item> itemList;

public ItemList() {
itemList = new ArrayList<>();
}

public List<Item> getItemList() {
return itemList;
}

/**
* Test method
*/
public void addItem(Item item) {
itemList.add(item);
}

@Override
public String toString() {
return itemList.toString();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.duke;
package seedu.binbash;

import static org.junit.jupiter.api.Assertions.assertTrue;

Expand Down
Loading