Exemple #1
0
        public InputDevice(string name)
        {
            Name = name;
            Meta = "";
            Guid = Guid.NewGuid();

            LastChangeTick = 0;

            const int numInputControlTypes = (int)InputControlType.Count + 1;

            Controls = new InputControl[numInputControlTypes];

            LeftStickX = new OneAxisInputControl();
            LeftStickY = new OneAxisInputControl();
            LeftStick  = new TwoAxisInputControl();

            RightStickX = new OneAxisInputControl();
            RightStickY = new OneAxisInputControl();
            RightStick  = new TwoAxisInputControl();

            DPadX = new OneAxisInputControl();
            DPadY = new OneAxisInputControl();
            DPad  = new TwoAxisInputControl();

            Command = AddControl(InputControlType.Command, "Command");
//            AddControl(InputControlType.Action1, "Action1");
        }
Exemple #2
0
 // TODO: Is there a better way to handle this? Maybe calculate deltaTime internally.
 public void Filter(TwoAxisInputControl twoAxisInputControl)
 {
     UpdateWithAxes(twoAxisInputControl.X, twoAxisInputControl.Y);
 }