コード例 #1
0
ファイル: AnalogMap.cs プロジェクト: colbybhearn/GameLib
        internal override void Load(InputMap savedMap)
        {
            if (savedMap is AnalogMap == false)
            {
                throw new Exception("AnalogMap attempting to load type other than AnalogMap");
            }

            AnalogMap savedAnalogMap = savedMap as AnalogMap;

            foreach (AnalogBinding saved in savedAnalogMap.AnalogBindings.Values)
            {
                if (AnalogBindings.ContainsKey(saved.Alias))
                {
                    AnalogBinding binding = AnalogBindings[saved.Alias];

                    if (binding.GetType().Equals(saved) == false)
                    {
                        throw new Exception("Error loading Button Bindings: Saved binding is not a same type as default binding");
                    }

                    if (binding is GamePadThumbStickBinding)
                    {
                        GamePadThumbStickBinding gpjb  = binding as GamePadThumbStickBinding;
                        GamePadThumbStickBinding other = saved as GamePadThumbStickBinding;
                    }
                }
            }
        }
コード例 #2
0
ファイル: AnalogMap.cs プロジェクト: colbybhearn/GameLib
 public void AddBinding(AnalogBinding ab)
 {
     AnalogBindings.Add(ab.Alias, ab);
 }