/// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="engine">The engine using the controller.</param>
 public PCControllerInput(Engine engine)
 {
     engine_ = engine;
     inputs_ = InputSet.getInstance();
 }
 /// <summary>
 /// Default constructor; assigns itself to Player One's input device.
 /// </summary>
 /// <param name="engine">The engine using the controller.</param>
 public X360ControllerInput(Engine engine)
 {
     engine_ = engine;
     player_ = PlayerIndex.One;
     inputs_ = InputSet.getInstance();
 }
 /// <summary>
 /// Constructor which allows specification of a player.
 /// </summary>
 /// <param name="engine">The engine using the controller.</param>
 /// <param name="player">The player whose input should be read.</param>
 public X360ControllerInput(Engine engine, PlayerIndex player)
 {
     engine_ = engine;
     player_ = player;
     inputs_ = InputSet.getInstance(player);
 }
Beispiel #4
0
        /// <summary>
        /// Statically creates an InputSet for four different players.
        /// </summary>
        static InputSet()
        {
            instances_ = new InputSet[4];

            // Not expensive to create 4 InputSets, so we aren't
            // worried about lazy instantiation.  If we instantiate
            // them now, and later we use multithreading, we won't
            // have to use sync locks - just pull the InputSet and
            // read from it.
            for (int i = 0; i < 4; i++)
            {
                instances_[i] = new InputSet();
            }
        }