Skip to content

Commit

Permalink
Feat: Added purchase class (commit method not fully implemented)
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyah committed Mar 3, 2026
1 parent e422eee commit c4bd20b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/Purchase.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package edu.ntnu.idi.idatt2003.g40.mappe;

/**
* Purchase represents purchases the player commits.
*
* <p>Extends {@link Transaction}</p>
*
* */
public class Purchase extends Transaction {

/**
* Constructor.
*
* @param share the {@link Share} object to purchase.
* @param week the week to purchase during.
* @param calculator the {@link TransactionCalculator} object to calculate this purchase.
* */
public Purchase(final Share share, final int week, 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) {
commited = true;
}
}

0 comments on commit c4bd20b

Please sign in to comment.