示例#1
0
    public async Task LoadData(System.Net.Http.HttpClient Http, NavigationManager URIHelper, IJSRuntime Jsruntime)
    {
        await AreaManager.Instance.LoadAreas(Http);

        CurrentLand = AreaManager.Instance.GetLandByName("Quepland");
        UriHelper   = URIHelper;
        Updates     = await Http.GetFromJsonAsync <List <Update> >("data/Updates.json");

        await ItemManager.Instance.LoadItems(Http);

        await Player.Instance.LoadSkills(Http);

        await NPCManager.Instance.LoadNPCs(Http);

        await QuestManager.Instance.LoadQuests(Http);

        await BattleManager.Instance.LoadMonsters(Http);

        await FollowerManager.Instance.LoadFollowers(Http);

        JSRuntime = Jsruntime;
        await GetDimensions();

        Start();
        InitCompleted = true;
    }
示例#2
0
    public static async System.Threading.Tasks.Task RunInspectTask()
    {
        WeatherForecast[] forecasts = null;
        var httpClient  = new System.Net.Http.HttpClient();
        var getJsonTask = httpClient.GetFromJsonAsync <WeatherForecast[]>("http://localhost:9400/weather.json");

        try
        {
            await getJsonTask.ContinueWith(t =>
            {
                int a = 10;
                Console.WriteLine(a);
                if (t.IsCompletedSuccessfully)
                {
                    forecasts = t.Result;
                }

                if (t.IsFaulted)
                {
                    throw t.Exception !;
                }
            });
        }
        catch (Exception ex)
        {
            Console.WriteLine($"error {ex}");
            return;
        }
    }