/// <summary> /// Initializes a new instance of the MoneyCollectingBooth class. /// </summary> /// <param name="attendent"> The attendant for the booth.</param> /// <param name="ticketPrice"> The price of the tickets.</param> /// <param name="waterBottlePrice"> The price of the water bottles.</param> public MoneyCollectingBooth(Employee attendant, decimal ticketPrice, decimal waterBottlePrice) : base(attendant) { this.moneyBox = new MoneyCollector(); this.ticketPrice = ticketPrice; this.waterBottlePrice = waterBottlePrice; // Creates 5 tickets. for (int t = 0; t < 5; t++) { // Create a variable of type ticket and pass in the correct parameters. Ticket ticket = new Ticket(15, t + 1, .01); Items.Add(ticket); } // Creates 5 water bottles. for (int w = 0; w < 5; w++) { // Creates a new water bottle and pass in the correct parameters. WaterBottle waterBottle = new WaterBottle(3, w + 1, 1); Items.Add(waterBottle); this.waterBottlePrice = waterBottle.Price; } }
/// <summary> /// Initializes a new instance of the VendingMachine class. /// </summary> /// <param name="foodPrice">The price of food (per pound).</param> public VendingMachine(decimal foodPrice) { this.foodPricePerPound = foodPrice; this.moneyBox = new MoneyCollector(); // Fill with an initial load of food. while (!this.IsFull()) { this.AddFoodBag(); } }
/// <summary> /// Initializes a new instance of the Theater class. /// </summary> /// <param name="name">The theater's name.</param> /// <param name="screeningRoom">The theater's screening room.</param> /// <param name="moneyBoxInitialMoneyBalance">The initial money balance of the theater's money collector.</param> /// <param name="popcornPrice">The price of a bag of popcorn.</param> /// <param name="sodaCupPrice">The price of a cup of soda.</param> public Theater(string name, ScreeningRoom screeningRoom, decimal moneyBoxInitialMoneyBalance, decimal popcornPrice, decimal sodaCupPrice) { this.guests = new List <Guest>(); this.movies = new List <Movie>(); this.name = name; this.screeningRoom = screeningRoom; MoneyCollector moneyBox = new MoneyCollector(moneyBoxInitialMoneyBalance); this.popcornStand = new PopcornStand(popcornPrice, moneyBox); this.sodaCupStand = new SodaCupStand(sodaCupPrice, moneyBox); this.sodaStand = new SodaStand(); }
public static Theater NewTheater() { MoneyCollector moneyBox = new MoneyCollector(450); SodaStand sodaStand = new SodaStand(); SodaCupStand sodaCupStand = new SodaCupStand(4, moneyBox); PopcornStand popcornStand = new PopcornStand(5, moneyBox); Theater marcusTheater = new Theater(sodaStand, sodaCupStand, popcornStand, "Marcus Theater", new ScreeningRoom(true, 78), 450, 5, 4); Wallet wallet = new Wallet("Salmon", 12); Guest guest; guest = new Guest(26, "The Godfather", "PrDepper", wallet); marcusTheater.guests.Add(guest); wallet = new Wallet("Brown", 15); guest = new Guest(34, "August Rush", "Dolt", wallet); marcusTheater.guests.Add(guest); Movie movie = new Movie(false, "R", 175, "The God Father"); marcusTheater.movies.Add(movie); movie = new Movie(true, "PG", 95, "Despicable Me"); marcusTheater.movies.Add(movie); return(marcusTheater); }
/// <summary> /// /// </summary> /// <param name="itemPrice"></param> /// <param name="moneyBox"></param> public SodaCupStand(decimal itemPrice, IMoneyCollector moneyBox) : base(itemPrice, "soda", moneyBox) { this.itemPrice = itemPrice; this.moneyBox = new MoneyCollector(this.MoneyBalance); }
private void Awake() { money = FindObjectOfType <MoneyCollector>(); medicine = FindObjectOfType <MedicalCenter>(); food = FindObjectOfType <FoodStorage>(); }
/// <summary> /// Initializes a new instance of the Wallet class. /// </summary> /// <param name="color">The color of the wallet.</param> public Wallet(string color) { this.color = color; this.moneyPocket = new MoneyCollector(); }