Class CustomEnumDefinition
- Namespace
- DotTiled
- Assembly
- DotTiled.dll
Represents a custom enum definition in Tiled. Refer to the documentation of custom types to understand how they work.
public class CustomEnumDefinition : ICustomTypeDefinition
- Inheritance
-
CustomEnumDefinition
- Implements
- Inherited Members
Properties
ID
The ID of the custom type.
public uint ID { get; set; }
Property Value
Name
The name of the custom type.
public required string Name { get; set; }
Property Value
StorageType
The storage type of the custom enum.
public CustomEnumStorageType StorageType { get; set; }
Property Value
ValueAsFlags
Whether the value should be treated as flags.
public bool ValueAsFlags { get; set; }
Property Value
Values
The values of the custom enum.
public List<string> Values { get; set; }
Property Value
Methods
FromEnum(Type, CustomEnumStorageType)
Creates a custom enum definition from the specified enum type.
public static CustomEnumDefinition FromEnum(Type type, CustomEnumStorageType storageType = CustomEnumStorageType.String)
Parameters
type
TypeThe enum type to create a custom enum definition from.
storageType
CustomEnumStorageTypeThe storage type of the custom enum. Defaults to String to be consistent with Tiled.
Returns
FromEnum<T>(CustomEnumStorageType)
Creates a custom enum definition from the specified enum type.
public static CustomEnumDefinition FromEnum<T>(CustomEnumStorageType storageType = CustomEnumStorageType.String) where T : Enum
Parameters
storageType
CustomEnumStorageTypeThe storage type of the custom enum. Defaults to String to be consistent with Tiled.
Returns
Type Parameters
T