Esempio n. 1
0
    /// <summary>
    /// Inputのインターフェースを作成
    /// </summary>
    /// <param name="id">ユーザーID</param>
    /// <param name="type">入力のタイプ</param>
    /// <returns>作成成功か?</returns>
    public static bool CreateInterface(UserID id, XVInputType type)
    {
        int i = (int)id;

        switch (type)
        {
        case XVInputType.None:
            XLogger.LogWarning("Create interface= XVInputNone: id= " + i.ToString());
            m_input[i] = new XVInputNone();
            break;

        case XVInputType.Keyboard:
            XLogger.Log("Create interface= XVInputKeyboard: id= " + i.ToString());
            m_input[i] = new XVInputKeyboard();
            break;

        case XVInputType.Controller:
#if DEBUG
            if (XVInput.GetConnectedNum() == 0)
            {
                if (id == UserID.User1)
                {
                    m_input[i] = new XVInputKeyboard();
                    XLogger.LogWarning("Debug Create interface= XVInputKeyboard: id= " + i.ToString());
                    return(true);
                }
            }
#endif
            XLogger.Log("Create interface= XVInputController: id= " + i.ToString());
            m_input[i] = new XVInputController(id);
            break;
        }

        return(true);
    }
Esempio n. 2
0
    /// <summary>
    /// XBoxInputのインターフェースを作成
    /// </summary>
    /// <param name="id">ユーザーID</param>
    /// <param name="type">XBoxInputのUserID</param>
    /// <returns>作成成功か?</returns>
    public static bool CreateXBoxInterface(UserID id, XBoxInput.XBKeyCode.UserCode user)
    {
        int i = (int)id;

        XLogger.Log("Create interface= XVInputController: id= " + i.ToString());
        m_input[i] = new XVInputController(user);

        return(true);
    }