diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Portfolio.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Portfolio.java index 3b08af9..8a77791 100644 --- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Portfolio.java +++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Portfolio.java @@ -3,9 +3,7 @@ import edu.ntnu.idi.idatt2003.g40.mappe.utils.Validator; import java.math.BigDecimal; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * Represents a player's portfolio of shares. diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Purchase.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Purchase.java index af28170..01645b4 100644 --- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Purchase.java +++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Purchase.java @@ -23,14 +23,4 @@ public Purchase(final Share share, final TransactionCalculator calculator) { super(share, week, calculator); } - - /** - * Commits the purchase. - * - * @param player the {@link Player} object performing the purchase. - * */ - @Override - public void commit(final Player player) { - setCommitted(true); - } } diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Sale.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Sale.java index 7731aff..955201a 100644 --- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Sale.java +++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Sale.java @@ -23,14 +23,4 @@ public Sale(final Share share, final TransactionCalculator calculator) { super(share, week, calculator); } - - /** - * Commits the purchase. - * - * @param player the {@link Player} object performing the purchase. - * */ - @Override - public void commit(final Player player) { - setCommitted(true); - } } diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Transaction.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Transaction.java index 62993f1..04c1dd1 100644 --- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Transaction.java +++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Transaction.java @@ -97,14 +97,7 @@ public boolean isCommited() { * * @param player The player that performed the transaction. * */ - public abstract void commit(Player player); - - /** - * Sets the committed flag. - * - * @param value the value to set the committed flag to. - * */ - protected void setCommitted(final boolean value) { - committed = value; + public void commit(final Player player) { + committed = true; } }