Ejemplo n.º 1
0
    public void Initialize(int[] questCodesInProgress, int[] questCodesCompleted, QuestProgress_Discussion progress_Discussion, QuestProgress_KillMonster progress_KillMonster)
    {
        if (questCodesInProgress != null)
        {
            for (int i = 0; i < questCodesInProgress.Length; ++i)
            {
                QuestData data = QuestDB.Instance.GetQuestData(questCodesInProgress[i]);
                questDatasInProgress.Add(data);
            }
        }
        if (questCodesCompleted != null)
        {
            for (int i = 0; i < questCodesCompleted.Length; ++i)
            {
                try
                {
                    QuestData data = QuestDB.Instance.GetQuestData(questCodesCompleted[i]);
                    completedQuests.Add(data);
                }
                catch (Exception)
                {
                    Debug.Log($"UserQuestProvider : {questCodesCompleted[i]} 데이터가 존재하지 않음");
                }
            }
        }

        questProgress_Discussion = progress_Discussion;
        questProgress_Discussion.Initiailize();

        questProgress_KillMonster = progress_KillMonster;
        questProgress_KillMonster.Initialize();
    }
Ejemplo n.º 2
0
    // Singleton
    private UserQuestProvider()
    {
        questDatasInProgress = new List <QuestData>();

        questProgress_Discussion = new QuestProgress_Discussion();
        questProgress_Discussion.Initiailize();

        questProgress_KillMonster = new QuestProgress_KillMonster();
        questProgress_KillMonster.Initialize();

        completedQuests = new List <QuestData>();
    }