Newer
Older
POS_for_GUI / src / resources / Customer.java
fujii kouta on 25 Apr 2022 730 bytes バグの修正とリファクタリング.
package resources;

import java.util.List;

public class Customer {
	private Points points;
	private Total total;
	private History history;
	private Payment payment;

	private String name;

	public Customer(String name) {
		points = new Points();
		total = new Total();
		history = new History(total);
		payment = new Payment(points, history);

		this.name = name; 
	}
	
	public void purchase(int x) {
		this.payment.purchase(x);
	}

	public int getTotal() {
		return total.getValue();
	}

	public int getPayment() {
		return payment.getValue();
	}

	public List<Integer> getHistory() {
		return history.getValue();
	}
	
	public int getPoints() {
		return points.getValue();
	}

	public String getName() {
		return this.name;
	}
}