Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.sagwangho;
- public class Audience {
- private Ticket ticket = Ticket.EMPTY;
- private Invitation invitation = Invitation.EMPTY;
- private Long amount;
- public Audience(Long amount) {
- this.amount = amount;
- }
- public void buyTicket(TicketSeller seller, Movie movie) {
- ticket = seller.getTicket(this, movie);
- }
- public boolean hasAmount(Long amount) {
- return this.amount >= amount;
- }
- public boolean minusAmount(Long price) {
- if (amount > this.amount) return false;
- this.amount -= amount;
- return true;
- }
- public Invitation getInvitation() {
- return invitation;
- }
- public void setInvitation(Invitation invitation) {
- this.invitation = invitation;
- }
- public void removeInvitation() {
- this.invitation = Invitation.EMPTY;
- }
- public Ticket getTicket() {
- return this.ticket;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement