Class AchievementPlatformGatewayFactory
Builds the single IAchievementPlatformGateway the achievement service talks to, out of whatever the project configured: a registered factory first, then every assigned UnityAchievementPlatformDefinition asset, folded into one CompositeAchievementPlatformGateway.
Inherited Members
Namespace: Serenity.Achievements.Infrastructure.Platforms
Assembly: Serenity.UnityAchievements.Infrastructure.dll
Syntax
public static class AchievementPlatformGatewayFactory
Remarks
Never throws. A definition that fails to build its gateway is reported and left out, and a project that configured nothing gets NullAchievementPlatformGateway — a PC build with no storefront must boot exactly like one with four.
Methods
Create(IReadOnlyList<UnityAchievementPlatformDefinition>, AchievementPlatformGatewayContext)
Creates the gateway the achievement service mirrors unlocks through.
Declaration
public static IAchievementPlatformGateway Create(IReadOnlyList<UnityAchievementPlatformDefinition> platformDefinitions, AchievementPlatformGatewayContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<UnityAchievementPlatformDefinition> | platformDefinitions | The configured platform assets, or |
| AchievementPlatformGatewayContext | context | What each gateway is built from: the declared achievements and the log service. May be |
Returns
| Type | Description |
|---|---|
| IAchievementPlatformGateway | The composed gateway; never |
Remarks
The context is built by the caller and passed to every gateway unchanged, which is what obliges the composition root to have the achievement registry in hand BEFORE it builds the gateway: a storefront names achievements by its own identifier, so a gateway handed no declared set can push an unlock but never read the account back.