Table of Contents

Class AchievementType

Namespace
TinyLife.Goals
Assembly
Tiny Life.dll

An achievement type is a set of data for an Achievement instance to contain. To register new achievement types, use Register(AchievementType).

[JsonConverter(typeof(StaticJsonConverter<AchievementType>), new object[] { typeof(AchievementType), "PrivateTypes" })]
public class AchievementType
Inheritance
AchievementType
Inherited Members
Extension Methods

Constructors

AchievementType(string, TextureRegion, GoalInfo, bool)

Creates a new achievement type with the given settings.

public AchievementType(string name, TextureRegion icon, GoalInfo goal, bool hidden = false)

Parameters

name string

This achievement type's name, which is used for DisplayName as well as Register(AchievementType).

icon TextureRegion

The icon that this achievement should display.

goal GoalInfo

The goal that have to be fulfilled for this achievement to be completed. If this is null, CompleteAchievement(AchievementType) has to be used to complete an achievement of this type.

hidden bool

Whether the achievement should be hidden from the achievement menu if not achieved.

AchievementType(string, TextureRegion, GoalSetInfo, bool)

Creates a new achievement type with the given settings.

public AchievementType(string name, TextureRegion icon, GoalSetInfo goals = null, bool hidden = false)

Parameters

name string

This achievement type's name, which is used for DisplayName as well as Register(AchievementType).

icon TextureRegion

The icon that this achievement should display.

goals GoalSetInfo

The set of goals that have to be fulfilled for this achievement to be completed. If this is null, CompleteAchievement(AchievementType) has to be used to complete an achievement of this type.

hidden bool

Whether the achievement should be hidden from the achievement menu if not achieved.

Fields

DieOnPublicLot

public static readonly AchievementType DieOnPublicLot

Field Value

AchievementType

Goals

The set of goals that have to be fulfilled for this achievement to be completed. If this is null, CompleteAchievement(AchievementType) has to be used to complete an achievement of this type.

public readonly GoalSetInfo Goals

Field Value

GoalSetInfo

Hidden

Stores whether this achievement should be hidden from the achievement menu if not achieved.

public readonly bool Hidden

Field Value

bool

HiddenTrash

public static readonly AchievementType HiddenTrash

Field Value

AchievementType

Icon

The icon that this achievement should display.

public readonly TextureRegion Icon

Field Value

TextureRegion

Name

This achievement type's name, which is used for DisplayName as well as Register(AchievementType).

public readonly string Name

Field Value

string

SomeoneDiesOnYourLot

public static readonly AchievementType SomeoneDiesOnYourLot

Field Value

AchievementType

Types

A set of all AchievementType instances registered by the game and mods using Register(AchievementType).

public static readonly ReadOnlyDictionary<string, AchievementType> Types

Field Value

ReadOnlyDictionary<string, AchievementType>

Properties

DisplayName

The display name of this achievement, which is based on Name.

public string DisplayName { get; }

Property Value

string

Methods

Construct()

Constructs a new Achievement instance with this type.

public virtual Achievement Construct()

Returns

Achievement

The constructed achievement.

Register(AchievementType)

Registers the given achievement type to the Types registry.

public static AchievementType Register(AchievementType type)

Parameters

type AchievementType

The type to register.

Returns

AchievementType

The passed type, for chaining.