MultiPlayer.UnitAttributes.SetSpeedAttributes C# (CSharp) Method

SetSpeedAttributes() public method

public SetSpeedAttributes ( string mathExpression ) : void
mathExpression string
return void
        public void SetSpeedAttributes(string mathExpression)
        {
            if (mathExpression.Equals("") || mathExpression.Length <= 0) {
                return;
            }
            if (this.speedPrefabList.Count > 0) {
                this.speedPrefabList.Clear();
            }
            float previousAnswer = 0f;
            for (int i = 0; i < Attributes.MAX_NUM_OF_LEVELS; i++) {
                float answer = (float)MathParser.ProcessEquation(mathExpression, AttributeProperty.Speed, i + 1, i, previousAnswer);
                this.speedPrefabList.Add(answer);
                previousAnswer = answer;
            }
        }