Skip to content

V0.1 - Requirements are parsed now

Compare
Choose a tag to compare
@liebki liebki released this 01 Jun 13:06
· 5 commits to master since this release

Get the individual components of Minimum and Recommended requirements for PC's:

Implemented #12 : Enhanced the Requirements, so RecommendedParsed() and MinimumParsed() can be called,
to get a Dictionary<string, string> in order to get single components like CPU, GPU etc. if available.

In order to use this, access the MinimumParsed() and RecommendedParsed() methods in the Requirements-class, they try to parse the components and put them inside a Dictionary<string, string>, inside this Dictionary the TKey equals OS, CPU, RAM, GPU and STORAGE.

You have to filter the platforms, because only a computer (PC) has this many individual components and this certain structure, every other platform doesn't work but shouldn't throw an exception:

Requirements GamePcRequirements = game.Platforms.First(platform => platform.Platform.Name.Equals("PC", StringComparison.InvariantCultureIgnoreCase)).Requirements;

Example:

Game game = .....

Requirements GamePcRequirements = game.Platforms.First(platform => platform.Platform.Name.Equals("PC", StringComparison.InvariantCultureIgnoreCase)).Requirements;

Console.WriteLine("Minimum:");
foreach (KeyValuePair<string, string> m in GamePcRequirements.MinimumParsed())
{
    Console.WriteLine($"{m.Key} = {m.Value}");
}

Console.WriteLine();

Console.WriteLine("Recommended:");
foreach (KeyValuePair<string, string> r in GamePcRequirements.RecommendedParsed())
{
    Console.WriteLine($"{r.Key} = {r.Value}");
}

Outputs this:

Minimum:
OS = Windows 10
CPU = INTEL CORE I5-8400 or AMD RYZEN 3 3300X
RAM = 12 GB RAM
GPU = NVIDIA GEFORCE GTX 1060 3 GB or AMD RADEON RX 580 4 GB
STORAGE = 60 GB

Recommended:
OS = Windows 10/11
CPU = INTEL CORE I7-8700K or AMD RYZEN 5 3600X
RAM = 16 GB RAM
GPU = NVIDIA GEFORCE GTX 1070 8 GB or AMD RADEON RX VEGA 56 8 GB
STORAGE = 60 GB