Skip to main content

StatConverter

A class in Root.Township, Alta.StatSystem.

Type converter that turns a stat name into the Stat on the last parsed player, for console command arguments. The player argument must come first.

Constructors​

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

Properties​

MemberWhat it is
static Stat Last { get; private set; }The stat returned by the last conversion.

Methods​

MemberWhat it is
override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)True for strings.
override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)Looks the lowercased name up in the health stat manager of PlayerConverter.Last. Returns null and logs if there is no player.