Skip to main content

ForestConverter

A class in Root.Township, Alta.Forests.

A TypeConverter that turns a string into a ForestGenerator by matching its Cache name, ignoring case. Probably used when a forest is given as a text argument, such as in console commands.

Constructors​

MemberWhat it is
ForestConverter()Creates a ForestConverter with default values.

Methods​

MemberWhat it is
override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)True for strings, otherwise defers to the base converter.
override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)Returns the first ForestGenerator.All entry whose Cache matches the string case-insensitively, or null.