using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ThreadPilot.Models;
namespace ThreadPilot.Services
{
///
/// Interface for Game Boost mode functionality
///
public interface IGameBoostService
{
///
/// Event fired when Game Boost mode is activated
///
event EventHandler? GameBoostActivated;
///
/// Event fired when Game Boost mode is deactivated
///
event EventHandler? GameBoostDeactivated;
///
/// Event fired when a game is detected
///
event EventHandler? GameDetected;
///
/// Gets whether Game Boost mode is currently active
///
bool IsGameBoostActive { get; }
///
/// Gets the currently detected game process
///
ProcessModel? CurrentGameProcess { get; }
///
/// Gets the list of known game executables
///
IReadOnlyList KnownGameExecutables { get; }
///
/// Gets the list of known game executables as a collection
///
IReadOnlyList GetKnownGameExecutables();
///
/// Enables Game Boost mode
///
Task EnableGameBoostAsync();
///
/// Disables Game Boost mode
///
Task DisableGameBoostAsync();
///
/// Manually activates Game Boost for a specific process
///
/// The process to boost
Task ActivateGameBoostAsync(ProcessModel process);
///
/// Manually deactivates Game Boost
///
Task DeactivateGameBoostAsync();
///
/// Adds a game executable to the known games list
///
/// Name of the executable (e.g., "game.exe")
Task AddKnownGameAsync(string executableName);
///
/// Removes a game executable from the known games list
///
/// Name of the executable to remove
Task RemoveKnownGameAsync(string executableName);
///
/// Checks if a process is considered a game
///
/// The process to check
bool IsGameProcess(ProcessModel process);
}
///
/// Event arguments for Game Boost activation
///
public class GameBoostActivatedEventArgs : EventArgs
{
public ProcessModel GameProcess { get; }
public string PowerPlanId { get; }
public DateTime ActivatedAt { get; }
public GameBoostActivatedEventArgs(ProcessModel gameProcess, string powerPlanId)
{
GameProcess = gameProcess;
PowerPlanId = powerPlanId;
ActivatedAt = DateTime.Now;
}
}
///
/// Event arguments for Game Boost deactivation
///
public class GameBoostDeactivatedEventArgs : EventArgs
{
public ProcessModel? GameProcess { get; }
public string? RestoredPowerPlanId { get; }
public DateTime DeactivatedAt { get; }
public TimeSpan Duration { get; }
public GameBoostDeactivatedEventArgs(ProcessModel? gameProcess, string? restoredPowerPlanId, TimeSpan duration)
{
GameProcess = gameProcess;
RestoredPowerPlanId = restoredPowerPlanId;
DeactivatedAt = DateTime.Now;
Duration = duration;
}
}
///
/// Event arguments for game detection
///
public class GameDetectedEventArgs : EventArgs
{
public ProcessModel GameProcess { get; }
public bool IsKnownGame { get; }
public DateTime DetectedAt { get; }
public GameDetectedEventArgs(ProcessModel gameProcess, bool isKnownGame)
{
GameProcess = gameProcess;
IsKnownGame = isKnownGame;
DetectedAt = DateTime.Now;
}
}
}