-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
![GameLib.NET](Resources/GameLibPluginLogo128px.png "GameLib.NET Riot Games") | ||
Riot Games Plugin for GameLib.NET | ||
====== | ||
|
||
[Riot Games](https://www.riotgames.com/en) plugin for ![GameLib.NET](../../Resources/GameLibNET-Logo-16px.png "GameLib.NET") [GameLib.NET](README.md). | ||
|
||
The plugin will deliver information about the installation status of the `Riot Games` launcher as well the installed games within the launcher. | ||
|
||
## Installing | ||
|
||
The plugin is already bundled with the core library ![GameLib.NET](../../Resources/GameLibNET-Logo-16px.png "GameLib.NET") [GameLib.NET](README.md) | ||
|
||
## Additional information the plugin is providing | ||
|
||
To get the additonal information this plugin is providing just cast `IGame` to `GogGame`. | ||
|
||
|
||
```CSharp | ||
using GameLib; | ||
using GameLib.Plugin.Gog; | ||
using GameLib.Plugin.Gog.Model; | ||
|
||
var launcherManager = new LauncherManager(); | ||
|
||
// not required to cast here just to add to the documentation | ||
var launcher = (GogLauncher?)launcherManager.GetLaunchers() | ||
.Where(launcher => launcher.Name == "Riot Games") | ||
// Plugin ID could also be used instead of the name | ||
//.Where(launcher => launcher.Id == new Guid("938071a9-925e-4b1d-ae17-61a05ef5ec28")) | ||
.FirstOrDefault(); | ||
|
||
if (launcher is not null) | ||
{ | ||
var games = (IEnumerable<GogGame>)launcher.Games; | ||
foreach (var game in games) | ||
{ | ||
|
||
Console.WriteLine($"Game ID: {game.GameId}"); | ||
foreach (var item in game.GetType().GetProperties().Where(p => p.Name != "GameId")) | ||
{ | ||
Console.WriteLine($"\t{item.Name}: {item.GetValue(game)}"); | ||
} | ||
} | ||
} | ||
``` |