예제 #1
0
        public StartSpringDraw(Player p, Command cmd) : base(p)
        {
            Expressions = PrepareParametrizedManifold.GetPlayerParametrizationCoordsStorage(p);

            if (Expressions[0] == null)
            {
                throw new InvalidExpressionException("x is undefined");
            }

            if (Expressions[1] == null)
            {
                throw new InvalidExpressionException("y is undefined");
            }

            if (Expressions[2] == null)
            {
                throw new InvalidExpressionException("z is undefined");
            }

            ParameterIterations = PrepareParametrizedManifold.GetPlayerParametrizationParamsStorage(p);

            if (ParameterIterations[0] == null && ParameterIterations[1] == null && ParameterIterations[2] == null)
            {
                throw new InvalidExpressionException("all parametrization variables are undefined");
            }

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

            _Scaler = new Scaler(cmd.Next());
        }
        public ManifoldDrawOperation(Player p, Command cmd) : base(p)
        {
            _Expressions = PrepareParametrizedManifold.GetPlayerParametrizationCoordsStorage(p);

            if (_Expressions[0] == null)
            {
                throw new InvalidExpressionException("x is undefined");
            }

            if (_Expressions[1] == null)
            {
                throw new InvalidExpressionException("y is undefined");
            }

            if (_Expressions[2] == null)
            {
                throw new InvalidExpressionException("z is undefined");
            }

            ParamIterations = PrepareParametrizedManifold.GetPlayerParametrizationParamsStorage(p);

            if (ParamIterations[0] == null && ParamIterations[1] == null && ParamIterations[2] == null)
            {
                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());
        }