This commit is contained in:
@@ -48,21 +48,33 @@ public class WasmStaticDataGetter : IStaticDataGetter
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ICollection<Building> GetBuildings()
|
||||
public async Task<ICollection<Building>> GetBuildingsAsync()
|
||||
{
|
||||
InitializeAsync().GetAwaiter().GetResult();
|
||||
|
||||
List<Building> buildings = JsonSerializer.Deserialize<List<Building>>(_buildingData)
|
||||
await InitializeAsync();
|
||||
|
||||
List<Building> buildings = JsonSerializer.Deserialize<List<Building>>(_buildingData)
|
||||
?? throw new JsonException("Cannot deserialize Buildings");
|
||||
return buildings;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ICollection<Building> GetBuildings()
|
||||
{
|
||||
throw new NotImplementedException("Use the asynchronous version of GetBuildings for WebAssembly.");
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ICollection<Objective> GetObjectives()
|
||||
{
|
||||
InitializeAsync().GetAwaiter().GetResult();
|
||||
|
||||
List<Objective> objectives = JsonSerializer.Deserialize<List<Objective>>(_objectivesData)
|
||||
throw new NotImplementedException("Use the asynchronous version of GetObjectives for WebAssembly.");
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<ICollection<Objective>> GetObjectivesAsync()
|
||||
{
|
||||
await InitializeAsync();
|
||||
|
||||
List<Objective> objectives = JsonSerializer.Deserialize<List<Objective>>(_objectivesData)
|
||||
?? throw new JsonException("Cannot deserialize Objectives");
|
||||
return objectives;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user