/// <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(); }
/// <summary> /// Initializes a new instance of the theater class. /// </summary> /// <param name="name"></param> /// <param name="screeningRoom"></param> /// <param name="moneyBoxInitialMoneyBalance"></param> /// <param name="popcornPrice"></param> /// <param name="sodaCupPrice"></param> public Theater(SodaStand sodaStand, SodaCupStand sodacupStand, PopcornStand popcornStand, string name, ScreeningRoom screeningRoom, decimal moneyBoxInitialMoneyBalance, decimal popcornPrice, decimal sodaCupPrice) { this.sodaStand = sodaStand; this.sodaCupStand = sodacupStand; this.popcornStand = popcornStand; this.name = name; this.screeningRoom = screeningRoom; this.guests = new List <Guest>(); this.movies = new List <Movie>(); }
/// <summary> /// The new theater. /// </summary> /// <returns>Returns the new theater.</returns> public static Theater NewTheater() { Theater theater; // Create the screening room. ScreeningRoom screeningRoom = new ScreeningRoom(true, 78); // Create Marcus Theater. theater = new Theater("Marcus Theater", screeningRoom, 450m, 5m, 4m); // Create and add the first guest. theater.AddGuest(new Guest(26, "The Godfather", SodaFlavor.PrDepper, new Wallet(WalletColor.Salmon, 12m))); // Create and add the second guest. theater.AddGuest(new Guest(34, "August Rush", SodaFlavor.Dolt, new Wallet(WalletColor.Brown, 15m))); // Create and add "The Godfather." theater.AddMovie(new Movie(false, MovieRating.R, 175, "The Godfather")); // Create and add "Despicable Me." theater.AddMovie(new Movie(true, MovieRating.Pg, 95, "Despicable Me")); return(theater); }