Beispiel #1
0
    //-----------------------------------------------------------------------------------
    public void Init(Data.GameData gameData)
    {
        m_gameData = gameData;

        m_stats = new StatsProviderLocal();
        m_stats.Load();


        if (m_stats.GetConfig().m_strPlayerName.Length == 0)
        {
            m_stats.GetConfig().m_strPlayerName = "Player_" + UnityEngine.Random.Range(1000, 9000000).ToString();
            m_stats.Save();
        }

        m_adsMan = new Ads.AdsManager();
        m_adsMan.Init();

        m_netMan = new Net.NetManager();
        m_netMan.Init();

        m_ui = new UserInterface();
        m_ui.Init();


        m_ui.SwitchToState(new GameGUI.States.MainMenuParams());
    }
Beispiel #2
0
        /*
         * Call those lines in the LoadingScreen.Start() function for an example
         *
         *  DataParser.loadDataJSON();
         *
         */

        public static string getMacroContent(string macro)
        {
            string[] path = macro.Replace(" ", "").Split(',');
            if (path.Length == 1)
            {
                return(""); // should not happen
            }
            Data.GameData data    = DataManager.GAME_DATA[path[0]];
            int           i       = 1;
            object        content = null;

            if (data is SpellData)
            {
                content = GameData.getFieldContent <SpellData>((SpellData)data, path[i]);
            }
            else if (data is BuffData)
            {
                content = GameData.getFieldContent <BuffData>((BuffData)data, path[i]);
            }
            i++;
            while (i < path.Length)   // going down nested objects
            {
                if (content is Array)
                {
                    int index = int.Parse(path[i]);
                    if (content is EffectSpell[])
                    {
                        content = ((EffectSpell[])content)[index];
                    }
                    if (content is EffectBuff[])
                    {
                        content = ((EffectBuff[])content)[index];
                    }
                    if (content is EffectCondition[])
                    {
                        content = ((EffectCondition[])content)[index];
                    }
                }
                else
                {
                    if (content is EffectSpell)
                    {
                        content = GameData.getFieldContent <EffectSpell>((EffectSpell)content, path[i]);
                    }
                    else if (content is EffectBuff)
                    {
                        content = GameData.getFieldContent <EffectBuff>((EffectBuff)content, path[i]);
                    }
                    else if (content is EffectHandlerDirectDamage)
                    {
                        content = GameData.getFieldContent <EffectHandlerDirectDamage>((EffectHandlerDirectDamage)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectHandlerIndirectDamage)
                    {
                        content = GameData.getFieldContent <EffectHandlerIndirectDamage>((EffectHandlerIndirectDamage)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectHandlerHeal)
                    {
                        content = GameData.getFieldContent <EffectHandlerHeal>((EffectHandlerHeal)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectHandlerBuff)
                    {
                        content = GameData.getFieldContent <EffectHandlerBuff>((EffectHandlerBuff)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectHandlerModAP)
                    {
                        content = GameData.getFieldContent <EffectHandlerModAP>((EffectHandlerModAP)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectHandlerModMP)
                    {
                        content = GameData.getFieldContent <EffectHandlerModMP>((EffectHandlerModMP)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectConditionTurnNumberAbove)
                    {
                        content = GameData.getFieldContent <EffectConditionTurnNumberAbove>((EffectConditionTurnNumberAbove)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectConditionTurnNumberBelow)
                    {
                        content = GameData.getFieldContent <EffectConditionTurnNumberBelow>((EffectConditionTurnNumberBelow)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectConditionHealthAbove)
                    {
                        content = GameData.getFieldContent <EffectConditionHealthAbove>((EffectConditionHealthAbove)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectConditionHealthBelow)
                    {
                        content = GameData.getFieldContent <EffectConditionHealthBelow>((EffectConditionHealthBelow)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectConditionAPAbove)
                    {
                        content = GameData.getFieldContent <EffectConditionAPAbove>((EffectConditionAPAbove)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectConditionAPBelow)
                    {
                        content = GameData.getFieldContent <EffectConditionAPBelow>((EffectConditionAPBelow)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectConditionMPAbove)
                    {
                        content = GameData.getFieldContent <EffectConditionMPAbove>((EffectConditionMPAbove)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectConditionMPBelow)
                    {
                        content = GameData.getFieldContent <EffectConditionMPBelow>((EffectConditionMPBelow)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectConditionHasBuff)
                    {
                        content = GameData.getFieldContent <EffectConditionHasBuff>((EffectConditionHasBuff)content, path[i]).ToString();
                        i++;
                    }
                    else if (content is EffectConditionHasNotBuff)
                    {
                        content = GameData.getFieldContent <EffectConditionHasNotBuff>((EffectConditionHasNotBuff)content, path[i]).ToString();
                        i++;
                    }
                }
                i++;
            }
            return(content.ToString());
        }