Category:Enums: Difference between revisions

Category page
m Remove node in protoflux links.
Added a link.
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Enums(Enumerated Types) are Value Types which define a list of constants. These constants are mapped inside an Enum to an underlying numerical value. For example a simple Enum might be the days of the week:
Enums (Enumerated Types) are [[:Category:Type:Value|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:


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


Enums are useful when you want a defined set of behavior for a system to follow or when you want two components of a system to speak a common language.  
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.  


In Resonite you will mostly come across Enums when you are dealing with certain ProtoFlux nodes or Components which have sets of predefined behavior which can be altered or changed by changing a value of an Enum.
== Examples ==


For example, In the [[Tween (ProtoFlux)|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 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.


[[Category:Types]]
== In ProtoFlux ==
 
[[ProtoFlux]] has [[:Category:ProtoFlux:Enums|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: [[Type:SessionAccessLevel|SessionAccessLevel]]
 
== See Also ==
 
* [[:Category:Components With Nested Enums|Components With Nested Enums]] for enums that are a [[:Category:Components With Nested Types|nested type]] of a [[Component]].
* [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/enum Enumeration types (C# reference)]
 
[[Category:Type]]




Line 21: Line 36:
TODO:  
TODO:  


* [[Types:Blend|Blend]]
* [[Type:Blend|Blend]]
* [[Types:BlendMode|BlendMode]]
* [[Type:BlendMode|BlendMode]]
* [[Types:CameraClearMode|CameraClearMode]]
* [[Type:CameraClearMode|CameraClearMode]]
* [[Types:CameraPositioningMode|CameraPositioningMode]]
* [[Type:CameraPositioningMode|CameraPositioningMode]]
* [[Types:Clear|Clear]]
* [[Type:Clear|Clear]]
* [[Types:Culling|Culling]]
* [[Type:Culling|Culling]]
* [[Types:HeadOutputDevice|HeadOutputDevice]]
* [[Type:HeadOutputDevice|HeadOutputDevice]]
* [[Types:HttpStatusCode|HttpStatusCode]]
* [[Type:LightType|LightType]]
* [[Types:Key|Key]]
* [[Type:SessionAccountLevel|SessionAccountLevel]]
* [[Types:LightType|LightType]]
* [[Type:ShadowCastMode|ShadowCastMode]]
* [[Types:SessionAccountLevel|SessionAccountLevel]]
* [[Type:TimeSlicingMode|TimeSlicingMode]]
* [[Types:ShadowCastMode|ShadowCastMode]]
* [[Type:Type|Type]]
* [[Types:TimeSlicingMode|TimeSlicingMode]]
* [[Type:ZWrite|ZWrite]]
* [[Types:Type|Type]]
* [[Type:ZTest|ZTest]]
* [[Types:ZWrite|ZWrite]]
* [[Types:ZTest|ZTest]]
-->
-->

Latest revision as of 11:24, 27 May 2024

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:

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 they are shown by their name, with the ability to switch between the possible 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 152 pages are in this category, out of 152 total.