Esempio n. 1
0
    public IEnumerator RemovePreviousQuest()
    {
        DecentralandEntity entity            = TestHelpers.CreateSceneEntity(scene);
        QuestTrackingInfo  questTrackingInfo = TestHelpers.EntityComponentCreate <QuestTrackingInfo, QuestModel>(scene, entity, new QuestModel(), CLASS_ID_COMPONENT.QUEST_TRACKING_INFORMATION);

        yield return(questTrackingInfo.routine);

        QuestModel quest = new QuestModel
        {
            id = "questId"
        };

        questTrackingInfo.UpdateFromModel(quest);

        QuestModel quest2 = new QuestModel
        {
            id = "questId2"
        };

        questTrackingInfo.UpdateFromModel(quest2);

        mockQuestController.Received().RemoveQuest(quest);
    }
    public IEnumerator AddQuests()
    {
        IDCLEntity        entity            = TestHelpers.CreateSceneEntity(scene);
        QuestTrackingInfo questTrackingInfo = TestHelpers.EntityComponentCreate <QuestTrackingInfo, QuestModel>(scene, entity, new QuestModel(), CLASS_ID_COMPONENT.QUEST_TRACKING_INFORMATION);

        yield return(questTrackingInfo.routine);

        QuestModel quest = new QuestModel
        {
            id = "questId"
        };

        questTrackingInfo.UpdateFromModel(quest);
        mockQuestController.Received().UpdateQuestProgress(quest);
    }
    public IEnumerator RemovePreviousQuestOnDestroy()
    {
        IDCLEntity        entity            = TestHelpers.CreateSceneEntity(scene);
        QuestTrackingInfo questTrackingInfo = TestHelpers.EntityComponentCreate <QuestTrackingInfo, QuestModel>(scene, entity, new QuestModel(), CLASS_ID_COMPONENT.QUEST_TRACKING_INFORMATION);

        yield return(questTrackingInfo.routine);

        QuestModel quest = new QuestModel
        {
            id = "questId"
        };

        questTrackingInfo.UpdateFromModel(quest);
        TestHelpers.RemoveSceneEntity(scene, entity);

        yield return(null); // Needed for Unity to call OnDestroy

        mockQuestController.Received().RemoveQuest(quest);
    }