Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Guest
- {
- private Host host;
- public Guest(Host host)
- {
- this.host = host;
- }
- private List<Fruit> GetFruit()
- {
- return host.FruitBowl;
- }
- private void Print(string s)
- {
- host.Print(s);
- }
- public void Run()
- {
- // custom code is inserted here
- List<Fruit> fruitBowl = GetFruit();
- foreach(Fruit fruit in fruitBowl)
- {
- Print("This fruit is " + fruit.Name);
- }
- // end of custom code
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement