Class AchievementType
An achievement type is a set of data for an Achievement instance to contain. To register new achievement types, use Register(AchievementType).
[JsonConverter(typeof(MigratingStaticJsonConverter<AchievementType>), new object[] { typeof(AchievementType), "PrivateTypes", true })]
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
stringThis achievement type's name, which is used for DisplayName as well as Register(AchievementType).
icon
TextureRegionThe icon that this achievement should display.
goal
GoalInfoThe 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
boolWhether 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
stringThis achievement type's name, which is used for DisplayName as well as Register(AchievementType).
icon
TextureRegionThe icon that this achievement should display.
goals
GoalSetInfoThe 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
boolWhether the achievement should be hidden from the achievement menu if not achieved.
Fields
DieOnPublicLot
public static readonly AchievementType DieOnPublicLot
Field Value
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
Hidden
Stores whether this achievement should be hidden from the achievement menu if not achieved.
public readonly bool Hidden
Field Value
HiddenTrash
public static readonly AchievementType HiddenTrash
Field Value
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
SomeoneDiesOnYourLot
public static readonly AchievementType SomeoneDiesOnYourLot
Field Value
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
Properties
DisplayName
The display name of this achievement, which is based on Name.
public string DisplayName { get; }
Property Value
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
AchievementTypeThe type to register.
Returns
- AchievementType
The passed
type
, for chaining.