예제 #1
0
        // THE REQUESTOR OF THE ENGINE USED DETERMINES THE ALGORITHM
        // USED STRATEGY DESIGN PATTERN

        public IconstantEngine GetconstantEngine()
        {
            IconstantEngine constantEngine = null;

            constantEngine = new DotNetEngine();
            return(constantEngine);
        }
예제 #2
0
        public IconstantEngine GetconstantEngine(PI_ENGINE_TYPE enginetype)
        {
            IconstantEngine constantEngine = null;

            switch (enginetype)
            {
            case PI_ENGINE_TYPE.NilakanthaEngine:
                constantEngine = new NilakanthaEngine();
                break;

            case PI_ENGINE_TYPE.ArcTangentEngine:
                constantEngine = new ArcTangentEngine();
                break;

            case PI_ENGINE_TYPE.DotNetEngine:
                constantEngine = new DotNetEngine();
                break;

            case PI_ENGINE_TYPE.EgyptianPyramidEngine:
                constantEngine = new EgyptianPyramidEngine();
                break;

            case PI_ENGINE_TYPE.GregoryLeibnizEngine:
                constantEngine = new GregoryLeibnizEngine();
                break;

            case PI_ENGINE_TYPE.MonteCarlo2DEngine:
                constantEngine = new MonteCarloEngine();
                break;

            case PI_ENGINE_TYPE.MonteCarlo3DEngine:
                constantEngine = new MonteCarloCubicEngine();
                break;

            case PI_ENGINE_TYPE.Triangle2DEngine:
                constantEngine = new TriangleEngine2D();
                break;

            case PI_ENGINE_TYPE.Triangle3DEngine:
                constantEngine = new TriangleEngine3D();
                break;

            default:
                constantEngine = new DotNetEngine();
                break;
            }
            return(constantEngine);
        }