How canranban/playniteextension-library-googleplaygames works
Main Components
• Extension Core/Bootstrap: Represented by the startup file (Source/App.xaml) and associated application class, which likely initializes the extension.
• Google Play Games Library Logic: This includes the various GooglePlayGamesLibrary* classes:
• GooglePlayGamesLibrary.cs – might serve as the overall library manager.
• GooglePlayGamesLibraryClient.cs – handles client-specific logic.
• GooglePlayGamesLibraryMetadataProvider.cs – responsible for fetching and providing metadata.
• GooglePlayGamesLibraryPlayController.cs – manages game launching or related play features.
• GooglePlayGamesLibrarySettings.cs – deals with settings configuration storage.
• UI Components: The settings view is implemented with Source/GooglePlayGamesLibrarySettingsView.xaml and its code-behind, providing the configuration interface.
• Helper Utilities: Found under Source/Helper (for example, ProcessHelper.cs and ProcessNameMonitor.cs) which handle auxiliary tasks like process monitoring.
• Localization: The file in Source/Localization/en_US.xaml indicates that there is support for internationalization.
• Integration/Configuration Files:
• extension.yaml in the Source/Resources directory likely acts as a configuration file for the extension system.
• Manifests directories (AddonBrowser, PackageInstaller) contain YAML files that provide metadata for how the extension is installed or recognized by Playnite’s addon system.
• The Include/Playnite directory suggests that there might be additional library files or wrappers provided to better integrate with the Playnite platform.
Relationships and Interactions
• The extension core initializes the application via App.xaml and then loads the Google Play Games library components.
• The Metadata Provider, Client, and Play Controller are likely invoked by the core controller to perform tasks such as retrieving game information, launching games, or integrating with Playnite.
• The Settings component, together with its corresponding UI (SettingsView and associated code-behind), allows users to configure the extension – these settings are then used by the library logic to tailor behaviors.
• Helper utilities provide support functionalities (like monitoring the game process) that feed data back into the main components.
• Localization is used across UI components to ensure the extension can support multiple languages.
• Manifest files and additional includes ensure that when the extension is installed or loaded by a Playnite AddonBrowser or PackageInstaller, all necessary metadata is available for proper setup.
Architectural Patterns and Design Principles
• Modular design: Each function (metadata, settings, play control) is encapsulated in its own class, facilitating maintainability.
• Separation of concerns: Clear division between core logic, UI, configuration, and helper utilities.
• Integration via manifests and extension configuration: This allows the extension to be easily discovered and loaded by Playnite, following its plugin architecture.
• Use of XAML for the UI suggests an MVVM (or similar) pattern might be at play, even if not explicitly separated into Model, View, and ViewModel directories.