logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnlockAchievementAction

    Action that reacts to UnlockAchievementSignal by unlocking the signaled achievement through the IAchievementService.

    Inheritance
    object
    UnlockAchievementAction
    Namespace: Serenity.Achievements.Application.Events
    Assembly: Serenity.Achievements.Application.dll
    Syntax
    public sealed class UnlockAchievementAction : EventDispatcherAction<UnlockAchievementSignal>
    Remarks

    Uses ServiceLocatorBridge (via the base class' TryResolveService) to obtain the IAchievementService since EventDispatcher actions are instantiated via reflection and cannot receive constructor injection. Never throws: an unresolved service, a blank id or an unregistered id each log a warning and return without unlocking. The unlock itself is fire-and-forget — the action cannot await, and the framework's contract is that an unlock never blocks the caller. The per-id warn-once latch assumes the boot installer creates exactly one UnlockAchievementAction instance, as every AutoRegisterEventActionAttribute action is constructed once and reused for the life of the dispatcher.

    Constructors

    UnlockAchievementAction()

    Declaration
    public UnlockAchievementAction()

    Methods

    Execute(UnlockAchievementSignal)

    Reacts to the UnlockAchievementSignal by unlocking the signaled achievement.

    Declaration
    protected override void Execute(UnlockAchievementSignal signal)
    Parameters
    Type Name Description
    UnlockAchievementSignal signal

    The UnlockAchievement signal.

    In this article
    © 2026 Serenity. All Rights Reserved