Skip to content

Commit

Permalink
Feat: fixed exchange bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyah committed Mar 15, 2026
1 parent 2e3b281 commit cfedec2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .idea/checkstyle-idea.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/Exchange.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ public Transaction buy(String symbol, BigDecimal quantity, Player player) {
Stock stock = stockMap.get(symbol);
Share share = new Share(stock, quantity, stock.getSalesPrice());
TransactionCalculator calculator = new PurchaseCalculator(share);
return new Purchase(share, week, calculator, player);
return new Purchase(share, week, calculator);
}

public Transaction sell(Share share, Player player) {
TransactionCalculator calculator = new SaleCalculator(share);
return new Sale(share, week, calculator, player);
return new Sale(share, week, calculator);
}

public void advance() {
Expand Down

0 comments on commit cfedec2

Please sign in to comment.