Пример #1
0
        /// <summary>
        /// A constructor.
        /// </summary>
        /// <param name="e_game_type">A type of a game</param>
        /// <param name="queryString">URL query string</param>
        /// <param name="userSessionID">User's session ID from Session object</param>
        /// <param name="gameSessionID">Game session ID</param>
        public GameServiceProxy(EGameType e_game_type, string queryString, string userSessionID, string gameSessionID, HttpSessionState Session)
        {
            if (GS == null)
            {
                GS = new com.sanuko.www.GameService();
            }

            if (gameSessionID == null)
            {
                this.gameSessionID = "";
            }
            else
            {
                this.gameSessionID = gameSessionID;
            }

            this.Session = Session;

            this.e_game_type = e_game_type;
            this.queryString = queryString.Replace("?", "").Replace("&", ";");
            if (userSessionID == null)
            {
                this.userSessionID = "";
            }
            else
            {
                this.userSessionID = userSessionID;
            }
        }
 private void DetermineVoteGameType()
 {
     m_voteForGameType = EGameType.CENTERBOTTOM;
     if (this.transform.position.y > UnityTracking.TrackingAdapter.TargetScreenHeight / 2)
     {
         if (
             this.transform.position.x > 0 &&
             this.transform.position.x < (UnityTracking.TrackingAdapter.TargetScreenWidth / 3 * 1)
             )
         {
             m_voteForGameType = EGameType.LEFTTOP;
         }
         else if (
             this.transform.position.x > (UnityTracking.TrackingAdapter.TargetScreenWidth / 3 * 1) &&
             this.transform.position.x < (UnityTracking.TrackingAdapter.TargetScreenWidth / 3 * 2)
             )
         {
             m_voteForGameType = EGameType.CENTERTOP;
         }
         else if (
             this.transform.position.x > (UnityTracking.TrackingAdapter.TargetScreenWidth / 3 * 2) &&
             this.transform.position.x < (UnityTracking.TrackingAdapter.TargetScreenWidth)
             )
         {
             m_voteForGameType = EGameType.RIGHTTOP;
         }
     }
     else
     {
         if (
             this.transform.position.x > 0 &&
             this.transform.position.x < (UnityTracking.TrackingAdapter.TargetScreenWidth / 3 * 1)
             )
         {
             m_voteForGameType = EGameType.LEFTBOTTOM;
         }
         else if (
             this.transform.position.x > (UnityTracking.TrackingAdapter.TargetScreenWidth / 3 * 1) &&
             this.transform.position.x < (UnityTracking.TrackingAdapter.TargetScreenWidth / 3 * 2)
             )
         {
             m_voteForGameType = EGameType.CENTERBOTTOM;
         }
         else if (
             this.transform.position.x > (UnityTracking.TrackingAdapter.TargetScreenWidth / 3 * 2) &&
             this.transform.position.x < (UnityTracking.TrackingAdapter.TargetScreenWidth)
             )
         {
             m_voteForGameType = EGameType.RIGHTBOTTOM;
         }
     }
 }
Пример #3
0
        /// <summary>
        /// 向服务器发送匹配请求
        /// </summary>
        /// <returns></returns>
        private bool SendMatchReq()
        {
            //取得选择的地图id
            uint uMapId = Singleton <RoomManager> .singleton.MapId;
            //取得选择的匹配类型
            // EMatchtype eMatchType = this.m_eMatchType;
            EGameType eMatchType = this.m_eMatchType;

            //发送请求
            Singleton <NetworkManager> .singleton.SendMatchReq(uMapId, eMatchType, EAIDifficulty.AI_DIFFICULTY_EASY);

            return(true);
        }
Пример #4
0
    //—————————————————— 事件 ——————————————————



    private void E_Show(EGameType type, ResultBean resultBean)           // 显示单图信息
    {
        mCurrentGameType = type;
        mCurrentFile     = resultBean.File;
        mUIGameObject.SetActive(true);
        tx_InfoName.text = resultBean.SP.name;
        sp_Image.sprite  = resultBean.SP;
        tx_HuoZhui.text  = resultBean.File.Extension;
        tx_Size.text     = resultBean.Width + " x " + resultBean.Height;
        yuanLaiWidth     = resultBean.Width;
        yuanLaiHidth     = resultBean.Height;
        SetTuSize(yuanLaiWidth, yuanLaiHidth);
    }
