Table of Contents

Class Migration

Namespace
TinyLife.Utilities
Assembly
Tiny Life.dll

A migration represents an action or set of actions that need to be done to an object to update it to the game's current version. Migrations are available for a multitude of object types that inhabit a Map, ExportedHousehold or ExportedLot by default. Note that migrations do not have to be registered using Register<T>(IEnumerable<Migration<T>>) when added to a preexisting collection like Migrations or Migrations, but only when a mod adds a custom set of migrations for a custom object type.

public class Migration
Inheritance
Migration
Derived
Inherited Members
Extension Methods

Constructors

Migration(string, MigrationPhase, ApplyDelegate)

Creates a new migration with the given settings. To create a migration instance, use Migration<T> instead.

protected Migration(string name, MigrationPhase phase, Migration.ApplyDelegate apply)

Parameters

name string

The name of this migration, which is stored in the save file or exported content once this migration has been applied if Silent is false.

phase MigrationPhase

The MigrationPhase that this migration should be applied on. Note that some object types only support the Single phase.

apply Migration.ApplyDelegate

A function that applies this migration on an object.

Fields

Apply

A function that applies this migration on an object.

public readonly Migration.ApplyDelegate Apply

Field Value

Migration.ApplyDelegate

Migrations

A dictionary that contains all of the migrations for all objects that are currently registered.

public static readonly ReadOnlyDictionary<string, Migration> Migrations

Field Value

ReadOnlyDictionary<string, Migration>

Name

The name of this migration, which is stored in the save file or exported content once this migration has been applied if Silent is false.

public readonly string Name

Field Value

string

Phase

The MigrationPhase that this migration should be applied on. Note that some object types only support the Single phase.

public readonly MigrationPhase Phase

Field Value

MigrationPhase

Properties

Priority

The priority that this migration should be applied with. A higher priority means that this migration will be applied before migrations with a lower priority. The default value for all migrations is 0.

public int Priority { get; init; }

Property Value

int

Silent

Whether the migration is silent. A silent migration does not notify the underlying map or exported content that it has been applied, causing its Name not to be stored. This is useful for migrations that can check whether they've been applied some other way, like whether old data has already been removed.

public bool Silent { get; init; }

Property Value

bool

Methods

Register<T>(IEnumerable<Migration<T>>)

Registers a new set of migrations. Note that migrations do not have to be registered using Register<T>(IEnumerable<Migration<T>>) when added to a preexisting collection like Migrations or Migrations, but only when a mod adds a custom set of migrations for a custom object type.

public static void Register<T>(IEnumerable<Migration<T>> migrations)

Parameters

migrations IEnumerable<Migration<T>>

The migrations to register.

Type Parameters

T

The type of the migrations being registered.