using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using Steamworks.Data; namespace Steamworks { /// /// Undocumented Parental Settings /// public class SteamParental : SteamSharedClass { internal static ISteamParentalSettings? Internal => Interface as ISteamParentalSettings; internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamParentalSettings( server ) ); if ( Interface is null || Interface.Self == IntPtr.Zero ) return false; InstallEvents( server ); return true; } internal static void InstallEvents( bool server ) { Dispatch.Install( x => OnSettingsChanged?.Invoke(), server ); } /// /// Parental Settings Changed /// public static event Action? OnSettingsChanged; /// /// /// public static bool IsParentalLockEnabled => Internal != null && Internal.BIsParentalLockEnabled(); /// /// /// public static bool IsParentalLockLocked => Internal != null && Internal.BIsParentalLockLocked(); /// /// /// public static bool IsAppBlocked( AppId app ) => Internal != null && Internal.BIsAppBlocked( app.Value ); /// /// /// public static bool BIsAppInBlockList( AppId app ) => Internal != null && Internal.BIsAppInBlockList( app.Value ); /// /// /// public static bool IsFeatureBlocked( ParentalFeature feature ) => Internal != null && Internal.BIsFeatureBlocked( feature ); /// /// /// public static bool BIsFeatureInBlockList( ParentalFeature feature ) => Internal != null && Internal.BIsFeatureInBlockList( feature ); } }