Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace museum2
  6. {
  7. class Room
  8. {
  9.  
  10. public string Name { get; set; }
  11. public List<Artwork> art { get; set; } = new List<Artwork>();
  12.  
  13.  
  14. //public List<string> navigation;
  15.  
  16. public Room(string name, string description, string roomright)
  17. {
  18. Name = name;
  19.  
  20. // art = new List<Artwork>();
  21. //navigation = new List<string>();
  22. }
  23.  
  24.  
  25. //private List<Artwork> artworks = new List<Artwork>();
  26.  
  27.  
  28.  
  29. public void addArtwork(Artwork artwork)
  30. {
  31. art.Add(artwork);
  32. }
  33.  
  34. public void printArtworks()
  35. {
  36. if (art.Count > 0)
  37. {
  38. Console.WriteLine("In this room you have the artworks:");
  39. foreach (var artwork in art)
  40. {
  41. Console.WriteLine(artwork.Title + ", " + artwork.Description + ", painted by: " + artwork.Author);
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement