Class GameManagerBase
- Namespace
- Hi3Helper.Plugin.Core.Management
- Assembly
- Hi3Helper.Plugin.Core.dll
[GeneratedComClass]
[ComExposedClass<ComClassInformation>]
public abstract class GameManagerBase : LauncherApiBase, ILauncherApi, IGameManager, IInitializableTask, IFree
- Inheritance
-
GameManagerBase
- Implements
- Inherited Members
Properties
ApiGameVersion
Gets the current version of available game on the API.
protected virtual GameVersion ApiGameVersion { get; set; }
Property Value
Remarks
The property should expect to NEVER return Empty.
ApiPreloadGameVersion
Gets the upcoming version of available game on the API.
protected virtual GameVersion ApiPreloadGameVersion { get; set; }
Property Value
Remarks
The property should expect to return Empty if preload/upcoming game version isn't available on the API.
CurrentGameInstallPath
Gets the current game installation path.
protected virtual string? CurrentGameInstallPath { get; set; }
Property Value
CurrentGameVersion
Gets the current version of installed game.
protected virtual GameVersion CurrentGameVersion { get; set; }
Property Value
Remarks
The property should expect to return Empty if the game isn't installed or the version isn't set.
HasPreload
Gets whether the preload/upcoming game version is available on the API.
protected abstract bool HasPreload { get; }
Property Value
Remarks
The property should expect to follow this logic formula in order to return the exact value:
IsInstalled == true AND
ApiPreloadGameVersion != Empty
HasUpdate
Gets whether the game update is available on the API.
protected abstract bool HasUpdate { get; }
Property Value
Remarks
The property should expect to follow this logic formula in order to return the exact value:
IsInstalled == true AND
CurrentGameVersion != ApiGameVersion
IsInstalled
Gets whether the game is currently installed.
protected abstract bool IsInstalled { get; }
Property Value
Remarks
The property should expect to follow this logic formula in order to return the exact value:
IsNullOrEmpty(string)(CurrentGameInstallPath) != true AND
CurrentGameVersion != Empty AND
Exists(string)(Game Executable Path) AND
So-on...
Methods
FindExistingInstallPathAsync(in Guid, out nint)
Finds the existing installation path of the game asynchronously.
public void FindExistingInstallPathAsync(in Guid cancelToken, out nint result)
Parameters
cancelTokenGuidA Guid value token for the cancelling asynchronous operation.
resultnintA safe pointer to the ComAsyncResult.
Remarks
This method returns a safe pointer to the ComAsyncResult via result.
The pointer needs to be passed to AsTask<T>(nint) and the generic type must be PluginDisposableMemoryMarshal of byte
FindExistingInstallPathAsyncInner(CancellationToken)
Find the existing installation path of the game asynchronously.
protected abstract Task<string?> FindExistingInstallPathAsyncInner(CancellationToken token)
Parameters
tokenCancellationTokenCancel token for async operations.
Returns
- Task<string>
Returns
nullif none was found. Otherwise, returns the path of the directory which contains the main game executable.
GetApiGameVersion(out GameVersion)
Gets the latest game version available from the API.
public void GetApiGameVersion(out GameVersion gameVersion)
Parameters
gameVersionGameVersionAn GameVersion representing the latest available game version.
GetApiPreloadGameVersion(out GameVersion)
Gets the preload version of the game available from the API, if any.
public void GetApiPreloadGameVersion(out GameVersion gameVersion)
Parameters
gameVersionGameVersionAn GameVersion representing the preload version, or Empty if not available.
GetCurrentGameVersion(out GameVersion)
Gets the current version of the installed game.
public void GetCurrentGameVersion(out GameVersion gameVersion)
Parameters
gameVersionGameVersionAn GameVersion representing the installed game version.
GetGamePath(out string?)
Gets the current path where the game is installed.
public void GetGamePath(out string? result)
Parameters
resultstringThe file system path to the game installation directory.
IsGameHasPreload(out bool)
Determines whether a preload version is available for the game.
public void IsGameHasPreload(out bool result)
Parameters
resultbooltrueif a preload version is available; otherwise,false.
IsGameHasUpdate(out bool)
Determines whether an update is available for the game.
public void IsGameHasUpdate(out bool result)
Parameters
resultbooltrueif an update is available; otherwise,false.
IsGameInstalled(out bool)
Determines whether the game is currently installed.
public void IsGameInstalled(out bool result)
Parameters
resultbooltrueif the game is installed; otherwise,false.
LoadConfig()
Perform config loading mechanism. Before calling this method, ensure that you have set the game path using SetGamePath(string).
public abstract void LoadConfig()
SaveConfig()
Perform config saving mechanism. Before calling this method, ensure that you have set the game path using SetGamePath(string).
public abstract void SaveConfig()
SetCurrentGameVersion(in GameVersion)
Sets the current version of the installed game.
public void SetCurrentGameVersion(in GameVersion gameVersion)
Parameters
gameVersionGameVersion
SetCurrentGameVersionInner(in GameVersion)
Sets the current version of the installed game.
protected abstract void SetCurrentGameVersionInner(in GameVersion gameVersion)
Parameters
gameVersionGameVersion
SetGamePath(string)
Set-only or Set-Save the path of the game installation.
public void SetGamePath(string gamePath)
Parameters
gamePathstringThe new file system path to the game installation directory.
SetGamePathInner(string)
Set-only or Set-Save the path of the game installation.
protected abstract void SetGamePathInner(string gamePath)
Parameters
gamePathstringThe new file system path to the game installation directory.