Class AchievementPlatformTableModel
What the platform table shows and exports, answered without an EditorWindow: which columns to
draw, which cells are missing an identifier the project needs, and what each achievement looks like to
the manifest exporter.
Inherited Members
Namespace: Serenity.Achievements.Infrastructure.Editor.Studio
Assembly: Serenity.UnityAchievements.Infrastructure.Editor.dll
Syntax
public static class AchievementPlatformTableModel
Remarks
Separated from the drawing for the reason AchievementsStudioRowModel is: the two questions worth getting wrong here — is this column live in this project, and is this blank cell a defect — are answerable in a test, and neither of them is a question about IMGUI.
Every storefront gets a column, whether or not the project ships there. The list is the same four every time, so an author reading it across projects reads the same table; what changes is that a column the project does not ship on is drawn dimmed, and its blanks are not defects. That is the opposite choice from the list rows, which drop a storefront entirely when nothing references it — a badge strip is read per row and has to stay short, a table is read down a column and has to stay in the same place.
Fields
DisabledColumnTooltip
Why a column is drawn dimmed.
Declaration
public const string DisabledColumnTooltip = "This project has no achievement platform definition for this storefront, so a blank here is not a problem. Assign one in the achievement settings to start checking it."
Field Value
| Type | Description |
|---|---|
| string |
GradePropertyName
The name of the serialized field holding the trophy tier.
Declaration
public const string GradePropertyName = "Grade"
Field Value
| Type | Description |
|---|---|
| string |
MissingIdentifierTooltip
Why a cell is tinted.
Declaration
public const string MissingIdentifierTooltip = "This project ships on this storefront and this achievement names no identifier for it, so the unlock will never be mirrored there."
Field Value
| Type | Description |
|---|---|
| string |
SteamPropertyName
The name of the serialized field holding the Steam API name.
Declaration
public const string SteamPropertyName = "SteamApiName"
Field Value
| Type | Description |
|---|---|
| string |
Methods
Columns(IReadOnlyCollection<AchievementPlatformKind>)
One column per storefront, in the order the list rows read them.
Declaration
public static IReadOnlyList<AchievementPlatformTableColumn> Columns(IReadOnlyCollection<AchievementPlatformKind> enabledPlatforms)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyCollection<AchievementPlatformKind> | enabledPlatforms | The storefronts the project ships on. May be null. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<AchievementPlatformTableColumn> | The columns. |
HasAuthoringErrors(AchievementsStudioRowModel)
Whether one judged row is something no storefront should be told about.
Declaration
public static bool HasAuthoringErrors(AchievementsStudioRowModel row)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementsStudioRowModel | row | The judged row. Null answers false. |
Returns
| Type | Description |
|---|---|
| bool | True when the achievement must not reach a manifest. |
Remarks
An Error finding and a row nothing could be read off are the same answer for this purpose: the first says the achievement is broken, the second says nobody knows whether it is. Warnings are not — a missing icon is worth a badge and is not worth withholding a Steam API name over.
IsMissingIdentifier(string, bool)
Whether a blank cell in this column is a defect rather than simply blank.
Declaration
public static bool IsMissingIdentifier(string identifier, bool isEnabledInProject)
Parameters
| Type | Name | Description |
|---|---|---|
| string | identifier | What the cell holds. |
| bool | isEnabledInProject | Whether the project ships on that storefront. |
Returns
| Type | Description |
|---|---|
| bool | True when the cell should be tinted. |
Remarks
The same rule the authoring rules apply and the list badges show: an identifier is only missing when the project actually ships on that storefront. A local-only project has four blank columns and nothing wrong with it.
TitleOf(UnityAchievementDefinition)
What one achievement's row is labelled with.
Declaration
public static string TitleOf(UnityAchievementDefinition definition)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityAchievementDefinition | definition | The achievement. Null answers the missing-id placeholder. |
Returns
| Type | Description |
|---|---|
| string | Its id, or the placeholder the list rows use when it has none. |
ToManifestRow(UnityAchievementDefinition, bool)
Describes one achievement to the manifest exporter.
Declaration
public static AchievementManifestRow ToManifestRow(UnityAchievementDefinition definition, bool hasAuthoringErrors = false)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityAchievementDefinition | definition | The achievement. Null produces null. |
| bool | hasAuthoringErrors | Whether the authoring rules reject it, which keeps it out of every manifest. |
Returns
| Type | Description |
|---|---|
| AchievementManifestRow | The manifest row. |
ToManifestRows(IReadOnlyList<UnityAchievementDefinition>, IReadOnlyList<AchievementsStudioRowModel>)
Describes every achievement in the project to the manifest exporter.
Declaration
public static IReadOnlyList<AchievementManifestRow> ToManifestRows(IReadOnlyList<UnityAchievementDefinition> definitions, IReadOnlyList<AchievementsStudioRowModel> judgedRows = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<UnityAchievementDefinition> | definitions | The achievements. May be null and may contain null. |
| IReadOnlyList<AchievementsStudioRowModel> | judgedRows | What the Studio's rules said about each of them, in the same order. May be null, which exports everything. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<AchievementManifestRow> | One row per non-null achievement, in the order given. |
Remarks
The judged rows are matched to the achievements by position, which is exactly the correspondence BuildAll(IReadOnlyList<UnityAchievementDefinition>, IReadOnlyCollection<AchievementPlatformKind>) produces: it skips nulls and keeps project order, so its n-th row is the n-th non-null achievement. When the two lists disagree on length they did not come from the same catalog read, and every row is treated as unjudged — guessing which finding belongs to which achievement would attribute one achievement's defect to another, and silently drop it from the manifest.