Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 4826153

Browse files
authored
Remove blittablebool (#965)
* Remove BlittableBool * Changelog
1 parent 2b11e4a commit 4826153

34 files changed

+128
-196
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- If you use generic `IComponentData` types, you must explicitly register them. Please view Unity's example on `RegisterGenericComponentType` in the changelog linked above.
1717
- System groups API has changed, systems without a group are automatically added to the `SimulationSystemGroup` which runs on `Update`.
1818
- The Unity Editor will print helpful warnings if any systems are not grouped properly.
19+
- Removed `BlittableBool`, as `bool` is now blittable.
1920

2021
### Changed
2122

test-project/Assets/EditmodeTests/Components/BlittableComponentTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class BlittableComponentTests
1111
private const long LongValue = 5678L;
1212
private const float FloatValue = 1.2345f;
1313
private const double DoubleValue = 3.14159;
14-
private static readonly BlittableBool BoolValue = true;
14+
private const bool BoolValue = true;
1515

1616
[Test]
1717
public void component_should_implement_ISpatialComponentData()

test-project/Assets/Generated/Source/improbable/gdk/tests/ExhaustiveMapKey.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public Snapshot ToComponentSnapshot(global::Unity.Entities.World world)
117117

118118
internal uint field1Handle;
119119

120-
public global::System.Collections.Generic.Dictionary<BlittableBool,string> Field1
120+
public global::System.Collections.Generic.Dictionary<bool,string> Field1
121121
{
122122
get => Improbable.Gdk.Tests.ExhaustiveMapKey.ReferenceTypeProviders.Field1Provider.Get(field1Handle);
123123
set
@@ -377,7 +377,7 @@ public struct Snapshot : ISpatialComponentSnapshot
377377
{
378378
public uint ComponentId => 197719;
379379

380-
public global::System.Collections.Generic.Dictionary<BlittableBool,string> Field1;
380+
public global::System.Collections.Generic.Dictionary<bool,string> Field1;
381381
public global::System.Collections.Generic.Dictionary<float,string> Field2;
382382
public global::System.Collections.Generic.Dictionary<byte[],string> Field3;
383383
public global::System.Collections.Generic.Dictionary<int,string> Field4;
@@ -396,7 +396,7 @@ public struct Snapshot : ISpatialComponentSnapshot
396396
public global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Tests.SomeType,string> Field17;
397397
public global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Tests.SomeEnum,string> Field18;
398398

399-
public Snapshot(global::System.Collections.Generic.Dictionary<BlittableBool,string> field1, global::System.Collections.Generic.Dictionary<float,string> field2, global::System.Collections.Generic.Dictionary<byte[],string> field3, global::System.Collections.Generic.Dictionary<int,string> field4, global::System.Collections.Generic.Dictionary<long,string> field5, global::System.Collections.Generic.Dictionary<double,string> field6, global::System.Collections.Generic.Dictionary<string,string> field7, global::System.Collections.Generic.Dictionary<uint,string> field8, global::System.Collections.Generic.Dictionary<ulong,string> field9, global::System.Collections.Generic.Dictionary<int,string> field10, global::System.Collections.Generic.Dictionary<long,string> field11, global::System.Collections.Generic.Dictionary<uint,string> field12, global::System.Collections.Generic.Dictionary<ulong,string> field13, global::System.Collections.Generic.Dictionary<int,string> field14, global::System.Collections.Generic.Dictionary<long,string> field15, global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Core.EntityId,string> field16, global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Tests.SomeType,string> field17, global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Tests.SomeEnum,string> field18)
399+
public Snapshot(global::System.Collections.Generic.Dictionary<bool,string> field1, global::System.Collections.Generic.Dictionary<float,string> field2, global::System.Collections.Generic.Dictionary<byte[],string> field3, global::System.Collections.Generic.Dictionary<int,string> field4, global::System.Collections.Generic.Dictionary<long,string> field5, global::System.Collections.Generic.Dictionary<double,string> field6, global::System.Collections.Generic.Dictionary<string,string> field7, global::System.Collections.Generic.Dictionary<uint,string> field8, global::System.Collections.Generic.Dictionary<ulong,string> field9, global::System.Collections.Generic.Dictionary<int,string> field10, global::System.Collections.Generic.Dictionary<long,string> field11, global::System.Collections.Generic.Dictionary<uint,string> field12, global::System.Collections.Generic.Dictionary<ulong,string> field13, global::System.Collections.Generic.Dictionary<int,string> field14, global::System.Collections.Generic.Dictionary<long,string> field15, global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Core.EntityId,string> field16, global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Tests.SomeType,string> field17, global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Tests.SomeEnum,string> field18)
400400
{
401401
Field1 = field1;
402402
Field2 = field2;
@@ -1417,7 +1417,7 @@ public static void SerializeSnapshot(global::Improbable.Gdk.Tests.ExhaustiveMapK
14171417

14181418
component.field1Handle = Improbable.Gdk.Tests.ExhaustiveMapKey.ReferenceTypeProviders.Field1Provider.Allocate(world);
14191419
{
1420-
component.Field1 = new global::System.Collections.Generic.Dictionary<BlittableBool,string>();
1420+
component.Field1 = new global::System.Collections.Generic.Dictionary<bool,string>();
14211421
var map = component.Field1;
14221422
var mapSize = obj.GetObjectCount(1);
14231423
for (var i = 0; i < mapSize; i++)
@@ -1690,7 +1690,7 @@ public static void SerializeSnapshot(global::Improbable.Gdk.Tests.ExhaustiveMapK
16901690
}
16911691
if (mapSize > 0 || isCleared)
16921692
{
1693-
update.Field1 = new global::Improbable.Gdk.Core.Option<global::System.Collections.Generic.Dictionary<BlittableBool,string>>(new global::System.Collections.Generic.Dictionary<BlittableBool,string>());
1693+
update.Field1 = new global::Improbable.Gdk.Core.Option<global::System.Collections.Generic.Dictionary<bool,string>>(new global::System.Collections.Generic.Dictionary<bool,string>());
16941694
}
16951695
for (var i = 0; i < mapSize; i++)
16961696
{
@@ -2119,7 +2119,7 @@ public static void SerializeSnapshot(global::Improbable.Gdk.Tests.ExhaustiveMapK
21192119

21202120
{
21212121
var mapSize = obj.GetObjectCount(1);
2122-
update.Field1 = new global::Improbable.Gdk.Core.Option<global::System.Collections.Generic.Dictionary<BlittableBool,string>>(new global::System.Collections.Generic.Dictionary<BlittableBool,string>());
2122+
update.Field1 = new global::Improbable.Gdk.Core.Option<global::System.Collections.Generic.Dictionary<bool,string>>(new global::System.Collections.Generic.Dictionary<bool,string>());
21232123
for (var i = 0; i < mapSize; i++)
21242124
{
21252125
var mapObj = obj.IndexObject(1, (uint) i);
@@ -2341,7 +2341,7 @@ public static void SerializeSnapshot(global::Improbable.Gdk.Tests.ExhaustiveMapK
23412341
var component = new global::Improbable.Gdk.Tests.ExhaustiveMapKey.Snapshot();
23422342

23432343
{
2344-
component.Field1 = new global::System.Collections.Generic.Dictionary<BlittableBool,string>();
2344+
component.Field1 = new global::System.Collections.Generic.Dictionary<bool,string>();
23452345
var map = component.Field1;
23462346
var mapSize = obj.GetObjectCount(1);
23472347
for (var i = 0; i < mapSize; i++)
@@ -3480,7 +3480,7 @@ public struct Update : ISpatialComponentUpdate
34803480
{
34813481
internal static Stack<List<Update>> Pool = new Stack<List<Update>>();
34823482

3483-
public Option<global::System.Collections.Generic.Dictionary<BlittableBool,string>> Field1;
3483+
public Option<global::System.Collections.Generic.Dictionary<bool,string>> Field1;
34843484
public Option<global::System.Collections.Generic.Dictionary<float,string>> Field2;
34853485
public Option<global::System.Collections.Generic.Dictionary<byte[],string>> Field3;
34863486
public Option<global::System.Collections.Generic.Dictionary<int,string>> Field4;
@@ -3560,7 +3560,7 @@ private static void SerializeSnapshot(Snapshot snapshot, ComponentData data)
35603560
private static Update SnapshotToUpdate(in Snapshot snapshot)
35613561
{
35623562
var update = new Update();
3563-
update.Field1 = new Option<global::System.Collections.Generic.Dictionary<BlittableBool,string>>(snapshot.Field1);
3563+
update.Field1 = new Option<global::System.Collections.Generic.Dictionary<bool,string>>(snapshot.Field1);
35643564
update.Field2 = new Option<global::System.Collections.Generic.Dictionary<float,string>>(snapshot.Field2);
35653565
update.Field3 = new Option<global::System.Collections.Generic.Dictionary<byte[],string>>(snapshot.Field3);
35663566
update.Field4 = new Option<global::System.Collections.Generic.Dictionary<int,string>>(snapshot.Field4);

test-project/Assets/Generated/Source/improbable/gdk/tests/ExhaustiveMapKeyComponentReaderWriter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,14 +352,14 @@ public event Action<ExhaustiveMapKey.Update> OnUpdate
352352
}
353353
}
354354

355-
private Dictionary<Action<global::System.Collections.Generic.Dictionary<BlittableBool,string>>, ulong> field1UpdateCallbackToCallbackKey;
356-
public event Action<global::System.Collections.Generic.Dictionary<BlittableBool,string>> OnField1Update
355+
private Dictionary<Action<global::System.Collections.Generic.Dictionary<bool,string>>, ulong> field1UpdateCallbackToCallbackKey;
356+
public event Action<global::System.Collections.Generic.Dictionary<bool,string>> OnField1Update
357357
{
358358
add
359359
{
360360
if (field1UpdateCallbackToCallbackKey == null)
361361
{
362-
field1UpdateCallbackToCallbackKey = new Dictionary<Action<global::System.Collections.Generic.Dictionary<BlittableBool,string>>, ulong>();
362+
field1UpdateCallbackToCallbackKey = new Dictionary<Action<global::System.Collections.Generic.Dictionary<bool,string>>, ulong>();
363363
}
364364

365365
var key = CallbackSystem.RegisterComponentUpdateCallback<ExhaustiveMapKey.Update>(EntityId, update =>

test-project/Assets/Generated/Source/improbable/gdk/tests/ExhaustiveMapKeyData.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Improbable.Gdk.Tests
1212
[global::System.Serializable]
1313
public struct ExhaustiveMapKeyData
1414
{
15-
public global::System.Collections.Generic.Dictionary<BlittableBool,string> Field1;
15+
public global::System.Collections.Generic.Dictionary<bool,string> Field1;
1616
public global::System.Collections.Generic.Dictionary<float,string> Field2;
1717
public global::System.Collections.Generic.Dictionary<byte[],string> Field3;
1818
public global::System.Collections.Generic.Dictionary<int,string> Field4;
@@ -31,7 +31,7 @@ public struct ExhaustiveMapKeyData
3131
public global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Tests.SomeType,string> Field17;
3232
public global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Tests.SomeEnum,string> Field18;
3333

34-
public ExhaustiveMapKeyData(global::System.Collections.Generic.Dictionary<BlittableBool,string> field1, global::System.Collections.Generic.Dictionary<float,string> field2, global::System.Collections.Generic.Dictionary<byte[],string> field3, global::System.Collections.Generic.Dictionary<int,string> field4, global::System.Collections.Generic.Dictionary<long,string> field5, global::System.Collections.Generic.Dictionary<double,string> field6, global::System.Collections.Generic.Dictionary<string,string> field7, global::System.Collections.Generic.Dictionary<uint,string> field8, global::System.Collections.Generic.Dictionary<ulong,string> field9, global::System.Collections.Generic.Dictionary<int,string> field10, global::System.Collections.Generic.Dictionary<long,string> field11, global::System.Collections.Generic.Dictionary<uint,string> field12, global::System.Collections.Generic.Dictionary<ulong,string> field13, global::System.Collections.Generic.Dictionary<int,string> field14, global::System.Collections.Generic.Dictionary<long,string> field15, global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Core.EntityId,string> field16, global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Tests.SomeType,string> field17, global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Tests.SomeEnum,string> field18)
34+
public ExhaustiveMapKeyData(global::System.Collections.Generic.Dictionary<bool,string> field1, global::System.Collections.Generic.Dictionary<float,string> field2, global::System.Collections.Generic.Dictionary<byte[],string> field3, global::System.Collections.Generic.Dictionary<int,string> field4, global::System.Collections.Generic.Dictionary<long,string> field5, global::System.Collections.Generic.Dictionary<double,string> field6, global::System.Collections.Generic.Dictionary<string,string> field7, global::System.Collections.Generic.Dictionary<uint,string> field8, global::System.Collections.Generic.Dictionary<ulong,string> field9, global::System.Collections.Generic.Dictionary<int,string> field10, global::System.Collections.Generic.Dictionary<long,string> field11, global::System.Collections.Generic.Dictionary<uint,string> field12, global::System.Collections.Generic.Dictionary<ulong,string> field13, global::System.Collections.Generic.Dictionary<int,string> field14, global::System.Collections.Generic.Dictionary<long,string> field15, global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Core.EntityId,string> field16, global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Tests.SomeType,string> field17, global::System.Collections.Generic.Dictionary<global::Improbable.Gdk.Tests.SomeEnum,string> field18)
3535
{
3636
Field1 = field1;
3737
Field2 = field2;
@@ -224,7 +224,7 @@ public static ExhaustiveMapKeyData Deserialize(global::Improbable.Worker.CIntero
224224
{
225225
var instance = new ExhaustiveMapKeyData();
226226
{
227-
instance.Field1 = new global::System.Collections.Generic.Dictionary<BlittableBool,string>();
227+
instance.Field1 = new global::System.Collections.Generic.Dictionary<bool,string>();
228228
var map = instance.Field1;
229229
var mapSize = obj.GetObjectCount(1);
230230
for (var i = 0; i < mapSize; i++)

test-project/Assets/Generated/Source/improbable/gdk/tests/ExhaustiveMapKeyProviders.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private static uint GetNextHandle()
8282

8383
public static class Field1Provider
8484
{
85-
private static readonly Dictionary<uint, global::System.Collections.Generic.Dictionary<BlittableBool,string>> Storage = new Dictionary<uint, global::System.Collections.Generic.Dictionary<BlittableBool,string>>();
85+
private static readonly Dictionary<uint, global::System.Collections.Generic.Dictionary<bool,string>> Storage = new Dictionary<uint, global::System.Collections.Generic.Dictionary<bool,string>>();
8686
private static readonly Dictionary<uint, global::Unity.Entities.World> WorldMapping = new Dictionary<uint, Unity.Entities.World>();
8787

8888
private static uint nextHandle = 0;
@@ -91,13 +91,13 @@ public static uint Allocate(global::Unity.Entities.World world)
9191
{
9292
var handle = GetNextHandle();
9393

94-
Storage.Add(handle, default(global::System.Collections.Generic.Dictionary<BlittableBool,string>));
94+
Storage.Add(handle, default(global::System.Collections.Generic.Dictionary<bool,string>));
9595
WorldMapping.Add(handle, world);
9696

9797
return handle;
9898
}
9999

100-
public static global::System.Collections.Generic.Dictionary<BlittableBool,string> Get(uint handle)
100+
public static global::System.Collections.Generic.Dictionary<bool,string> Get(uint handle)
101101
{
102102
if (!Storage.TryGetValue(handle, out var value))
103103
{
@@ -107,7 +107,7 @@ public static uint Allocate(global::Unity.Entities.World world)
107107
return value;
108108
}
109109

110-
public static void Set(uint handle, global::System.Collections.Generic.Dictionary<BlittableBool,string> value)
110+
public static void Set(uint handle, global::System.Collections.Generic.Dictionary<bool,string> value)
111111
{
112112
if (!Storage.ContainsKey(handle))
113113
{

0 commit comments

Comments
 (0)