Пример #5
0
        //-----------------------------------------------------------------------------------
        public bool EnterMatch(EGameType eType)
        {
            Debug.Assert(m_eCurGameType == EGameType.UNDEFINED);
            if (PhotonNetwork.connectionStateDetailed != ClientState.ConnectedToMaster)
            {
                Debug.LogError("EnterMatch: the game is not connected to master");
                return(false);
            }
            Debug.Log("EnterMatch: connected to " + PhotonNetwork.ServerAddress);
            m_eCurGameType = eType;

            TypedLobby lobby = new TypedLobby(eType.ToString(), LobbyType.AsyncRandomLobby);

            return(PhotonNetwork.JoinLobby(lobby));
        }
        public GameCreateViewModel(string name, EGameType type, string description, long idOwner)
        {
            this.Name        = name;
            this.Type        = type;
            this.Description = description;
            this.IdOwner     = idOwner;
            this.Available   = true;

            AddNotifications(
                new Contract()
                .Requires()
                .HasMaxLen(Name, 60, "Name", "O nome deve conter até 60 caracteres")
                .HasMinLen(Name, 3, "Name", "O nome deve conter pelo menos 3 caracteres")
                .HasMaxLen(Description, 200, "Description", "A descriçao deve conter até 200 caracteres")
                );
        }
Пример #7
0
    private void E_OnSureGaiMing(EGameType type, string changeNamne)                   // 确定改名
    {
        switch (type)
        {
        case EGameType.XuLieTu222:
            tx_DuoXLT222_1.text = Ctrl_UserInfo.Instance.BottomXuLeTu222Name[0];
            tx_DuoXLT222_2.text = Ctrl_UserInfo.Instance.BottomXuLeTu222Name[1];
            tx_DuoXLT222_3.text = Ctrl_UserInfo.Instance.BottomXuLeTu222Name[2];
            tx_DuoXLT222_4.text = Ctrl_UserInfo.Instance.BottomXuLeTu222Name[3];
            tx_DuoXLT222_5.text = Ctrl_UserInfo.Instance.BottomXuLeTu222Name[4];
            break;

        case EGameType.JiHeXuLieTu:

            tx_DuoJHXuLie1.text = Ctrl_UserInfo.Instance.BottomJiHeXLTName[0];
            tx_DuoJHXuLie2.text = Ctrl_UserInfo.Instance.BottomJiHeXLTName[1];
            tx_DuoJHXuLie3.text = Ctrl_UserInfo.Instance.BottomJiHeXLTName[2];
            tx_DuoJHXuLie4.text = Ctrl_UserInfo.Instance.BottomJiHeXLTName[3];
            tx_DuoJHXuLie5.text = Ctrl_UserInfo.Instance.BottomJiHeXLTName[4];
            break;

        case EGameType.TaoMingTu:

            tx_DuoTaoMing1.text = Ctrl_UserInfo.Instance.BottomTaoMingName[0];
            tx_DuoTaoMing2.text = Ctrl_UserInfo.Instance.BottomTaoMingName[1];
            tx_DuoTaoMing3.text = Ctrl_UserInfo.Instance.BottomTaoMingName[2];
            tx_DuoTaoMing4.text = Ctrl_UserInfo.Instance.BottomTaoMingName[3];
            tx_DuoTaoMing5.text = Ctrl_UserInfo.Instance.BottomTaoMingName[4];
            break;

        case EGameType.NormalTu:
            tx_DuoJpg1.text = Ctrl_UserInfo.Instance.BottomJpgName[0];
            tx_DuoJpg2.text = Ctrl_UserInfo.Instance.BottomJpgName[1];
            tx_DuoJpg3.text = Ctrl_UserInfo.Instance.BottomJpgName[2];
            tx_DuoJpg4.text = Ctrl_UserInfo.Instance.BottomJpgName[3];
            tx_DuoJpg5.text = Ctrl_UserInfo.Instance.BottomJpgName[4];
            break;

        case EGameType.JiHeTu:
            tx_DuoJiHe1.text = Ctrl_UserInfo.Instance.BottomJiHeName[0];
            tx_DuoJiHe2.text = Ctrl_UserInfo.Instance.BottomJiHeName[1];
            tx_DuoJiHe3.text = Ctrl_UserInfo.Instance.BottomJiHeName[2];
            tx_DuoJiHe4.text = Ctrl_UserInfo.Instance.BottomJiHeName[3];
            tx_DuoJiHe5.text = Ctrl_UserInfo.Instance.BottomJiHeName[4];
            break;
        }
    }
