Category:Enums: Difference between revisions

Category page
Rewording, clean up, the usual
m trailing whitespace grrr
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Enums (Enumerated Types) are Value Types which define a list of named constants. These constants names are mapped by the Enum underlying numerical value. For example a simple Enum might be the days of the week:
<languages />
 
<translate>
'''Enums''' (short for enumerated types) are [[value types]] that define a list of named constants. These constant names are mapped to underlying [[Type:Int|integer]] values.
</translate>
 
<translate>
As a general example, a simple enum might be the days of the week:
</translate>


{{Table EnumValues
{{Table EnumValues
|Monday|0|The first day of the week.
|<translate>Monday</translate>|0|<translate>The first day of the week.</translate>
|Tuesday|1|The second day of the week.
|<translate>Tuesday</translate>|1|<translate>The second day of the week.</translate>
|Wednesday|2|The third day of the week.
|<translate>Wednesday</translate>|2|<translate>The third day of the week.</translate>
|Thursday|3|The fourth day of the week.
|<translate>Thursday</translate>|3|<translate>The fourth day of the week.</translate>
|Friday|4|The fifth day of the week.
|<translate>Friday</translate>|4|<translate>The fifth day of the week.</translate>
|Saturday|5|The sixth day of the week.
|<translate>Saturday</translate>|5|<translate>The sixth day of the week.</translate>
|Sunday|6|The seventh day of the week.
|<translate>Sunday</translate>|6|<translate>The seventh day of the week.</translate>
}}
}}


Enums are commonly used in [[Resonite]] to select between different sets of behavior on [[Component]]s or in [[ProtoFlux]]. In an [[Inspector]] they are shown by their name, with the ability to switch between the possible values.  
<translate>
Enums are commonly used in [[Resonite]] to select between different sets of behavior on [[components]] or in [[ProtoFlux]]. In an [[inspector]], enums are shown by their name along with the ability to switch between the defined values.
</translate>


== Examples ==
== <translate>Examples</translate> ==


<translate>
In the [[ProtoFlux:Tween Value|Tween Node]], there is an input called [[Type:CurvePreset|CurvePreset]] which defines the type of Curve a Tween operation follows. By altering this Enum, you can change usually how smooth a Tween operation is.
In the [[ProtoFlux:Tween Value|Tween Node]], there is an input called [[Type:CurvePreset|CurvePreset]] which defines the type of Curve a Tween operation follows. By altering this Enum, you can change usually how smooth a Tween operation is.
</translate>


== In ProtoFlux ==
== <translate>In ProtoFlux</translate> ==


[[ProtoFlux]] has [[:Category:ProtoFlux:Enums|nodes for working with enum values]], such as converting between names and numeric values.
<translate>[[ProtoFlux]] has [[:Category:ProtoFlux:Enums|nodes for working with enum values]], such as converting between names and numeric values.</translate>


== Notes ==
== <translate>Notes</translate> ==


Enums may have multiple different names for the same value (example: [[Type:SessionAccessLevel|SessionAccessLevel]]
<translate>
Enums may have multiple different names for the same value (example: [[Type:SessionAccessLevel|SessionAccessLevel]])
</translate>


== See Also ==
== <translate>See Also</translate> ==


* [[:Category:Components With Nested Enums|Components With Nested Enums]] for enums that are a [[:Category:Components With Nested Types|nested type]] of a [[Component]].
* [[:Category:Components With Nested Enums]] <translate>for enums that are a [[:Category:Components With Nested Types|nested type]] of a [[Component]].</translate>
* [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/enum Enumeration types (C# reference)]
* [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/enum <translate>Microsoft documentation for C# enums.</translate>]


[[Category:Type]]
[[Category:Type]]
<!--
<!--
TODO:  
TODO:  

Latest revision as of 21:06, 30 January 2025


Enums (short for enumerated types) are value types that define a list of named constants. These constant names are mapped to underlying integer values.

As a general example, a simple enum might be the days of the week:

Values
Name Value Description
Monday 0 The first day of the week.
Tuesday 1 The second day of the week.
Wednesday 2 The third day of the week.
Thursday 3 The fourth day of the week.
Friday 4 The fifth day of the week.
Saturday 5 The sixth day of the week.
Sunday 6 The seventh day of the week.

Enums are commonly used in Resonite to select between different sets of behavior on components or in ProtoFlux. In an inspector, enums are shown by their name along with the ability to switch between the defined values.

Examples

In the Tween Node, there is an input called CurvePreset which defines the type of Curve a Tween operation follows. By altering this Enum, you can change usually how smooth a Tween operation is.

In ProtoFlux

ProtoFlux has nodes for working with enum values, such as converting between names and numeric values.

Notes

Enums may have multiple different names for the same value (example: SessionAccessLevel)

See Also

Pages in category "Enums"

The following 162 pages are in this category, out of 162 total.