-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix weird time tracking event behaviour
- Loading branch information
1 parent
e605fd5
commit 600ce4d
Showing
4 changed files
with
56 additions
and
12 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
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,30 @@ | ||
using System; | ||
using LauncherGamePlugin.Enums; | ||
using LauncherGamePlugin.Launcher; | ||
|
||
namespace Launcher.Launcher; | ||
|
||
public class ProfileWrapper<T> : IBootProfile where T : IBootProfile, new() | ||
{ | ||
public string Name { get; } | ||
public Platform CompatiblePlatform { get; } | ||
public Platform CompatibleExecutable { get; } | ||
public void Launch(LaunchParams launchParams) | ||
{ | ||
T instance = new T(); | ||
instance.OnGameLaunch += x => OnGameLaunch?.Invoke(x); | ||
instance.OnGameClose += x => OnGameClose?.Invoke(x); | ||
instance.Launch(launchParams); | ||
} | ||
|
||
public event Action<LaunchParams>? OnGameLaunch; | ||
public event Action<LaunchParams>? OnGameClose; | ||
|
||
public ProfileWrapper() | ||
{ | ||
T instance = new T(); | ||
Name = instance.Name; | ||
CompatiblePlatform = instance.CompatiblePlatform; | ||
CompatibleExecutable = instance.CompatibleExecutable; | ||
} | ||
} |
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
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