Пример #8
0
    //—————————————————— 事件 ——————————————————


    private void E_Show(EGameType type, ResultBean[] resultBeans)                     // 显示
    {
        mCurrentType         = type;
        l_CurrentResultBeans = resultBeans;
        mUIGameObject.SetActive(true);
        tx_InfoName.text = resultBeans[0].SP.name;
        tx_InfoNum.text  = resultBeans.Length.ToString();

        // 设置图
        anim_Tu.ChangeAnim(GetSpriteList(resultBeans));
        yuanLaiWidth = resultBeans[0].Width;
        yuanLaiHidth = resultBeans[0].Height;
        SetTuSize(yuanLaiWidth, yuanLaiHidth);


        Ctrl_Coroutine.Instance.StartCoroutine(LoadInfoItem(resultBeans));
    }
        public GameUpdateViewModel(long id, string name, EGameType type, string description, long idOwner, bool avaliable)
        {
            this.Id          = id;
            this.Name        = name;
            this.Type        = type;
            this.Description = description;
            this.IdOwner     = idOwner;
            this.Available   = avaliable;
            this.UpdateAt    = DateTime.UtcNow;

            AddNotifications(
                new Contract()
                .Requires()
                .IsGreaterThan(Id, 0, "Game ID", "Para alteração, o ID do jogo é obrigatório")
                .HasMaxLen(Name, 60, "Name", "O nome deve conter até 60 caracteres")
                .HasMinLen(Name, 3, "Name", "O nome deve conter pelo menos 3 caracteres")
                .HasMaxLen(Description, 60, "Description", "A descriçao deve conter até 200 caracteres")
                );
        }
Пример #10
0
    private void E_OnDuoTuDaoRu(EGameType type, ushort index, List <ResultBean> resultBeans, bool isFromDaoRu)       // 点击了信息页的导入
    {
        if (isFromDaoRu)
        {
            // 把导入的都变成绿色字体
            foreach (ResultBean resultBean in resultBeans)
            {
                foreach (GameObject go in chooseGOK_BgV.Keys)
                {
                    if (resultBean == allGoK_ResultBeanV[go])
                    {
                        go.transform.Find("Text").GetComponent <Text>().color = Color.green;
                        break;
                    }
                }
            }

            // 清空选择
            ClearAllChooseZhong();
        }
    }
Пример #11
0
    //————————————————————————————————————

    private void E_DelteTrue(EGameType type)               // 真的删除
    {
        if (type == EGameType.XuLieTu)
        {
            switch (mCurrentIndex)
            {
            case EXuLieTu.G4Two_Heng:
            case EXuLieTu.G4Two_Shu:
                DeleteOneLine(EXuLieTu.G4Two_Heng);
                DeleteOneLine(EXuLieTu.G4Two_Shu);
                break;

            case EXuLieTu.G5Three_Heng:
            case EXuLieTu.G5Three_Shu:
                DeleteOneLine(EXuLieTu.G5Three_Heng);
                DeleteOneLine(EXuLieTu.G5Three_Shu);
                break;

            default:
                DeleteOneLine(mCurrentIndex);
                break;
            }
        }
    }
