예제 #1
0
파일: Task.cs 프로젝트: JoJolkree/OOP
        public static double GetVolume(this Body body)
        {
            IVisitor visitor = new Volume();

            body.Accept(visitor);
            return(body.Volume);
        }
예제 #2
0
 public static double GetVolume(this Body body)
 {
     return(body.Accept(new Visitor()));
 }