Type:IField`1: Difference between revisions

From Resonite Wiki
overhaul. TODO: move that removed information to the SyncField<T> and SyncRef<T> pages, which is what *actually* houses reference types by wrapping IField<RefID>
add image, clarification it must be a value type
 
Line 1: Line 1:
The '''IField<nowiki><T></nowiki>''' type is an [[Interface Type|Interface Type]] that designates the type it is applied to as something that is a field. This includes anything that is exposed within the [[Scene Inspector]] UI.
[[File:Inspector With ValueField And ReferenceField.webp|thumb|right|alt=An inspector containing a ValueField<int> and ReferenceField<Slot>.|All "fields" in an inspector are themselves an IField. In this image, the <code>persistent</code>, <code>UpdateOrder</code>, <code>Enabled</code>, and <code>Value</code> fields are of type [[Type:Sync`1|Sync<T>]], which implements IField. <code>Reference</code> is a [[Type:SyncRef`1|SyncRef<Slot>]], which is an IField<RefID>.]]


In addition to every feature that [[Type:IValue]] implements, this type makes things implementing it:
The '''IField<nowiki><T></nowiki>''' type is an [[Interface Type|Interface Type]] that designates the object it is applied to as something that is a field of type <code>T</code>. This includes anything that is exposed within the [[Scene Inspector]] UI.
 
In addition to every feature that [[Type:IValue|IValue]] implements, this type makes things implementing it:


* Have the ability to be [[Drive|driven]].
* Have the ability to be [[Drive|driven]].
* Synced by default, requiring a drive to become local.
* Synced by default, requiring a drive to become local.
Like IValue, the <code>T</code> type for IFields must be a [[Value Type]].


== Interfaces Implemented ==
== Interfaces Implemented ==
Line 10: Line 14:
** [[Type:IWorldElement]]
** [[Type:IWorldElement]]
** [[Type:ILinkable]]
** [[Type:ILinkable]]
* [[Type:IValue`1|IValue`1]], matching the type used for the IField
* [[Type:IValue`1]]
** [[Type:IChangeable]]
** [[Type:IChangeable]]
** [[Type:IInitializable]]
** [[Type:IInitializable]]
Line 16: Line 20:
== Types Implementing IField ==
== Types Implementing IField ==
* [[Type:SyncField`1]]
* [[Type:SyncField`1]]
** Notably, [[Type:SyncRef`1]] is actually a <code>SyncField<RefID></code>, meaning it is also an <code>IField<RefID></code>.


[[Category:Type]]
[[Category:Type]]

Latest revision as of 23:16, 15 August 2024

An inspector containing a ValueField<int> and ReferenceField<Slot>.
All "fields" in an inspector are themselves an IField. In this image, the persistent, UpdateOrder, Enabled, and Value fields are of type Sync<T>, which implements IField. Reference is a SyncRef<Slot>, which is an IField<RefID>.

The IField<T> type is an Interface Type that designates the object it is applied to as something that is a field of type T. This includes anything that is exposed within the Scene Inspector UI.

In addition to every feature that IValue implements, this type makes things implementing it:

  • Have the ability to be driven.
  • Synced by default, requiring a drive to become local.

Like IValue, the T type for IFields must be a Value Type.

Interfaces Implemented

Types Implementing IField