Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public class BallVisitor : IVisitor
  2. {
  3. public void Visit(Body body)
  4. {
  5. var ball = body as Ball;
  6. ball?.GetVolume();
  7. }
  8. }
  9.  
  10. public class CubeVisitor : IVisitor
  11. {
  12. public void Visit(Body body)
  13. {
  14. var cube = body as Cube;
  15. cube?.GetVolume();
  16. }
  17. }
  18.  
  19. public class CyllinderVisitor : IVisitor
  20. {
  21. public void Visit(Body body)
  22. {
  23. var cyllinder = body as Cyllinder;
  24. cyllinder?.GetVolume();
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement