CM3D2.MaidFiddler.Plugin.Gui.MaidFiddlerGUI.PlayerInfo.SetValue C# (CSharp) Method

SetValue() public method

public SetValue ( PlayerChangeType type, object value ) : void
type PlayerChangeType
value object
return void
            public void SetValue(PlayerChangeType type, object value)
            {
                Action<int> setValInt;
                Action<long> setValLong;
                Action<string> setValString;
                if (setMethodInt.TryGetValue(type, out setValInt))
                {
                    int val;
                    string s = value as string;
#pragma warning disable 642
                    if (s != null && int.TryParse(s, out val))
                        ;
#pragma warning restore 642
                    else if (value is int)
                        val = (int) value;
                    else
                        return;

                    setValInt(val);
                }
                else if (setMethodLong.TryGetValue(type, out setValLong))
                {
                    long val;
                    string s = value as string;
#pragma warning disable 642
                    if (s != null && !long.TryParse(s, out val))
                        ;
#pragma warning restore 642
                    else if (value is int || value is long)
                        val = (long) value;
                    else
                        return;

                    setValLong(val);
                }
                else if (value is string && setMethodString.TryGetValue(type, out setValString))
                    setValString((string) value);
            }