API reference
Class AchievementsModule
Namespace: MicroEngine.Achievements
Assembly: MicroEngine.Achievements.dll
Guide: Achievements
Achievements as an engine module: registers Tracker as the engine’s AchievementTracker
service and schedules SystemName in PostFixed, which writes pending progress
about once a second of simulated time (FlushInterval; unlocks are written at once by the tracker) and
raises Stepped every step; progress is written too when the platform suspends the game. A composition
that never adds the module has no tracker, no system and no achievement file. The Game façade adds it when the game
declares achievements (TrackAchievements before the engine is composed).
public sealed class AchievementsModule : IEngineModuleInheritance
Implements
Examples
var tracker = new AchievementTracker(catalog, new SaveStore("com.example.mygame"));builder.Add(new AchievementsModule(tracker));Constructors
AchievementsModule(AchievementTracker)
Creates the module over tracker.
public AchievementsModule(AchievementTracker tracker)Parameters
tracker AchievementTracker
Exceptions
tracker is null.
Fields
FlushInterval
Seconds of simulated time between writes of plain progress: 1.
public const float FlushInterval = 1Field Value
SystemName
The name of the module’s frame system: “engine.achievements”.
public const string SystemName = "engine.achievements"Field Value
Properties
Tracker
The tracker the module registers and flushes.
public AchievementTracker Tracker { get; }Property Value
Methods
Configure(EngineBuilder)
Registers the tracker, schedules SystemName (before engine.input.end when the composition has
it, the place it always had in a game’s step) and writes progress when the game is suspended.
public void Configure(EngineBuilder builder)Parameters
builder EngineBuilder
Step(float)
Advances the module by one step of dt seconds: raises Stepped, then writes progress when FlushInterval has passed.
public void Step(float dt)Parameters
dt float
Stepped
Raised every fixed step with the step’s length in seconds, before progress is written when due (the game’s unlock banners advance on it).
public event Action<float>? Stepped