Exemple #1
0
    public void SetFunctionAndValue(eFunction f, int value)
    {
        _function   = f;
        _ball_value = value;


        if (f == eFunction.Digit)
        {
            setBallText(value.ToString());
            setBallTextColor(new Color(0.0f, 0.0f, 0.0f, 1f));
        }
        else if (f == eFunction.Operand)
        {
            _operator = (eOperator)value;

            string operatorText = "e";
            if (_operator == MathBall.eOperator.Plus)
            {
                operatorText = "+";
                setBallTextColor(new Color(0.25f, 0.25f, 1f, 1f));
            }
            else if (_operator == MathBall.eOperator.Minus)
            {
                operatorText = "-";
                setBallTextColor(new Color(1f, 0.25f, 1f, 1f));
            }
            else if (_operator == MathBall.eOperator.Multiply)
            {
                operatorText = "*";
                setBallTextColor(new Color(0.25f, 1f, 0.25f, 1f));
            }
            else if (_operator == MathBall.eOperator.Divide)
            {
                operatorText = "/";
                setBallTextColor(new Color(1.0f, 0.25f, 0.25f, 1f));
            }
            else if (_operator == MathBall.eOperator.Power)
            {
                operatorText = "^";
                setBallTextColor(new Color(1.0f, 1.0f, 0.25f, 1f));
            }
            else if (_operator == MathBall.eOperator.Equals)
            {
                operatorText = "=";
                setBallTextColor(new Color(1.0f, 1.0f, 1.0f, 1f));
            }

            setBallText(operatorText);
        }
        else if (f == eFunction.Number)
        {
        }
    }
Exemple #2
0
            public Item(Instance parent, object value, eCondition condition, eOperator @operator)
                : base(parent)
            {
                var prop  = parent.Properties.Last();
                var items = prop.Value;

                items.Add(new PropertyItem
                {
                    Condition = condition,
                    Operator  = @operator,
                    Value     = value
                });
            }
Exemple #3
0
 //-----------------------------------------------------------------------------------------------
 public EffectProperty(string name, byte value, eOperator op)
 {
     m_propertyName       = name;
     m_propertyValue      = value;
     m_operatorToEvaluate = op;
 }
Exemple #4
0
 //-----------------------------------------------------------------------------------------------
 public PreconditionProperty(string name, byte value, eOperator op)
 {
     m_propertyName       = name;
     m_propertyValue      = value;
     m_operatorToEvaluate = op;
 }
Exemple #5
0
    public void SetFunctionAndValue(eFunction f, int value)
    {
        _function = f;
        _ball_value = value;

        if (f == eFunction.Digit)
        {

            setBallText(value.ToString());
            setBallTextColor(new Color(0.0f, 0.0f, 0.0f, 1f));

        }
        else if (f == eFunction.Operand)
        {

            _operator = (eOperator)value;

            string operatorText = "e";
            if(_operator == MathBall.eOperator.Plus)
            {
                operatorText = "+";
                setBallTextColor(new Color(0.25f, 0.25f, 1f, 1f));
            }
            else if(_operator == MathBall.eOperator.Minus)
            {
                operatorText = "-";
                setBallTextColor(new Color(1f, 0.25f, 1f, 1f));
            }
            else if(_operator == MathBall.eOperator.Multiply)
            {
                operatorText = "*";
                setBallTextColor(new Color(0.25f, 1f, 0.25f, 1f));
            }
            else if(_operator == MathBall.eOperator.Divide)
            {
                operatorText = "/";
                setBallTextColor(new Color(1.0f, 0.25f, 0.25f, 1f));
            }
            else if(_operator == MathBall.eOperator.Power)
            {
                operatorText = "^";
                setBallTextColor(new Color(1.0f, 1.0f, 0.25f, 1f));
            }
            else if(_operator == MathBall.eOperator.Equals)
            {
                operatorText = "=";
                setBallTextColor(new Color(1.0f, 1.0f, 1.0f, 1f));
            }

            setBallText(operatorText);

        }
        else if (f == eFunction.Number)
        {

        }
    }