Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BallVisitor : IVisitor
- {
- public void Visit(Body body)
- {
- var ball = body as Ball;
- ball?.GetVolume();
- }
- }
- public class CubeVisitor : IVisitor
- {
- public void Visit(Body body)
- {
- var cube = body as Cube;
- cube?.GetVolume();
- }
- }
- public class CyllinderVisitor : IVisitor
- {
- public void Visit(Body body)
- {
- var cyllinder = body as Cyllinder;
- cyllinder?.GetVolume();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement