//--------------------------------------------------------------
        #region Properties & Events
        //--------------------------------------------------------------
        #endregion


        //--------------------------------------------------------------
        #region Methods
        //--------------------------------------------------------------

        /// <inheritdoc/>
        public PlayerIndex?GetLogicalPlayer(LogicalPlayerIndex player)
        {
            // For efficiency: No boundary checks - array will throw exception anyways.
            int index = (int)player;

            return(_logicalPlayers[index]);
        }
        /// <summary>
        /// Returns the Identified player with the given logical player index
        /// </summary>
        /// <param name="logicalPlayerIndex"></param>
        /// <returns>Returns the corresponding IdentifiedPlayer if found; null otherwise</returns>
        public static IdentifiedPlayer GetIdentifiedPlayer(LogicalPlayerIndex logicalPlayerIndex)
        {
            if (LogicalPlayers.ContainsKey(logicalPlayerIndex))
                return LogicalPlayers[logicalPlayerIndex];

            throw new CoreException("No players identified as " + logicalPlayerIndex.ToString());
        }
        /// <inheritdoc/>
        public void SetLogicalPlayer(LogicalPlayerIndex player, PlayerIndex?controller)
        {
            // For efficiency: No boundary checks - array will throw exception anyways.
            int index = (int)player;

            _logicalPlayers[index] = controller;
        }
Example #4
0
        public bool IsUp(Buttons button, LogicalPlayerIndex player)
        {
            if (player == LogicalPlayerIndex.All)
            {
                // Check game controllers of all players.
                bool isUp = true;
                foreach (PlayerIndex?controller in logicalPlayerMapping)
                {
                    if (controller.HasValue)
                    {
                        if (!IsDown(ref currGamePadStates[(int)controller.Value], button))
                        {
                            return(true);
                        }

                        isUp = false;
                    }
                }

                return(isUp);
            }
            else
            {
                PlayerIndex?controller = logicalPlayerMapping[(int)player];
                if (controller.HasValue)
                {
                    return(!IsDown(ref currGamePadStates[(int)controller.Value], button));
                }

                return(true);
            }
        }
 public Player GetPlayer(LogicalPlayerIndex index)
 {
     if (players.ContainsKey(index))
         return players[index];
     else
         return null;
 }
Example #6
0
        /// <inheritdoc/>
        public GamePadState GetPreviousGamePadState(LogicalPlayerIndex player)
        {
            PlayerIndex? controller = _logicalPlayers[(int)player];
              if (controller.HasValue)
            return _previousGamePadStates[(int)controller.Value];

              return DefaultGamePadState;
        }
Example #7
0
        /// <summary>
        /// Returns the Identified player with the given logical player index
        /// </summary>
        /// <param name="logicalPlayerIndex"></param>
        /// <returns>Returns the corresponding IdentifiedPlayer if found; null otherwise</returns>
        public static IdentifiedPlayer GetIdentifiedPlayer(LogicalPlayerIndex logicalPlayerIndex)
        {
            if (LogicalPlayers.ContainsKey(logicalPlayerIndex))
            {
                return(LogicalPlayers[logicalPlayerIndex]);
            }

            throw new CoreException("No players identified as " + logicalPlayerIndex.ToString());
        }
        /// <inheritdoc/>
        public GamePadState GetPreviousGamePadState(LogicalPlayerIndex player)
        {
            PlayerIndex?controller = _logicalPlayers[(int)player];

            if (controller.HasValue)
            {
                return(_previousGamePadStates[(int)controller.Value]);
            }

            return(DefaultGamePadState);
        }
Example #9
0
        public GamePadState GetPreviousGamePadState(LogicalPlayerIndex player)
        {
            PlayerIndex?controller = logicalPlayerMapping[(int)player];

            if (controller.HasValue)
            {
                return(prevGamePadStates[(int)controller.Value]);
            }

            return(BlankGamePadState);
        }
 public Player GetPlayer(LogicalPlayerIndex index)
 {
     if (players.ContainsKey(index))
     {
         return(players[index]);
     }
     else
     {
         return(null);
     }
 }
Example #11
0
        public T GetDevice <T>(LogicalPlayerIndex playerIndex) where T : Device
        {
            foreach (Device d in _registeredDevices)
            {
                if ((d.LogicalPlayerIndex == playerIndex) && (d is T))
                {
                    return((T)d);
                }
            }

            return(null);
        }
        public void SetPlayer(LogicalPlayerIndex index, PlayerIndex controller)
        {
            if (!players.ContainsKey(index))
            {
                Player player = new Player(index, controller);
                player.InputHandler = InputHandler;

                if (InputHandler != null)
                    InputHandler.SetPlayerMapping(index, controller);

                players.Add(index, player);
            }
        }
Example #13
0
        /// <summary>
        /// Get devices registered for a player
        /// </summary>
        /// <param name="playerIndex"></param>
        /// <returns></returns>
        public List<Device> GetLinkedDevices(LogicalPlayerIndex playerIndex)
        {
            List<Device> devices = new List<Device>();

            foreach (Device d in _registeredDevices)
            {
                if (d.LogicalPlayerIndex == playerIndex)
                {
                    devices.Add(d);
                }
            }

            return devices;
        }
Example #14
0
        /// <summary>
        /// Get devices registered for a player
        /// </summary>
        /// <param name="playerIndex"></param>
        /// <returns></returns>
        public List <Device> GetLinkedDevices(LogicalPlayerIndex playerIndex)
        {
            List <Device> devices = new List <Device>();

            foreach (Device d in _registeredDevices)
            {
                if (d.LogicalPlayerIndex == playerIndex)
                {
                    devices.Add(d);
                }
            }

            return(devices);
        }
        public void SetPlayer(LogicalPlayerIndex index, PlayerIndex controller)
        {
            if (!players.ContainsKey(index))
            {
                Player player = new Player(index, controller);
                player.InputHandler = InputHandler;

                if (InputHandler != null)
                {
                    InputHandler.SetPlayerMapping(index, controller);
                }

                players.Add(index, player);
            }
        }
Example #16
0
        protected Device(LogicalPlayerIndex logicalPlayerIndex, DeviceType type, int index)
        {
            Type = type;
            _index = index;

            mapping = new Dictionary<MappingButtons, ButtonState>();
            ThumbStickRight = new ThumbstickState();
            ThumbStickLeft = new ThumbstickState();

            rumbles = new Rumble[4];
            for (int i = 0; i < rumbles.Length; i++)
            {
                rumbles[i] = new Rumble(0);
            }

            RumbleAssignation();
        }
Example #17
0
 /// <inheritdoc/>
 public void SetGamePadHandled(LogicalPlayerIndex player, bool value)
 {
   if (player == LogicalPlayerIndex.Any)
   {
     foreach (PlayerIndex? controller in _logicalPlayers)
     {
       if (controller.HasValue)
         _areGamePadsHandled[(int)controller.Value] = value;
     }
   }
   else
   {
     var controller = GetLogicalPlayer(player);
     if (controller.HasValue)
       _areGamePadsHandled[(int)controller.Value] = value;
   }
 }
Example #18
0
        protected Device(LogicalPlayerIndex logicalPlayerIndex, DeviceType type, int index)
        {
            Type   = type;
            _index = index;

            mapping         = new Dictionary <MappingButtons, ButtonState>();
            ThumbStickRight = new ThumbstickState();
            ThumbStickLeft  = new ThumbstickState();

            rumbles = new Rumble[4];
            for (int i = 0; i < rumbles.Length; i++)
            {
                rumbles[i] = new Rumble(0);
            }

            RumbleAssignation();
        }
Example #19
0
    /// <inheritdoc/>
    public bool IsGamePadHandled(LogicalPlayerIndex player)
    {
      if (player == LogicalPlayerIndex.Any)
      {
        foreach (var controller in _logicalPlayers)
        {
          if (controller.HasValue && _areGamePadsHandled[(int)controller.Value])
            return true;
        }
      }
      else
      {
        var controller = GetLogicalPlayer(player);
        if (controller.HasValue)
          return _areGamePadsHandled[(int)controller.Value];
      }

      return false;
    }
Example #20
0
 public void SetGamePadHandled(LogicalPlayerIndex player, bool value)
 {
     if (player == LogicalPlayerIndex.All)
     {
         foreach (PlayerIndex?controller in logicalPlayerMapping)
         {
             if (controller.HasValue)
             {
                 controllerHandled[(int)controller.Value] = value;
             }
         }
     }
     else
     {
         var controller = GetPlayerMapping(player);
         if (controller.HasValue)
         {
             controllerHandled[(int)controller.Value] = value;
         }
     }
 }
Example #21
0
        public bool IsNewlyPressed(Buttons button, bool useButtonRepetition, LogicalPlayerIndex player)
        {
            if (player == LogicalPlayerIndex.All)
            {
                // Check game controllers of all players.
                foreach (PlayerIndex?controller in logicalPlayerMapping)
                {
                    if (controller.HasValue && IsNewlyPressed(button, useButtonRepetition, controller.Value))
                    {
                        return(true);
                    }
                }

                return(false);
            }
            else
            {
                PlayerIndex?controller = logicalPlayerMapping[(int)player];
                return(controller.HasValue && IsNewlyPressed(button, useButtonRepetition, controller.Value));
            }
        }
        /// <inheritdoc/>
        public bool IsDoubleClick(Buttons button, LogicalPlayerIndex player)
        {
            if (player == LogicalPlayerIndex.Any)
            {
                // Check game controllers of all players.
                foreach (PlayerIndex?controller in _logicalPlayers)
                {
                    if (controller.HasValue && IsDoubleClick(button, controller.Value))
                    {
                        return(true);
                    }
                }

                return(false);
            }
            else
            {
                PlayerIndex?controller = _logicalPlayers[(int)player];
                return(controller.HasValue && IsDoubleClick(button, controller.Value));
            }
        }
        /// <inheritdoc/>
        public bool IsDown(Buttons button, LogicalPlayerIndex player)
        {
            if (player == LogicalPlayerIndex.Any)
            {
                // Check game controllers of all players.
                foreach (PlayerIndex?controller in _logicalPlayers)
                {
                    if (controller.HasValue && IsDown(ref _newGamePadStates[(int)controller.Value], button))
                    {
                        return(true);
                    }
                }

                return(false);
            }
            else
            {
                PlayerIndex?controller = _logicalPlayers[(int)player];
                return(controller.HasValue && IsDown(ref _newGamePadStates[(int)controller.Value], button));
            }
        }
Example #24
0
        public bool IsReleased(Buttons button, LogicalPlayerIndex player)
        {
            if (player == LogicalPlayerIndex.All)
            {
                //Check if any player has released the provided button...
                foreach (PlayerIndex?controller in logicalPlayerMapping)
                {
                    if (controller.HasValue && IsReleased(button, controller.Value))
                    {
                        return(true);
                    }
                }

                return(false);
            }
            else
            {
                //Check if the given player has released the provided button...
                PlayerIndex?controller = logicalPlayerMapping[(int)player];
                return(controller.HasValue && IsReleased(button, controller.Value));
            }
        }
Example #25
0
        public bool GamepadInputConsumed(LogicalPlayerIndex player)
        {
            if (player == LogicalPlayerIndex.All)
            {
                foreach (PlayerIndex?controller in logicalPlayerMapping)
                {
                    if (controller.HasValue && controllerHandled[(int)controller.Value])
                    {
                        return(true);
                    }
                }
            }
            else
            {
                PlayerIndex?controller = GetPlayerMapping(player);

                if (controller.HasValue)
                {
                    return(controllerHandled[(int)controller.Value]);
                }
            }

            return(false);
        }
Example #26
0
 public Player(LogicalPlayerIndex index, PlayerIndex controller)
 {
     this.index = index;
     this.Controller = controller;
 }
 public KeyboardDevice(LogicalPlayerIndex logicalPlayerIndex)
     : base(logicalPlayerIndex,DeviceType.KeyboardMouse, 0)
 {
     _keyboardMapping = new Dictionary<Keys, MappingButtons>();
 }
Example #28
0
 public JoypadDevice(LogicalPlayerIndex logicalPlayerIndex, int index)
     : base(logicalPlayerIndex,DeviceType.Joystick, index)
 {
 }
 public GamepadDevice(LogicalPlayerIndex logicalPlayerIndex, PlayerIndex index)
     : base(logicalPlayerIndex, DeviceType.Gamepad, (int)index)
 {
 }
Example #30
0
 /// <summary>
 /// Maps an internal logical player index to a controller index.
 /// </summary>
 /// <param name="player">The logical/internal index of the player to map.</param>
 /// <param name="controller">The index of the controller itself.</param>
 public void SetPlayerMapping(LogicalPlayerIndex player, PlayerIndex?controller)
 {
     logicalPlayerMapping[(int)player] = controller;
 }
Example #31
0
 public KeyboardDevice(LogicalPlayerIndex logicalPlayerIndex)
     : base(logicalPlayerIndex, DeviceType.Keyboard, 0)
 {
     _keyboardMapping = new Dictionary <Keys, MappingButtons>();
 }
Example #32
0
 public GamepadDevice(LogicalPlayerIndex logicalPlayerIndex, PlayerIndex index)
     : base(logicalPlayerIndex, DeviceType.Gamepad, (int)index)
 {
 }
Example #33
0
 /// <summary>
 /// Gets the (controller) PlayerIndex for the player mapped to the (internal) logical player index.
 /// </summary>
 /// <param name="player">The logical player index to get a PlayerIndex mapping for.</param>
 /// <returns>The PlayerIndex corresponding to the provided logical player index, or null if no mapping exists.</returns>
 public PlayerIndex?GetPlayerMapping(LogicalPlayerIndex player)
 {
     return(logicalPlayerMapping[(int)player]);
 }
 public static PlayerIndex GetPlayerIndex(LogicalPlayerIndex inIndex)
 {
     return mPlayerIndices[(int)inIndex];
 }
 public static void SetPlayerIndex(LogicalPlayerIndex inLogicalIndex,
                                   PlayerIndex inPlayerIndex)
 {
     mPlayerIndices[(int)inLogicalIndex] = inPlayerIndex;
 }
Example #36
0
 public MouseDevice(LogicalPlayerIndex logicalPlayerIndex)
     : base(logicalPlayerIndex, DeviceType.Mouse, 0)
 {
 }
Example #37
0
 public JoypadDevice(LogicalPlayerIndex logicalPlayerIndex, int index)
     : base(logicalPlayerIndex, DeviceType.Joystick, index)
 {
 }
Example #38
0
        /// <inheritdoc/>
        public bool IsDoubleClick(Buttons button, LogicalPlayerIndex player)
        {
            if (player == LogicalPlayerIndex.Any)
              {
            // Check game controllers of all players.
            foreach (PlayerIndex? controller in _logicalPlayers)
              if (controller.HasValue && IsDoubleClick(button, controller.Value))
            return true;

            return false;
              }
              else
              {
            PlayerIndex? controller = _logicalPlayers[(int)player];
            return controller.HasValue && IsDoubleClick(button, controller.Value);
              }
        }
Example #39
0
        internal void MoveFocus(UIControl control, LogicalPlayerIndex allowedPlayer)
        {
            // Called by the UIControl after UIControl.OnHandleInput.

              if (control == null)
            return;

              var inputService = InputService;

              // Handle AutoUnfocus.
              if (control.AutoUnfocus && FocusedControl != null)
              {
            if (inputService.IsPressed(MouseButtons.Left, false) || inputService.IsPressed(MouseButtons.Right, false))
            {
              if (control == FocusScope && !FocusedControl.IsMouseOver                     // E.g. a window and not the focused control is clicked.
              || control.IsMouseDirectlyOver && !inputService.IsMouseOrTouchHandled)   // E.g. a screen and no child UIControl is clicked.
              {
            ClearFocus();
              }
            }
              }

              // Only focus scopes handle focus movement.
              // And only the current focus scope (which means the first focus scope in the hierarchy).
              if (!control.IsFocusScope || FocusScope != null && control != FocusScope)
            return;

              bool moveLeft = false;
              bool moveRight = false;
              bool moveUp = false;
              bool moveDown = false;

              // Check arrow keys.
              if (!inputService.IsKeyboardHandled)
              {
            // This focus scope "absorbs" arrow keys.
            if (inputService.IsDown(Keys.Left)
            || inputService.IsDown(Keys.Right)
            || inputService.IsDown(Keys.Up)
            || inputService.IsDown(Keys.Down))
            {
              inputService.IsKeyboardHandled = true;

            if (inputService.IsPressed(Keys.Left, true))
              moveLeft = true;
            else if (inputService.IsPressed(Keys.Right, true))
              moveRight = true;
            else if (inputService.IsPressed(Keys.Up, true))
              moveUp = true;
            else if (inputService.IsPressed(Keys.Down, true))
              moveDown = true;
            }
              }

            #if !SILVERLIGHT
              // Check left thumb stick and d-pad.
              if (!moveLeft && !moveRight && !moveUp && !moveDown && !inputService.IsGamePadHandled(allowedPlayer))
              {
            if (inputService.IsDown(Buttons.LeftThumbstickLeft, allowedPlayer)
            || inputService.IsDown(Buttons.LeftThumbstickRight, allowedPlayer)
            || inputService.IsDown(Buttons.LeftThumbstickUp, allowedPlayer)
            || inputService.IsDown(Buttons.LeftThumbstickDown, allowedPlayer)
            || inputService.IsDown(Buttons.DPadLeft, allowedPlayer)
            || inputService.IsDown(Buttons.DPadRight, allowedPlayer)
            || inputService.IsDown(Buttons.DPadUp, allowedPlayer)
            || inputService.IsDown(Buttons.DPadDown, allowedPlayer))
            {
              inputService.SetGamePadHandled(allowedPlayer, true);

            if (inputService.IsPressed(Buttons.LeftThumbstickLeft, true, allowedPlayer) || inputService.IsPressed(Buttons.DPadLeft, true, allowedPlayer))
              moveLeft = true;
            else if (inputService.IsPressed(Buttons.LeftThumbstickRight, true, allowedPlayer) || inputService.IsPressed(Buttons.DPadRight, true, allowedPlayer))
              moveRight = true;
            else if (inputService.IsPressed(Buttons.LeftThumbstickUp, true, allowedPlayer) || inputService.IsPressed(Buttons.DPadUp, true, allowedPlayer))
              moveUp = true;
            else if (inputService.IsPressed(Buttons.LeftThumbstickDown, true, allowedPlayer) || inputService.IsPressed(Buttons.DPadDown, true, allowedPlayer))
              moveDown = true;
            }
              }
            #endif

              // Now, we know in which direction the focus should move.

              if (!moveLeft && !moveRight && !moveUp && !moveDown)
            return;

              // Collect all focusable controls.
              _focusableControls.Clear();
              GetFocusableControls(control);
              if (_focusableControls.Count == 0)
            return;

              // Call virtual method that does the job.
              var target = OnMoveFocus(moveLeft, moveRight, moveUp, moveDown, _focusableControls);

              Focus(target);

              _focusableControls.Clear();
        }
Example #40
0
 //--------------------------------------------------------------
 /// <inheritdoc/>
 public PlayerIndex? GetLogicalPlayer(LogicalPlayerIndex player)
 {
     // For efficiency: No boundary checks - array will throw exception anyways.
       int index = (int)player;
       return _logicalPlayers[index];
 }
Example #41
0
        /// <inheritdoc/>
        public bool IsDown(Buttons button, LogicalPlayerIndex player)
        {
            if (player == LogicalPlayerIndex.Any)
              {
            // Check game controllers of all players.
            foreach (PlayerIndex? controller in _logicalPlayers)
              if (controller.HasValue && IsDown(ref _newGamePadStates[(int)controller.Value], button))
            return true;

            return false;
              }
              else
              {
            PlayerIndex? controller = _logicalPlayers[(int)player];
            return controller.HasValue && IsDown(ref _newGamePadStates[(int)controller.Value], button);
              }
        }
Example #42
0
        /// <inheritdoc/>
        public bool IsUp(Buttons button, LogicalPlayerIndex player)
        {
            if (player == LogicalPlayerIndex.Any)
              {
            // Check game controllers of all players.
            bool isUp = true;
            foreach (PlayerIndex? controller in _logicalPlayers)
            {
              if (controller.HasValue)
              {
            if (!IsDown(ref _newGamePadStates[(int)controller.Value], button))
              return true;

            isUp = false;
              }
            }

            return isUp;
              }
              else
              {
            PlayerIndex? controller = _logicalPlayers[(int)player];
            if (controller.HasValue)
              return !IsDown(ref _newGamePadStates[(int)controller.Value], button);

            return true;
              }
        }
