@@ -22,12 +22,14 @@ public struct Component : IComponentData, ISpatialComponentData, ISnapshottable<
2222 // Each byte tracks 8 component properties.
2323 private byte dirtyBits0 ;
2424 private byte dirtyBits1 ;
25+ private byte dirtyBits2 ;
2526
2627 public bool IsDataDirty ( )
2728 {
2829 var isDataDirty = false ;
2930 isDataDirty |= ( dirtyBits0 != 0x0 ) ;
3031 isDataDirty |= ( dirtyBits1 != 0x0 ) ;
32+ isDataDirty |= ( dirtyBits2 != 0x0 ) ;
3133 return isDataDirty ;
3234 }
3335
@@ -45,9 +47,9 @@ component MyComponent
4547 */
4648 public bool IsDataDirty ( int propertyIndex )
4749 {
48- if ( propertyIndex < 0 || propertyIndex >= 15 )
50+ if ( propertyIndex < 0 || propertyIndex >= 16 )
4951 {
50- throw new ArgumentException ( "\" propertyIndex\" argument out of range. Valid range is [0, 14 ]. " +
52+ throw new ArgumentException ( "\" propertyIndex\" argument out of range. Valid range is [0, 15 ]. " +
5153 "Unless you are using custom component replication code, this is most likely caused by a code generation bug. " +
5254 "Please contact SpatialOS support if you encounter this issue." ) ;
5355 }
@@ -60,6 +62,8 @@ public bool IsDataDirty(int propertyIndex)
6062 return ( dirtyBits0 & ( 0x1 << propertyIndex % 8 ) ) != 0x0 ;
6163 case 1 :
6264 return ( dirtyBits1 & ( 0x1 << propertyIndex % 8 ) ) != 0x0 ;
65+ case 2 :
66+ return ( dirtyBits2 & ( 0x1 << propertyIndex % 8 ) ) != 0x0 ;
6367 }
6468
6569 return false ;
@@ -69,9 +73,9 @@ public bool IsDataDirty(int propertyIndex)
6973 // This method throws an InvalidOperationException in case your component doesn't contain properties.
7074 public void MarkDataDirty ( int propertyIndex )
7175 {
72- if ( propertyIndex < 0 || propertyIndex >= 15 )
76+ if ( propertyIndex < 0 || propertyIndex >= 16 )
7377 {
74- throw new ArgumentException ( "\" propertyIndex\" argument out of range. Valid range is [0, 14 ]. " +
78+ throw new ArgumentException ( "\" propertyIndex\" argument out of range. Valid range is [0, 15 ]. " +
7579 "Unless you are using custom component replication code, this is most likely caused by a code generation bug. " +
7680 "Please contact SpatialOS support if you encounter this issue." ) ;
7781 }
@@ -86,13 +90,17 @@ public void MarkDataDirty(int propertyIndex)
8690 case 1 :
8791 dirtyBits1 |= ( byte ) ( 0x1 << propertyIndex % 8 ) ;
8892 break ;
93+ case 2 :
94+ dirtyBits2 |= ( byte ) ( 0x1 << propertyIndex % 8 ) ;
95+ break ;
8996 }
9097 }
9198
9299 public void MarkDataClean ( )
93100 {
94101 dirtyBits0 = 0x0 ;
95102 dirtyBits1 = 0x0 ;
103+ dirtyBits2 = 0x0 ;
96104 }
97105
98106 public Snapshot ToComponentSnapshot ( global ::Unity . Entities . World world )
@@ -287,6 +295,18 @@ public long Field15
287295 }
288296 }
289297
298+ private global ::Improbable . Gdk . Tests . SomeEnum field18 ;
299+
300+ public global ::Improbable . Gdk . Tests . SomeEnum Field18
301+ {
302+ get => field18 ;
303+ set
304+ {
305+ MarkDataDirty ( 15 ) ;
306+ this . field18 = value ;
307+ }
308+ }
309+
290310 public static global ::Improbable . Worker . CInterop . ComponentData CreateSchemaComponentData (
291311 BlittableBool field1 ,
292312 float field2 ,
@@ -302,7 +322,8 @@ public long Field15
302322 int field14 ,
303323 long field15 ,
304324 global ::Improbable . Gdk . Core . EntityId field16 ,
305- global ::Improbable . Gdk . Tests . SomeType field17
325+ global ::Improbable . Gdk . Tests . SomeType field17 ,
326+ global ::Improbable . Gdk . Tests . SomeEnum field18
306327 )
307328 {
308329 var schemaComponentData = new global ::Improbable . Worker . CInterop . SchemaComponentData ( 197720 ) ;
@@ -352,6 +373,9 @@ public long Field15
352373 {
353374 global ::Improbable . Gdk . Tests . SomeType . Serialization . Serialize ( field17 , obj . AddObject ( 17 ) ) ;
354375 }
376+ {
377+ obj . AddEnum ( 18 , ( uint ) field18 ) ;
378+ }
355379 return new global ::Improbable . Worker . CInterop . ComponentData ( schemaComponentData ) ;
356380 }
357381 }
@@ -375,6 +399,7 @@ public struct Snapshot : ISpatialComponentSnapshot
375399 public long Field15 ;
376400 public global ::Improbable . Gdk . Core . EntityId Field16 ;
377401 public global ::Improbable . Gdk . Tests . SomeType Field17 ;
402+ public global ::Improbable . Gdk . Tests . SomeEnum Field18 ;
378403 }
379404
380405 public static class Serialization
@@ -426,6 +451,9 @@ public static void SerializeComponent(Improbable.Gdk.Tests.ExhaustiveBlittableSi
426451 {
427452 global ::Improbable . Gdk . Tests . SomeType . Serialization . Serialize ( component . Field17 , obj . AddObject ( 17 ) ) ;
428453 }
454+ {
455+ obj . AddEnum ( 18 , ( uint ) component . Field18 ) ;
456+ }
429457 }
430458
431459 public static void SerializeUpdate ( Improbable . Gdk . Tests . ExhaustiveBlittableSingular . Component component , global ::Improbable . Worker . CInterop . SchemaComponentUpdate updateObj )
@@ -536,6 +564,13 @@ public static void SerializeUpdate(Improbable.Gdk.Tests.ExhaustiveBlittableSingu
536564 }
537565
538566 }
567+ {
568+ if ( component . IsDataDirty ( 15 ) )
569+ {
570+ obj . AddEnum ( 18 , ( uint ) component . Field18 ) ;
571+ }
572+
573+ }
539574 }
540575
541576 public static Improbable . Gdk . Tests . ExhaustiveBlittableSingular . Component Deserialize ( global ::Improbable . Worker . CInterop . SchemaObject obj , global ::Unity . Entities . World world )
@@ -587,6 +622,9 @@ public static Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Component Deseria
587622 {
588623 component . Field17 = global ::Improbable . Gdk . Tests . SomeType . Serialization . Deserialize ( obj . GetObject ( 17 ) ) ;
589624 }
625+ {
626+ component . Field18 = ( global ::Improbable . Gdk . Tests . SomeEnum ) obj . GetEnum ( 18 ) ;
627+ }
590628 return component ;
591629 }
592630
@@ -714,6 +752,14 @@ public static Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Update Deserializ
714752 update . Field17 = new global ::Improbable . Gdk . Core . Option < global ::Improbable . Gdk . Tests . SomeType > ( value ) ;
715753 }
716754
755+ }
756+ {
757+ if ( obj . GetEnumCount ( 18 ) == 1 )
758+ {
759+ var value = ( global ::Improbable . Gdk . Tests . SomeEnum ) obj . GetEnum ( 18 ) ;
760+ update . Field18 = new global ::Improbable . Gdk . Core . Option < global ::Improbable . Gdk . Tests . SomeEnum > ( value ) ;
761+ }
762+
717763 }
718764 return update ;
719765 }
@@ -782,6 +828,10 @@ public static Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Snapshot Deserial
782828 component . Field17 = global ::Improbable . Gdk . Tests . SomeType . Serialization . Deserialize ( obj . GetObject ( 17 ) ) ;
783829 }
784830
831+ {
832+ component . Field18 = ( global ::Improbable . Gdk . Tests . SomeEnum ) obj . GetEnum ( 18 ) ;
833+ }
834+
785835 return component ;
786836 }
787837
@@ -909,6 +959,14 @@ public static void ApplyUpdate(global::Improbable.Worker.CInterop.SchemaComponen
909959 }
910960
911961 }
962+ {
963+ if ( obj . GetEnumCount ( 18 ) == 1 )
964+ {
965+ var value = ( global ::Improbable . Gdk . Tests . SomeEnum ) obj . GetEnum ( 18 ) ;
966+ component . Field18 = value ;
967+ }
968+
969+ }
912970 }
913971 }
914972
@@ -931,6 +989,7 @@ public struct Update : ISpatialComponentUpdate
931989 public Option < long > Field15 ;
932990 public Option < global ::Improbable . Gdk . Core . EntityId > Field16 ;
933991 public Option < global ::Improbable . Gdk . Tests . SomeType > Field17 ;
992+ public Option < global ::Improbable . Gdk . Tests . SomeEnum > Field18 ;
934993 }
935994
936995 public struct ReceivedUpdates : IComponentData
0 commit comments