Skip to content

Commit

Permalink
Feat: Final refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyah committed May 27, 2026
1 parent 8af9842 commit 72a197c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Purchase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
10 changes: 0 additions & 10 deletions src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/model/Sale.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 72a197c

Please sign in to comment.