public ManifoldDrawOperation(Player p, Command cmd) : base(p)
        {
            _expressions = PrepareParametrizedManifold.GetPlayerParametrizationCoordsStorage(p);
            if (null == _expressions[0])
            {
                throw new InvalidExpressionException("x is undefined");
            }
            if (null == _expressions[1])
            {
                throw new InvalidExpressionException("y is undefined");
            }
            if (null == _expressions[2])
            {
                throw new InvalidExpressionException("z is undefined");
            }

            _paramIterations = PrepareParametrizedManifold.GetPlayerParametrizationParamsStorage(p);
            if (null == _paramIterations[0] && null == _paramIterations[1] && null == _paramIterations[2])
            {
                throw new InvalidExpressionException("all parametrization variables are undefined");
            }

            if (GetNumOfSteps(0) * GetNumOfSteps(1) * GetNumOfSteps(2) > MaxIterationSteps)
            {
                throw new InvalidExpressionException("too many iteration steps (over " + MaxIterationSteps + ")");
            }

            _scaler = new Scaler(cmd.Next());

            p.Message("Going to draw the following parametrization:\nx=" + _expressions[0].Print() +
                      "\ny=" + _expressions[1].Print() + "\nz=" + _expressions[2].Print());
        }
Example #2
0
        public StartSpringDraw(Player p, Command cmd)
            : base(p)
        {
            _expressions2 = PrepareParametrizedManifold.GetPlayerParametrizationCoordsStorage(p);
            if (null == _expressions2[0])
            {
                throw new InvalidExpressionException("x is undefined");
            }
            if (null == _expressions2[1])
            {
                throw new InvalidExpressionException("y is undefined");
            }
            if (null == _expressions2[2])
            {
                throw new InvalidExpressionException("z is undefined");
            }

            _paramIterations2 = PrepareParametrizedManifold.GetPlayerParametrizationParamsStorage(p);
            if (null == _paramIterations2[0] && null == _paramIterations2[1] && null == _paramIterations2[2])
            {
                throw new InvalidExpressionException("all parametrization variables are undefined");
            }

            if (GetNumOfSteps2(0) * GetNumOfSteps2(1) * GetNumOfSteps2(2) > MaxIterationSteps2)
            {
                throw new InvalidExpressionException("too many iteration steps (over " + MaxIterationSteps2 + ")");
            }

            _scaler2 = new Scaler(cmd.Next());
        }