Пример #12
0
        private void CountVotes()
        {
            List <Player> playerList = (PlayerManager.Instance as PlayerManager).GetPlayerList();

            foreach (Player player in playerList)
            {
                m_voteDict[player.VoteForGameType] = m_voteDict[player.VoteForGameType] + 1;
            }

            m_maxValue       = 0;
            m_winnerGameType = EGameType.CENTERBOTTOM;

            foreach (KeyValuePair <EGameType, int> entry in m_voteDict)
            {
                // center bottom can't be winning
                if (entry.Key == EGameType.CENTERBOTTOM)
                {
                    continue;
                }
                if (entry.Value > m_maxValue)
                {
                    m_winnerGameType = entry.Key;
                    m_maxValue       = entry.Value;
                }
            }
            foreach (KeyValuePair <EGameType, int> entry in m_voteDict)
            {
                // center bottom can't be winning
                if (entry.Key == EGameType.CENTERBOTTOM)
                {
                    continue;
                }
                if (entry.Value == m_maxValue)
                {
                    m_drawGameTypes.Add(entry.Key);
                }
            }

            if (m_drawGameTypes.Count > 1)
            {
                if (m_maxValue >= 1)
                {
                    Debug.Log("--- Voting draw ---");
                    m_winnerGameType = m_drawGameTypes[Random.Range(0, m_drawGameTypes.Count)];
                }
                else                 // if there are no votes for an actual game
                {
                    m_winnerGameType = EGameType.CENTERBOTTOM;
                }
            }

            Debug.Log(string.Format("--- Voting winner: {0} with {1} votes ---", m_winnerGameType, m_maxValue));

            switch (m_winnerGameType)
            {
            case EGameType.LEFTTOP:
                m_loadSceneName = m_SceneNameLeftTop;
                m_maskLeftTopSprite.GetComponent <Renderer>().enabled = true;
                break;

            case EGameType.CENTERTOP:
                m_loadSceneName = m_SceneNameCenterTop;
                m_maskCenterTopSprite.GetComponent <Renderer>().enabled = true;
                break;

            case EGameType.RIGHTTOP:
                m_loadSceneName = m_SceneNameRightTop;
                m_maskRightTopSprite.GetComponent <Renderer>().enabled = true;
                break;

            case EGameType.LEFTBOTTOM:
                m_loadSceneName = m_SceneNameLeftBottom;
                m_maskLeftBottomSprite.GetComponent <Renderer>().enabled = true;
                break;

            case EGameType.RIGHTBOTTOM:
                m_loadSceneName = m_SceneNameRightBottom;
                m_maskRightBottomSprite.GetComponent <Renderer>().enabled = true;
                break;

            case EGameType.CENTERBOTTOM:
                m_loadSceneName = Application.loadedLevelName;
                break;

            default:
                m_loadSceneName = Application.loadedLevelName;
                break;
            }
            m_nextGameDecided = true;
        }
Пример #13
0
        /// <summary>
        /// PageInfo class constructor. 
        /// </summary>
        /// <param name="e_game_type">Game type enum value.</param>
        /// <param name="style_name">A color name.</param>
        /// <param name="Master">An instance of Game.master page class.</param>
        /// <param name="Session">User State Session object.</param>
        public PageInfo(MasterPage Master, EGameType e_game_type, string style_name, string queryString, string userSessionID, string gameSessionID, HttpSessionState Session)
        {
            /**
             * Create new instance of GameServiceProxy class to provide access to web service methods.
             **/
            _GSP = new GameServiceProxy(e_game_type, queryString, userSessionID, gameSessionID, Session);

            /**
             * Get gameSessionID from web service.
             **/
            this.gameSessionID = _GSP.createGameSession();

            /**
             * Set Session parameters.
             */
            this.userSessionID = userSessionID;

            /**
             * Get XML data from service.
             **/
            _GSP.getXMLdata();

            /**
             * Setting private Game.master instance variable.
             **/
            _Master = new MasterProxy(Master);

            /**
             * Receive XmlDocument instance from GameServiceProxy.
             **/
            XMLDoc = _GSP.xmlData;

            /**
             * Convert XML to JSON string.
             **/
            JSONString = JsonConvert.SerializeXmlNode(XMLDoc);
            /**
             * Setting version string variable.
             */
            version = _getVersion();

            /**
             * Color postfixes for file names.
             **/
            string colorPostfix = "",
                   pathPostfix = "";

            /**
             * Setting color postfixes in depend on style_name value.
             **/
            switch (style_name)
            {
                case "orange":
                    colorPostfix = "orange";
                    pathPostfix = "-orange";
                    break;

                case "blue":
                    colorPostfix = "blue";
                    pathPostfix = "-blue";
                    break;

                case "cyan":
                    colorPostfix = "cyan";
                    pathPostfix = "-cyan";
                    break;

                case "purple":
                    colorPostfix = "purple";
                    pathPostfix = "-purple";
                    break;

                default:
                    colorPostfix = "default";
                    pathPostfix = "";
                    break;
            }

            /**
             * Launching private method to set public field values.
             **/
            setColorValues("css/css-game-" + colorPostfix + ".css", "images" + pathPostfix);

            /**
             * Launching private method to set field value in depend on e_game_type value.
             **/
            switch (e_game_type)
            {
                case EGameType.GT_FILL_IN_THE_BLANKS:
                    setGameTypeValues("Fill in the blanks", "css/fill_intheblank_style.css",
                          "css/fill-" + colorPostfix + ".css", "js-games/FillInTheBlanks.js");
                    break;

                case EGameType.GT_QUIZ_MAKER:
                    setGameTypeValues("Quiz Game", "css/quiz-game-style.css",
                          "css/quiz-" + colorPostfix + ".css", "js-games/QuizGame.js");
                    break;

                case EGameType.GT_MEMORY_GAME:
                    setGameTypeValues("Memory Game", "css/memory-game-style.css",
                          "css/memory-" + colorPostfix + ".css", "js-games/MemoryGame.js");
                    break;

                case EGameType.GT_WORD_SCRAMBLE:
                    setGameTypeValues("Word Scramble", "css/word-scramble-style.css",
                          "css/wordscramble-" + colorPostfix + ".css", "js-games/WordScramble.js");
                    break;

                case EGameType.GT_LABEL_GAME:
                    setGameTypeValues("Label Game", "css/label-game-style.css",
                          "css/label-" + colorPostfix + ".css", "js-games/LabelGame.js");
                    break;

                case EGameType.GT_LINE_MATCHING:
                    setGameTypeValues("Line Matching", "css/line-matching-style.css",
                          "css/line-" + colorPostfix + ".css", "js-games/LineMatching.js");
                    break;

                case EGameType.GT_SUPER_TYPER:
                    setGameTypeValues("Fast Typing Game", "css/fast-typing-style.css",
                          "css/fast-typing-" + colorPostfix + ".css", "js-games/SuperTyper.js");
                    break;
            }
        }
