Interface IAchievementController
Interface for a character's achievement controller, handling achievement progress, queries, and related events.
public interface IAchievementController : ICharacterBehaviour
- Inherited Members
Fields
OnCompleteAchievement
Static event triggered when an achievement is completed (all tiers for a template are reached).
Parameters: ICharacter (the character), AchievementTemplate (the template), AchievementTier (the completed tier).
public static Action<ICharacter, AchievementTemplate, AchievementTier> OnCompleteAchievement
Field Value
OnUpdateAchievement
Static event triggered when an achievement is updated (progress or tier changes).
Parameters: ICharacter (the character), Achievement (the updated achievement).
public static Action<ICharacter, Achievement> OnUpdateAchievement
Field Value
Properties
Achievements
Dictionary of all achievements for the character, indexed by template ID.
Dictionary<int, Achievement> Achievements { get; }
Property Value
Methods
Increment(AchievementTemplate, uint)
Increments the progress of an achievement by a specified amount, handling tier advancement and rewards.
void Increment(AchievementTemplate template, uint amount)
Parameters
templateAchievementTemplateThe achievement template to increment.
amountuintThe amount to increment the achievement's value by.
Increment(int, uint)
Increments the progress of an achievement by template ID, handling tier advancement and rewards.
void Increment(int templateID, uint amount)
Parameters
templateIDintThe template ID of the achievement.
amountuintThe amount to increment the achievement's value by.
SetAchievement(int, byte, uint, bool)
Sets the achievement progress for a given template ID, tier, and value.
void SetAchievement(int templateID, byte tier, uint value, bool skipEvent = false)
Parameters
templateIDintThe template ID of the achievement.
tierbyteThe tier to set.
valueuintThe value to set.
skipEventboolIf true, does not trigger the update event.
TryGetAchievement(int, out Achievement)
Attempts to get an achievement by template ID.
bool TryGetAchievement(int templateID, out Achievement achievement)
Parameters
templateIDintThe template ID to look up.
achievementAchievementThe resulting achievement if found.
Returns
- bool
True if the achievement exists, false otherwise.