Example #43
0
        internal void MoveFocus(UIControl control, LogicalPlayerIndex allowedPlayer)
        {
            // Called by the UIControl after UIControl.OnHandleInput.

            if (control == null)
            {
                return;
            }

            var inputService = InputService;

            // Handle AutoUnfocus.
            if (control.AutoUnfocus && FocusedControl != null)
            {
                if (inputService.IsPressed(MouseButtons.Left, false) || inputService.IsPressed(MouseButtons.Right, false))
                {
                    if (control == FocusScope && !FocusedControl.IsMouseOver ||             // E.g. a window and not the focused control is clicked.
                        control.IsMouseDirectlyOver && !inputService.IsMouseOrTouchHandled) // E.g. a screen and no child UIControl is clicked.
                    {
                        ClearFocus();
                    }
                }
            }

            // Only focus scopes handle focus movement.
            // And only the current focus scope (which means the first focus scope in the hierarchy).
            if (!control.IsFocusScope || FocusScope != null && control != FocusScope)
            {
                return;
            }

            bool moveLeft  = false;
            bool moveRight = false;
            bool moveUp    = false;
            bool moveDown  = false;

            // Check arrow keys.
            if (!inputService.IsKeyboardHandled)
            {
                // This focus scope "absorbs" arrow keys.
                if (inputService.IsDown(Keys.Left) ||
                    inputService.IsDown(Keys.Right) ||
                    inputService.IsDown(Keys.Up) ||
                    inputService.IsDown(Keys.Down))
                {
                    inputService.IsKeyboardHandled = true;

                    if (inputService.IsPressed(Keys.Left, true))
                    {
                        moveLeft = true;
                    }
                    else if (inputService.IsPressed(Keys.Right, true))
                    {
                        moveRight = true;
                    }
                    else if (inputService.IsPressed(Keys.Up, true))
                    {
                        moveUp = true;
                    }
                    else if (inputService.IsPressed(Keys.Down, true))
                    {
                        moveDown = true;
                    }
                }
            }

#if !SILVERLIGHT
            // Check left thumb stick and d-pad.
            if (!moveLeft && !moveRight && !moveUp && !moveDown && !inputService.IsGamePadHandled(allowedPlayer))
            {
                if (inputService.IsDown(Buttons.LeftThumbstickLeft, allowedPlayer) ||
                    inputService.IsDown(Buttons.LeftThumbstickRight, allowedPlayer) ||
                    inputService.IsDown(Buttons.LeftThumbstickUp, allowedPlayer) ||
                    inputService.IsDown(Buttons.LeftThumbstickDown, allowedPlayer) ||
                    inputService.IsDown(Buttons.DPadLeft, allowedPlayer) ||
                    inputService.IsDown(Buttons.DPadRight, allowedPlayer) ||
                    inputService.IsDown(Buttons.DPadUp, allowedPlayer) ||
                    inputService.IsDown(Buttons.DPadDown, allowedPlayer))
                {
                    inputService.SetGamePadHandled(allowedPlayer, true);

                    if (inputService.IsPressed(Buttons.LeftThumbstickLeft, true, allowedPlayer) || inputService.IsPressed(Buttons.DPadLeft, true, allowedPlayer))
                    {
                        moveLeft = true;
                    }
                    else if (inputService.IsPressed(Buttons.LeftThumbstickRight, true, allowedPlayer) || inputService.IsPressed(Buttons.DPadRight, true, allowedPlayer))
                    {
                        moveRight = true;
                    }
                    else if (inputService.IsPressed(Buttons.LeftThumbstickUp, true, allowedPlayer) || inputService.IsPressed(Buttons.DPadUp, true, allowedPlayer))
                    {
                        moveUp = true;
                    }
                    else if (inputService.IsPressed(Buttons.LeftThumbstickDown, true, allowedPlayer) || inputService.IsPressed(Buttons.DPadDown, true, allowedPlayer))
                    {
                        moveDown = true;
                    }
                }
            }
#endif

            // Now, we know in which direction the focus should move.

            if (!moveLeft && !moveRight && !moveUp && !moveDown)
            {
                return;
            }

            // Collect all focusable controls.
            _focusableControls.Clear();
            GetFocusableControls(control);
            if (_focusableControls.Count == 0)
            {
                return;
            }

            // Call virtual method that does the job.
            var target = OnMoveFocus(moveLeft, moveRight, moveUp, moveDown, _focusableControls);

            Focus(target);

            _focusableControls.Clear();
        }
Example #44
0
 /// <inheritdoc/>
 public void SetLogicalPlayer(LogicalPlayerIndex player, PlayerIndex? controller)
 {
     // For efficiency: No boundary checks - array will throw exception anyways.
       int index = (int)player;
       _logicalPlayers[index] = controller;
 }
Example #45
0
 public Player(LogicalPlayerIndex index, PlayerIndex controller)
 {
     this.index      = index;
     this.Controller = controller;
 }
Example #46
0
 public MouseDevice(LogicalPlayerIndex logicalPlayerIndex)
     : base(logicalPlayerIndex, DeviceType.Mouse, 0)
 {
 }