Пример #14
0
        public static XmlDocument GetGameData(EGameType e_game_type, int num_of_questions, Int64 ContentID)
        {
            string UserSessionID = "";
            string GameSessionID = "";

            // debug only
            StreamWriter stream = null;

            XmlDocument game_data_doc = null;

            // connect to the login web service.
            // if the login succeed, use CreateNewGameSession web service in order to get unique session for the game.
            // if game session is created, use StartPlayGame web service to get the game's data (in xml format)
            // for debugging: if the game is started sucessfully, the game-data XML is saved locally for debugging.
            // This file can also being used when the server is down.

            UserSessionID = GameUtility.Login("xxx", "yyy");

            if (UserSessionID != "")
            {
                GameSessionID = GameUtility.CreateNewGameSession(UserSessionID, e_game_type, num_of_questions, ContentID);

                if (GameSessionID != "")
                {
                    //Response.Write("<h1>Game Session=" + GameSessionID + "</h1>");

                    // "play" game
                    game_data_doc = GameUtility.StartPlayGame(UserSessionID, GameSessionID);

                    if (game_data_doc != null)
                    {
                        // save into local file
                        try
                        {
                            stream = File.CreateText("c:\\temp\\game_data.xml");
                            stream.Write(game_data_doc.InnerXml);
                            stream.Close();
                        }
                        catch
                        {
                        }

                    }
                }
            }

            // When server is down, it possible to get the XML file from local HD

            if (game_data_doc == null)
            {
                // load game from local file (Developer only)
                game_data_doc = new XmlDocument();

                switch (e_game_type)
                {
                    case EGameType.GT_FILL_IN_THE_BLANKS:
                        game_data_doc.Load("C:\\projects\\LearnThaiIsFun\\game_data_demo\\FillInTheBlanks.xml");
                        break;

                    case EGameType.GT_QUIZ_MAKER:
                        game_data_doc.Load("C:\\projects\\LearnThaiIsFun\\game_data_demo\\QuizGame.xml");
                        break;

                    case EGameType.GT_MEMORY_GAME:
                        game_data_doc.Load("C:\\projects\\LearnThaiIsFun\\game_data_demo\\MemoryGame.xml");
                        break;

                    case EGameType.GT_WORD_SCRAMBLE:
                        game_data_doc.Load("C:\\projects\\LearnThaiIsFun\\game_data_demo\\WordScramble.xml");
                        break;

                    case EGameType.GT_LABEL_GAME:
                        game_data_doc.Load("C:\\projects\\LearnThaiIsFun\\game_data_demo\\LabelGame.xml");
                        break;

                    case EGameType.GT_LINE_MATCHING:
                        game_data_doc.Load("C:\\projects\\LearnThaiIsFun\\game_data_demo\\LineMatching.xml");
                        break;

                    case EGameType.GT_SUPER_TYPER:
                        game_data_doc.Load("C:\\projects\\LearnThaiIsFun\\game_data_demo\\fast_typing.xml");
                        break;
                }

            }

            return game_data_doc;
        }
