예제 #1
0
 public static void ShowSomeTrees(Forest forest)
 {
     foreach (var SomeTree in forest.SomeTrees)
     {
         ShowSomeTree(SomeTree);
     }
 }
예제 #2
0
 public static void ShowFirTrees(Forest forest)
 {
     foreach (var firTree in forest.FirTrees)
     {
         ShowFirTree(firTree);
     }
 }
예제 #3
0
 public static void ShowForest(Forest forest)
 {
     foreach (var tree in forest.AllTrees)
     {
         if (tree is FirTree)
         {
             ShowFirTree((FirTree)tree);
         }
         else if(tree is SomeTree)
         {
             ShowSomeTree((SomeTree)tree);
         }
     }
 }