Class MilestonesSection
ISaveSection holding the set of milestone ids achieved within this save slot.
Implements
Inherited Members
Namespace: Serenity.GameSave.Domain.Sections
Assembly: Serenity.GameSave.Domain.dll
Syntax
public sealed class MilestonesSection : ISaveSection
Constructors
MilestonesSection()
Declaration
public MilestonesSection()
Fields
KEY
The section key this section is stored under.
Declaration
public const string KEY = "milestones"
Field Value
| Type | Description |
|---|---|
| string |
Properties
SectionKey
The stable key this section is stored under within a SaveDocument.
Declaration
public string SectionKey { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Deserialize(string)
Restores this section's state from payload. A null or empty payload
(no prior save, or a brand-new slot) resets this section to its default state.
Declaration
public void Deserialize(string payload)
Parameters
| Type | Name | Description |
|---|---|---|
| string | payload |
GetAchieved()
Gets every achieved milestone id, in achievement order.
Declaration
public IReadOnlyList<string> GetAchieved()
Returns
| Type | Description |
|---|---|
| IReadOnlyList<string> |
IsAchieved(string)
Checks whether milestoneId has been achieved.
Declaration
public bool IsAchieved(string milestoneId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | milestoneId |
Returns
| Type | Description |
|---|---|
| bool |
MarkAchieved(string)
Marks milestoneId as achieved. Idempotent: re-marking an already-achieved milestone is a no-op.
Declaration
public void MarkAchieved(string milestoneId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | milestoneId |
Serialize()
Serializes this section's current state to JSON.
Declaration
public string Serialize()
Returns
| Type | Description |
|---|---|
| string |