Пример #15
0
        public static string CreateNewGameSession(string UserSessionID, EGameType e_game_type, int num_of_questions, Int64 ContentID)
        {
            string GameSessionID = "";
            string game_params = "";

            GameWebService.GameService ServiceProxy;
            WebGames.GameWebService.WebServiceResult res = null;

            //Game.UserSessionID = UserSessionID;
               // Game.GameSessionID = "";

            try
            {
                ServiceProxy = GetGameService();

                game_params = "QCTR=" + num_of_questions;

                if (ContentID > 0)
                    game_params = ";CID=" + ContentID;

                switch (e_game_type)
                {
                    case EGameType.GT_QUIZ_MAKER:
                        res = ServiceProxy.CreateNewGame(UserSessionID, (Int16)EGameType.GT_QUIZ_MAKER.GetHashCode(),
                                 "DQM=true", 0, "");
                        break;

                    case EGameType.GT_SUPER_TYPER:
                        res = ServiceProxy.CreateNewGame(UserSessionID, (Int16)EGameType.GT_SUPER_TYPER.GetHashCode(),
                            game_params, 0, "");
                        break;

                    case EGameType.GT_WORD_SCRAMBLE:
                        res = ServiceProxy.CreateNewGame(UserSessionID, (Int16)EGameType.GT_WORD_SCRAMBLE.GetHashCode(),
                            game_params, 0, "");
                        break;

                    case EGameType.GT_FILL_IN_THE_BLANKS:
                        res = ServiceProxy.CreateNewGame(UserSessionID, (Int16)EGameType.GT_FILL_IN_THE_BLANKS.GetHashCode(),
                                 "CID=50242", 0, "");
                        break;

                    default:
                        res = new WebGames.GameWebService.WebServiceResult();
                        res.ErrorCode = EWebErrorCodes.WEBERR_NOT_SUPPORTED.GetHashCode();
                        break;

                }

                if (res.ErrorCode == EWebErrorCodes.WEBERR_OK.GetHashCode())
                {
                    GameSessionID = res.StringResult;
                    //Game.GameSessionID = GameSessionID;

                }
            }
            catch
            {
            }

            return GameSessionID;
        }
Пример #16
0
 void C_Menu_PlayeVsPlayerStart(object sender, EventArgs e)
 {
     _gameType = EGameType.FurmGame;
     C_TwoPlayerGrid.Visibility = Windows.UI.Xaml.Visibility.Visible;
 }
Пример #17
0
    //—————————————————— 事件 ——————————————————

    private void E_OnToggleChange(EGameType type, int choose)                  // 切换左边选项
    {
        switch (mCurrentType)
        {
        case EGameType.XuLieTu:
            go_XuLieChoose1.SetActive(false);
            go_XuLieChoose2.SetActive(false);
            break;

        case EGameType.XuLieTu222:
            go_XuLie222Choose1.SetActive(false);
            go_XuLie222Choose2.SetActive(false);
            break;

        case EGameType.JiHeXuLieTu:
            go_JiHeXuLieTuChoose1.SetActive(false);
            go_JiHeXuLieTuChoose2.SetActive(false);
            break;

        case EGameType.TaoMingTu:
            go_TaoMingChoose1.SetActive(false);
            go_TaoMingChoose2.SetActive(false);
            break;

        case EGameType.NormalTu:
            go_NormalChoose1.SetActive(false);
            go_NormalChoose2.SetActive(false);
            break;

        case EGameType.JiHeTu:
            go_JiHeChoose1.SetActive(false);
            go_JiHeChoose2.SetActive(false);
            break;

        case EGameType.Audio:
            go_AudioChoose1.SetActive(false);
            go_AudioChoose2.SetActive(false);
            break;

        case EGameType.DaoRu:
            go_DaoRuChoose1.SetActive(false);
            go_DaoRuChoose2.SetActive(false);
            break;

        case EGameType.Search:
            go_SearchChoose1.SetActive(false);
            go_SearchChoose2.SetActive(false);
            break;
        }
        sub_Audio.ChangeOtherPage();
        switch (type)
        {
        case EGameType.XuLieTu:
            go_XuLieChoose1.SetActive(true);
            go_XuLieChoose2.SetActive(true);
            if (choose > 0)
            {
                sub_XuLieTu1.Show(choose);
            }
            d9_RightContant.Change2One();
            break;

        case EGameType.XuLieTu222:
            go_XuLie222Choose1.SetActive(true);
            go_XuLie222Choose2.SetActive(true);
            if (choose > 0)
            {
                sub_XuLieTu222.Show(choose);
            }
            d9_RightContant.Change2Two();
            break;

        case EGameType.JiHeXuLieTu:
            go_JiHeXuLieTuChoose1.SetActive(true);
            go_JiHeXuLieTuChoose2.SetActive(true);
            if (choose > 0)
            {
                sub_JiHeXuLieTu.Show(choose);
            }
            d9_RightContant.Change2Three();
            break;

        case EGameType.TaoMingTu:
            go_TaoMingChoose1.SetActive(true);
            go_TaoMingChoose2.SetActive(true);
            if (choose > 0)
            {
                sub_TaoMing.Show(choose);
            }
            d9_RightContant.Change2Four();
            break;

        case EGameType.NormalTu:
            go_NormalChoose1.SetActive(true);
            go_NormalChoose2.SetActive(true);
            if (choose > 0)
            {
                sub_Jpg.Show(choose);
            }
            d9_RightContant.Change2Five();
            break;

        case EGameType.JiHeTu:
            go_JiHeChoose1.SetActive(true);
            go_JiHeChoose2.SetActive(true);
            if (choose > 0)
            {
                sub_JiHeTu.Show(choose);
            }
            d9_RightContant.Change2Six();
            break;

        case EGameType.Audio:
            go_AudioChoose1.SetActive(true);
            go_AudioChoose2.SetActive(true);
            if (choose > 0)
            {
                sub_Audio.Show(choose);
            }
            d9_RightContant.Change2Seven();
            break;

        case EGameType.DaoRu:
            go_DaoRuChoose1.SetActive(true);
            go_DaoRuChoose2.SetActive(true);
            sub_DaoRu1.Show();
            d9_RightContant.Change2Eight();
            break;

        case EGameType.Search:
            go_SearchChoose1.SetActive(true);
            go_SearchChoose2.SetActive(true);
            d9_RightContant.Change2Nine();
            break;
        }

        mCurrentType = type;
    }
Пример #18
0
        /// <summary>
        /// Gets full path to XML data file from hard drive.
        /// </summary>
        /// <param name="e_game_type">A game type</param>
        /// <returns>Full path to file</returns>
        private string getXmlFileFullPath(EGameType e_game_type)
        {
            switch (e_game_type)
            {
                case EGameType.GT_FILL_IN_THE_BLANKS:
                    return Path.GetFullPath("FillInTheBlanks.xml");

                case EGameType.GT_QUIZ_MAKER:
                    return Path.GetFullPath("QuizGame.xml");

                case EGameType.GT_MEMORY_GAME:
                    return Path.GetFullPath("MemoryGame.xml");

                case EGameType.GT_WORD_SCRAMBLE:
                    return Path.GetFullPath("WordScramble.xml");

                case EGameType.GT_LABEL_GAME:
                    return Path.GetFullPath("LabelGame.xml");

                case EGameType.GT_LINE_MATCHING:
                    return Path.GetFullPath("LineMatching.xml");

                case EGameType.GT_SUPER_TYPER:
                    return Path.GetFullPath("SuperTyper.xml");

                default:
                    return "";
            }
        }
Пример #19
0
 public Game(EGameType type)
 {
     throw new System.NotImplementedException();
 }
Пример #20
0
 private void E_ShowIsSure(EGameType type, string tittle)     // 显示 确定是否界面
 {
     mCurrentGameType     = type;
     tx_IsSureTittle.text = tittle;
     go_IsSure.SetActive(true);
 }
Пример #21
0
 public WaitingGameParams(EGameType eRequestedGameType)
 {
     m_eRequestedGameType = eRequestedGameType;
 }
