Skip to content

KernelAPI reference

Class Achievement

Namespace: MicroEngine.Core
Assembly: MicroEngine.Achievements.dll
Guide: Game lifecycle and time

One entry of a game’s achievement catalog. Id is the stable key stored in saves, so names and descriptions can change freely. Goal of 1 is an immediate achievement; larger goals are progressive (“win 10 battles”).

C#
public sealed record Achievement : IEquatable<Achievement>

Inheritance

object ← Achievement

Implements

IEquatable<Achievement>

Constructors

Achievement(string, string, string, int)

One entry of a game’s achievement catalog. Id is the stable key stored in saves, so names and descriptions can change freely. Goal of 1 is an immediate achievement; larger goals are progressive (“win 10 battles”).

C#
public Achievement(string Id, string Name, string Description, int Goal = 1)

Parameters

Id string

Name string

Description string

Goal int

Properties

Description

C#
public string Description { get; init; }

Property Value

string

Goal

C#
public int Goal { get; init; }

Property Value

int

Icon

Optional picture for the game’s banner and list.

C#
public Sprite? Icon { get; init; }

Property Value

Sprite?

Id

C#
public string Id { get; init; }

Property Value

string

Name

C#
public string Name { get; init; }

Property Value

string

Methods

<Clone>$()

C#
public Achievement <Clone>$()

Returns

Achievement

Deconstruct(out string, out string, out string, out int)

C#
public void Deconstruct(out string Id, out string Name, out string Description, out int Goal)

Parameters

Id string

Name string

Description string

Goal int

Equals(object?)

C#
public override bool Equals(object? obj)

Parameters

obj object?

Returns

bool

Equals(Achievement?)

C#
public bool Equals(Achievement? other)

Parameters

other Achievement?

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(Achievement?, Achievement?)

C#
public static bool operator ==(Achievement? left, Achievement? right)

Parameters

left Achievement?

right Achievement?

Returns

bool

operator !=(Achievement?, Achievement?)

C#
public static bool operator !=(Achievement? left, Achievement? right)

Parameters

left Achievement?

right Achievement?

Returns

bool