diff --git a/docs/docs/essentials/custom-properties.md b/docs/docs/essentials/custom-properties.md index 9fc19aa..addffd3 100644 --- a/docs/docs/essentials/custom-properties.md +++ b/docs/docs/essentials/custom-properties.md @@ -138,7 +138,7 @@ The equivalent definition in DotTiled would look like the following: var entityTypeDefinition = new CustomEnumDefinition { Name = "EntityType", - StorageType = CustomEnumStorageType.Int, + StorageType = CustomEnumStorageType.String, ValueAsFlags = false, Values = [ "Bomb", @@ -149,7 +149,7 @@ var entityTypeDefinition = new CustomEnumDefinition }; ``` -Similarly to custom class definitions, you can also automatically generate custom enum definitions from C# enums. This is done by using the method, or one of its overloads. This method will generate a from a given C# enum, and you can then use this definition when loading your maps. +Similarly to custom class definitions, you can also automatically generate custom enum definitions from C# enums. This is done by using the method, or one of its overloads. This method will generate a from a given C# enum, and you can then use this definition when loading your maps. ```csharp enum EntityType @@ -171,6 +171,9 @@ The generated custom enum definition will be identical to the one defined manual For enum definitions, the can be used to indicate that the enum should be treated as a flags enum. This will make it so the enum definition will have `ValueAsFlags = true` and the enum values will be treated as flags when working with them in DotTiled. +> [!NOTE] +> Tiled supports enums which can store their values as either strings or integers, and depending on the storage type you have specified in Tiled, you must make sure to have the same storage type in your . This can be done by setting the `StorageType` property to either `CustomEnumStorageType.String` or `CustomEnumStorageType.Int` when creating the definition, or by passing the storage type as an argument to the method. To be consistent with Tiled, will default to `CustomEnumStorageType.String` for the storage type parameter. + ## Mapping properties to C# classes or enums So far, we have only discussed how to define custom property types in DotTiled, and why they are needed. However, the most important part is how you can map properties inside your maps to their corresponding C# classes or enums.