Пример #22
0
    private void E_DaoRuFromTuResult(EGameType type, ushort index, List <ResultBean> resultBeans, bool isFromDaoRu) // 通过 ResultBean 导入
    {
        mSelectIndex = index;
        string[] paths = new string[resultBeans.Count];
        for (int i = 0; i < resultBeans.Count; i++)
        {
            paths[i] = resultBeans[i].File.FullName;
        }
        bool isNoError = IsSaveOk(type, index, paths);

        if (isFromDaoRu)
        {
            go_Bottom3.SetActive(true);
        }
        else
        {
            go_Bottom2.SetActive(true);
        }
        Show(type, isNoError);
        if (isNoError)       // 没有错那就真正导入
        {
            if (!isFromDaoRu)
            {
                MyEventCenter.SendEvent(E_GameEvent.ZhuangOtherDRSuccess);
            }
            switch (type)
            {
            case EGameType.XuLieTu:
                MyEventCenter.SendEvent(E_GameEvent.DaoRu_XLT_FromResult, (EXuLieTu)index, resultBeans);
                if (index == 3 || index == 4)
                {
                    mSelectIndex = 3;
                }
                else if (index >= 5)
                {
                    mSelectIndex = 4;
                }
                break;

            case EGameType.XuLieTu222:
                MyEventCenter.SendEvent(E_GameEvent.DaoRu_XLT222_FromResult, (EXuLieTu222)index, resultBeans);
                break;

            case EGameType.JiHeXuLieTu:
                MyEventCenter.SendEvent(E_GameEvent.DaoRu_JiHeXLT_FromResult, (EJiHeXuLieTuType)index, resultBeans);
                break;

            case EGameType.TaoMingTu:
                MyEventCenter.SendEvent(E_GameEvent.DaoRu_TaoMing_FromResult, (ETaoMingType)index, resultBeans);
                break;

            case EGameType.NormalTu:
                MyEventCenter.SendEvent(E_GameEvent.DaoRu_Jpg_FromResult, (ENormalTuType)index, resultBeans);
                break;

            case EGameType.JiHeTu:
                MyEventCenter.SendEvent(E_GameEvent.DaoRu_JiHe_FromResult, (EJiHeType)index, resultBeans);
                break;
            }
        }
    }
Пример #23
0
    private bool IsSaveOk(EGameType type, ushort index, string[] paths)          // 判断是否保存成功
    {
        l_ErrorList_Name.Clear();
        switch (type)
        {
        case EGameType.XuLieTu:
            if (!Ctrl_TextureInfo.Instance.SaveXunLieTu(index, paths))
            {
                l_ErrorList_Name.Add(Path.GetFileNameWithoutExtension(paths[0]));
            }
            break;

        case EGameType.XuLieTu222:
            if (!Ctrl_TextureInfo.Instance.SaveXunLieTu222(index, paths))
            {
                l_ErrorList_Name.Add(Path.GetFileNameWithoutExtension(paths[0]));
            }
            break;

        case EGameType.JiHeXuLieTu:
            foreach (string path in paths)
            {
                if (!Ctrl_TextureInfo.Instance.SaveJiHeXuLieTu(index, path))
                {
                    l_ErrorList_Name.Add(Path.GetFileNameWithoutExtension(path));
                }
            }
            break;

        case EGameType.TaoMingTu:
            foreach (string path in paths)
            {
                if (!Ctrl_TextureInfo.Instance.SaveTaoMingTu(index, path))
                {
                    l_ErrorList_Name.Add(Path.GetFileNameWithoutExtension(path));
                }
            }
            break;

        case EGameType.NormalTu:
            foreach (string path in paths)
            {
                if (!Ctrl_TextureInfo.Instance.SaveJpgTu(index, path))
                {
                    l_ErrorList_Name.Add(Path.GetFileNameWithoutExtension(path));
                }
            }
            break;

        case EGameType.JiHeTu:
            foreach (string path in paths)
            {
                if (!Ctrl_TextureInfo.Instance.SaveJiHeTu(index, path))
                {
                    l_ErrorList_Name.Add(Path.GetFileNameWithoutExtension(path));
                }
            }
            break;

        case EGameType.Audio:
            foreach (string path in paths)
            {
                if (!Ctrl_TextureInfo.Instance.SaveAudio(index, path))
                {
                    l_ErrorList_Name.Add(Path.GetFileNameWithoutExtension(path));
                }
            }
            break;

        default:
            throw new Exception("未定义");
        }

        return(l_ErrorList_Name.Count <= 0);  // 少于 0个 ,表示没错咯
    }