ok that's enough info until prime gets me that coder<t> primitive type config list thingy |
bit more info |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
== In FrooxEngine == | == In FrooxEngine == | ||
What types are defined as value types in FrooxEngine are managed through a complicated autogenerated class called <code>Coder<T></code>. As such, it is much better to refer to [[:Category:Value Types]] for determining what is a value type in FrooxEngine. | |||
In a [[Scene Inspector]], fields holding a value type are easily identifiable by the ability to directly edit the value within them, rather than needing to drag in a reference to the type. | |||
A [[Component:ValueField|ValueField]] component is only able to be created for types that are FrooxEngine value types, so one can enter the type name while attaching the component to test whether it is a value type or not. | |||
== In ProtoFlux == | == In ProtoFlux == | ||
Line 11: | Line 15: | ||
To expand on the definition, in ProtoFlux, an ''unmanaged type'', or value type, must either (criteria not useful to Resonite excluded): | To expand on the definition, in ProtoFlux, an ''unmanaged type'', or value type, must either (criteria not useful to Resonite excluded): | ||
* Be one of <code>sbyte</code>, <code>byte</code>, <code>short</code>, <code>ushort</code>, <code>int</code>, <code>uint</code>, <code>long</code>, <code>ulong</code>, <code>char</code>, <code>float</code>, <code>double</code>, <code>decimal</code>, or <code>bool</code>. | * Be one of <code>[[Type:sbyte|sbyte]]</code>, <code>[[Type:byte|byte]]</code>, <code>[[Type:Short|short]]</code>, <code>[[Type:ushort|ushort]]</code>, <code>[[Type:int|int]]</code>, <code>[[Type:uint|uint]]</code>, <code>[[Type:long|long]]</code>, <code>[[Type:ulong|ulong]]</code>, <code>[[Type:char|char]]</code>, <code>[[Type:float|float]]</code>, <code>[[Type:double|double]]</code>, <code>[[Type:decimal|decimal]]</code>, or <code>[[Type:bool|bool]]</code>. | ||
* Be an [[Enum]] type. | * Be an [[Enum]] type. | ||
* Be defined as a non-nullable <code>struct</code> internally that only contains other value types. | * Be defined as a non-nullable <code>struct</code> internally that only contains other value types. | ||
Line 17: | Line 21: | ||
** This <em>excludes</em> [[Type:Nullable|Nullable]] types from being a ProtoFlux value type, such as <code>int?</code>. | ** This <em>excludes</em> [[Type:Nullable|Nullable]] types from being a ProtoFlux value type, such as <code>int?</code>. | ||
This discrepency between the definition of a value type in FrooxEngine and in ProtoFlux can cause some confusion. For example, a [[Type:string|string]] is a value type in FrooxEngine, but an object type in ProtoFlux. | This discrepency between the definition of a value type in FrooxEngine and in ProtoFlux can cause some confusion. For example, a [[Type:string|string]] is a value type in FrooxEngine, but an object type in ProtoFlux. This means you would use a [[Component:ValueField|ValueField]]<string> to store a string on a slot, but an [[ProtoFlux:Write|ObjectWrite]]<string> to write to the value within ProtoFlux. This is also the case with nullable types. | ||
In short, every value type in ProtoFlux is also a value type in FrooxEngine, but not every value type in FrooxEngine is a value type in ProtoFlux. | |||
== See Also == | |||
* [[:Category:Value Types]], for a list of all value types. | |||
* [[Reference Type]], for the other type of types within the FrooxEngine data model. | |||
* [[Type:Object]], for the other type of types within the ProtoFlux data model. |
Latest revision as of 20:04, 13 November 2024
A Value Type is a delegation of types within the FrooxEngine Data Model and ProtoFlux. In contrast to Reference Types, fields containing a value type store the value directly, rather than a reference to the value.
For a list of all value types in game, refer to Category:Value Types.
In FrooxEngine
What types are defined as value types in FrooxEngine are managed through a complicated autogenerated class called Coder<T>
. As such, it is much better to refer to Category:Value Types for determining what is a value type in FrooxEngine.
In a Scene Inspector, fields holding a value type are easily identifiable by the ability to directly edit the value within them, rather than needing to drag in a reference to the type.
A ValueField component is only able to be created for types that are FrooxEngine value types, so one can enter the type name while attaching the component to test whether it is a value type or not.
In ProtoFlux
In ProtoFlux, in short, if a type can be classified as an unmanaged type in C#, it is recognized as a value type. Otherwise, it is an Object Type.
To expand on the definition, in ProtoFlux, an unmanaged type, or value type, must either (criteria not useful to Resonite excluded):
- Be one of
sbyte
,byte
,short
,ushort
,int
,uint
,long
,ulong
,char
,float
,double
,decimal
, orbool
. - Be an Enum type.
- Be defined as a non-nullable
struct
internally that only contains other value types.- This encompasses many different types, such as float3, DateTime, and TangentPointFloat.
- This excludes Nullable types from being a ProtoFlux value type, such as
int?
.
This discrepency between the definition of a value type in FrooxEngine and in ProtoFlux can cause some confusion. For example, a string is a value type in FrooxEngine, but an object type in ProtoFlux. This means you would use a ValueField<string> to store a string on a slot, but an ObjectWrite<string> to write to the value within ProtoFlux. This is also the case with nullable types.
In short, every value type in ProtoFlux is also a value type in FrooxEngine, but not every value type in FrooxEngine is a value type in ProtoFlux.
See Also
- Category:Value Types, for a list of all value types.
- Reference Type, for the other type of types within the FrooxEngine data model.
- Type:Object, for the other type of types within the ProtoFlux data model.