예제 #1
0
        private void GameLoop_GameLaunched(object sender, GameLaunchedEventArgs e)
        {
            // Setup third party mod compatibility bridge
            Compat.Setup(this.Helper.ModRegistry, this.Monitor);
            IQuestApi questApi    = this.Helper.ModRegistry.GetApi <IQuestApi>("purrplingcat.questframework");
            var       storyHelper = new StoryHelper(this.ContentLoader, questApi.GetManagedApi(this.ModManifest));

            questApi.Events.GettingReady += (_, args) => storyHelper.LoadQuests(this.GameMaster);
            questApi.Events.Ready        += (_, args) => storyHelper.SanitizeOldAdventureQuestsInLog();

            // Mod's services and drivers
            this.QuestApi         = questApi;
            this.SpecialEvents    = new SpecialModEvents();
            this.DialogueDriver   = new DialogueDriver(this.Helper.Events);
            this.HintDriver       = new HintDriver(this.Helper.Events);
            this.StuffDriver      = new StuffDriver(this.Helper.Data, this.Monitor);
            this.MailDriver       = new MailDriver(this.ContentLoader, this.Monitor);
            this.GameMaster       = new GameMaster(this.Helper, storyHelper, this.Monitor);
            this.CompanionHud     = new CompanionDisplay(this.Config, this.ContentLoader);
            this.CompanionManager = new CompanionManager(this.GameMaster, this.DialogueDriver, this.HintDriver, this.CompanionHud, this.Config, this.Monitor);

            this.StuffDriver.RegisterEvents(this.Helper.Events);
            this.MailDriver.RegisterEvents(this.SpecialEvents);

            this.ApplyPatches(); // Apply harmony patches
            this.InitializeScenarios();
        }
예제 #2
0
        public async Task GetQuestsIndexAsync_Gets_QuestsIndex()
        {
            IQuestApi warcraftClient           = ClientFactory.BuildClient();
            RequestResult <QuestsIndex> result = await warcraftClient.GetQuestsIndexAsync("static-us");

            Assert.NotNull(result.Value);
        }
예제 #3
0
    public async Task GetQuestTypeAsync_Gets_QuestType()
    {
        IQuestApi warcraftClient = ClientFactory.BuildClient();

        RequestResult <QuestType> result = await warcraftClient.GetQuestTypeAsync(1, "static-us");

        await result.Should().BeSuccessfulRequest()
        .BeEquivalentToBlizzardResponseAsync("https://us.api.blizzard.com/data/wow/quest/type/1?namespace=static-us&locale=en_US");
    }
예제 #4
0
        public async Task GetQuestTypeAsync_Gets_QuestType()
        {
            IQuestApi warcraftClient = ClientFactory.BuildMockClient(
                requestUri: "https://us.api.blizzard.com/data/wow/quest/type/1?namespace=static-us&locale=en_US",
                responseContent: Resources.QuestTypeResponse);

            RequestResult <QuestType> result = await warcraftClient.GetQuestTypeAsync(1, "static-us");

            Assert.NotNull(result.Value);
        }
예제 #5
0
        public async void GetQuestAreasIndexAsync_Gets_QuestAreasIndex()
        {
            IQuestApi warcraftClient = ClientFactory.BuildMockClient(
                requestUri: "https://us.api.blizzard.com/data/wow/quest/area/index?namespace=static-us&locale=en_US",
                responseContent: Resources.QuestAreasIndexResponse);

            RequestResult <QuestAreasIndex> result = await warcraftClient.GetQuestAreasIndexAsync("static-us");

            Assert.NotNull(result.Value);
        }