Enum
Overview
This library supports serializing and deserializing Enum
value fields.
Bit Flags
Enums can be bitflags marked with the FlagsAttribute
.
Serialization
Enum values are serialized as a TOML string.
If the enum is marked with the FlagsAttribute
, the enum value is serialized as a comma-separated list of enum values.
Deserialization
Enum values are deserialized from TOML as a TOML string.
Example
[Serializable]
public class Hero
{
private string _name;
private int _level;
private HeroClass _class;
private StatusEffects _statusEffects;
}
Can be serialized and deserialized as the following TOML document:
name = "Gandalf"
level = 100
class = "Wizard"
statusEffects = "Poisoned, Confused"