示例#1
0
        /// <summary>
        /// Statically creates an InputSet for four different players.
        /// </summary>
        static InputSet()
        {
            s_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++)
            {
                s_instances[i] = new InputSet();
            }
        }
示例#2
0
 /// <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);
 }
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="engine">The engine using the controller.</param>
 public PCControllerInput(Engine engine)
 {
     engine_ = engine;
     inputs_ = InputSet.getInstance();
 }
示例#4
0
 /// <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();
 }