Skip to main content

PlayerTracker

A class in Root.Township, the global namespace.

Server: one player's achievement action progress, completed achievements and completed tutorials, kept by GameTaskManager and sent to the API.

Constructors​

MemberWhat it is
PlayerTracker(IEnumerable<StatProgress> progress, IEnumerable<uint> progressFlags)Creates a PlayerTracker from progress and progressFlags.

Fields​

2 private and internal fields
MemberWhat it is
private bool isChangedTrue when progress has changed since the last send.
private readonly Dictionary<GameAction, float> statActionsProgress for each action.

Properties​

MemberWhat it is
HashSet<GameAchievement> CompletedAchievements { get; }The achievements the player had finished when the tracker was made.
HashSet<MicroTutorialSettings> CompletedTutorials { get; }The micro tutorials the player had finished when the tracker was made.
IEnumerable<GameAction> CurrentActions { get; }The actions with progress above zero.

Methods​

MemberWhat it is
void Clear()Clears the stored action progress.
int GetValue(GameAction action)Returns the progress for an action as a whole number, or 0.
void SendToDatabase(IPlayer player)If anything changed, sends all action progress to the API for the player.
void UpdateValue(GameAction action, float progress)Sets the progress for an action and marks the tracker as changed.

Used in​

Members of other types that take, return or hold a PlayerTracker: