cruisin_asu.Helpers.Controller.Controller C# (CSharp) Method

Controller() public method

public Controller ( ControllerType controllerType ) : System
controllerType ControllerType
return System
        public Controller(ControllerType controllerType)
        {
            this.controllerType = controllerType;

            switch (controllerType) {
                case ControllerType.PC:
                    this.keyboardControlScheme = new Dictionary<Keys, Controls>();
                    this.keyboardControlScheme.Add(Keys.Up, Controls.Up);
                    this.keyboardControlScheme.Add(Keys.Down, Controls.Down);
                    this.keyboardControlScheme.Add(Keys.Left, Controls.Left);
                    this.keyboardControlScheme.Add(Keys.Right, Controls.Right);
                    this.keyboardControlScheme.Add(Keys.Escape, Controls.Exit);
                    this.keyboardControlScheme.Add(Keys.Space, Controls.SpeedUp);
                    break;
                case ControllerType.PC2:
                    this.keyboardControlScheme = new Dictionary<Keys, Controls>();
                    this.keyboardControlScheme.Add(Keys.W, Controls.Up);
                    this.keyboardControlScheme.Add(Keys.S, Controls.Down);
                    this.keyboardControlScheme.Add(Keys.A, Controls.Left);
                    this.keyboardControlScheme.Add(Keys.D, Controls.Right);
                    this.keyboardControlScheme.Add(Keys.Escape, Controls.Exit);
                    this.keyboardControlScheme.Add(Keys.LeftShift, Controls.SpeedUp);
                    break;
                case ControllerType.Xbox360:
                    this.xbox360ControlScheme = new Dictionary<Buttons, Controls>();
                    this.xbox360ControlScheme.Add(Buttons.DPadUp, Controls.Up);
                    this.xbox360ControlScheme.Add(Buttons.DPadDown, Controls.Down);
                    this.xbox360ControlScheme.Add(Buttons.DPadLeft, Controls.Left);
                    this.xbox360ControlScheme.Add(Buttons.DPadRight, Controls.Right);
                    this.xbox360ControlScheme.Add(Buttons.Back, Controls.Exit);
                    this.xbox360ControlScheme.Add(Buttons.RightTrigger, Controls.SpeedUp);
                    break;
            }

            this.controlState = new Dictionary<Controls, bool>();
            this.controlState.Add(Controls.Up, false);
            this.controlState.Add(Controls.Down, false);
            this.controlState.Add(Controls.Left, false);
            this.controlState.Add(Controls.Right, false);
            this.controlState.Add(Controls.Exit, false);
            this.controlState.Add(Controls.SpeedUp, false);
        }