예제 #1
0
        public void ChangeVariableType(IData v, VariableTypes e)
        {
            int index = varList.IndexOf(v);

            varList.RemoveAt(index);
            switch (e)

            {
            case VariableTypes.String:
                var newString = new VariableString();
                newString.Init(v.varName);
                varList.Insert(index, newString);
                break;

            case VariableTypes.Boolean:
                var newBool = new VariableBool();
                newBool.Init(v.varName);
                varList.Insert(index, newBool);
                break;

            case VariableTypes.Int:
                var newInt = new VariableInt();
                newInt.Init(v.varName);
                varList.Insert(index, newInt);
                break;

            case VariableTypes.Float:
                var newFloat = new VariableFloat();
                newFloat.Init(v.varName);
                varList.Insert(index, newFloat);
                break;
            }
        }
예제 #2
0
        public float GetFloat(string name)
        {
            VariableFloat e = (VariableFloat)getData(name, VariableTypes.Float);

            return(e != null ? e.value : float.MinValue);
        }