Skip to content

Commit

Permalink
Added Readme for Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenMaxe committed Jul 15, 2023
1 parent d0b192d commit 24b3b4f
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions GameLib.Plugin/GameLib.Plugin.RiotGames/README.md
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)}");
}
}
}
```

0 comments on commit 24b3b4f

Please sign in to comment.