コード例 #1
0
    public void CompleteSave()
    {
        config_guide_item nextItem = FindNextItem(guidingItem);

        if (nextItem == null)
        {
            if (!GuideInfo.completeRoots.Contains(guidingItem.root_id))
            {
                if (guidingItem.complete_tip != null && guidingItem.complete_tip != "")
                {
                    PromptModel.Instance.Pop(LanguageUtil.GetTxt(Convert.ToInt32(guidingItem.complete_tip)));
                }

                List <TIVInfo> conditions = guidingItem.GetConditions();
                if (conditions != null)
                {
                    for (int i = 0; i < conditions.Count; i++)
                    {
                        TIVInfo condition = conditions[i];

                        if (condition.id == (int)GuideIDType.play_map)
                        {
                            guidingItem.SetCompleteTemp(true);
                            return;
                        }
                    }
                }

                GuideInfo.completeRoots.Add(guidingItem.root_id);
                Save();
            }
        }
        else
        {
        }
    }
コード例 #2
0
    private bool ConditionCheck(config_guide_item item)
    {
        List <TIVInfo> conditions = item.GetConditions();

        bool isReach = true;

        for (int i = 0; i < conditions.Count; i++)
        {
            TIVInfo condition = conditions[i];
            switch ((int)condition.id)
            {
            case (int)GuideIDType.crt_star_num:

                int gameValue = MapModel.Instance.starInfo.crtStar;

                bool conditionCompare = ConditionCompare(condition, gameValue);

                if (conditionCompare == false)
                {
                    return(false);
                }

                break;

            case (int)GuideIDType.Guide_complete:

                if (GuideInfo.completeRoots.IndexOf((int)condition.value) == -1)
                {
                    return(false);
                }

                break;

            case (int)GuideIDType.pass_map:

                MapInfo map = MapModel.Instance.GetMapInfo((int)condition.value);

                if (map == null)
                {
                    return(false);
                }

                if (map.star <= 0)
                {
                    return(false);
                }
                break;

            case (int)GuideIDType.play_map:

                if (BattleModel.Instance.play_mapId != (int)condition.value)
                {
                    return(false);
                }

                break;

            case (int)GuideIDType.ready_map:

                if (BattleModel.Instance.ready_map != (int)condition.value)
                {
                    return(false);
                }

                break;

            case (int)GuideIDType.lose_map:

                if (BattleModel.Instance.lose_map != (int)condition.value)
                {
                    return(false);
                }

                break;
            }
        }
        return(isReach);
    }