Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using KinoGigant;
- // Class responsible for storing and managing cinema showtimes.
- public class ShowCatalog
- {
- // Private list of all showtimes.
- private readonly List<Show> _shows = new();
- // Exposes the showtimes as a read-only collection.
- public IReadOnlyList<Show> Shows => _shows;
- // Adds sample showtimes to the catalog.
- public void SeedSampleShows()
- {
- // Add the "Matrix" showtime.
- Add(new Show(
- title: "Matrix",
- dateTime: new DateTime(2025, 4, 10),
- hour: new DateTime(2025, 4, 10, 18, 0, 0),
- numberOfSeats: 30));
- // Add the "Inception" showtime.
- Add(new Show(
- title: "Inception",
- dateTime: new DateTime(2025, 4, 11),
- hour: new DateTime(2025, 4, 11, 20, 0, 0),
- numberOfSeats: 30));
- }
- // Adds a single show to the catalog.
- public void Add(Show show) => _shows.Add(show);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement