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

Commit

Permalink
regen test project
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Balaji committed Jan 20, 2020
1 parent 91c8029 commit 900814e
Show file tree
Hide file tree
Showing 20 changed files with 1,425 additions and 1,557 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,270 +17,265 @@ public static class AProvider
{
private static readonly Dictionary<uint, global::Improbable.TestSchema.ExhaustiveRepeatedData> Storage = new Dictionary<uint, global::Improbable.TestSchema.ExhaustiveRepeatedData>();
private static readonly Dictionary<uint, global::Unity.Entities.World> WorldMapping = new Dictionary<uint, global::Unity.Entities.World>();

private static uint nextHandle = 0;

public static uint Allocate(global::Unity.Entities.World world)
{
var handle = GetNextHandle();

Storage.Add(handle, default(global::Improbable.TestSchema.ExhaustiveRepeatedData));
WorldMapping.Add(handle, world);

return handle;
}

public static global::Improbable.TestSchema.ExhaustiveRepeatedData Get(uint handle)
{
if (!Storage.TryGetValue(handle, out var value))
{
throw new ArgumentException($"AProvider does not contain handle {handle}");
}

return value;
}

public static void Set(uint handle, global::Improbable.TestSchema.ExhaustiveRepeatedData value)
{
if (!Storage.ContainsKey(handle))
{
throw new ArgumentException($"AProvider does not contain handle {handle}");
}

Storage[handle] = value;
}

public static void Free(uint handle)
{
Storage.Remove(handle);
WorldMapping.Remove(handle);
}

public static void CleanDataInWorld(global::Unity.Entities.World world)
{
var handles = WorldMapping.Where(pair => pair.Value == world).Select(pair => pair.Key).ToList();

foreach (var handle in handles)
{
Free(handle);
}
}

private static uint GetNextHandle()
{
nextHandle++;

while (Storage.ContainsKey(nextHandle))
{
nextHandle++;
}

return nextHandle;
}
}


public static class CProvider
{
private static readonly Dictionary<uint, global::Improbable.TestSchema.SomeEnum?> Storage = new Dictionary<uint, global::Improbable.TestSchema.SomeEnum?>();
private static readonly Dictionary<uint, global::Unity.Entities.World> WorldMapping = new Dictionary<uint, global::Unity.Entities.World>();

private static uint nextHandle = 0;

public static uint Allocate(global::Unity.Entities.World world)
{
var handle = GetNextHandle();

Storage.Add(handle, default(global::Improbable.TestSchema.SomeEnum?));
WorldMapping.Add(handle, world);

return handle;
}

public static global::Improbable.TestSchema.SomeEnum? Get(uint handle)
{
if (!Storage.TryGetValue(handle, out var value))
{
throw new ArgumentException($"CProvider does not contain handle {handle}");
}

return value;
}

public static void Set(uint handle, global::Improbable.TestSchema.SomeEnum? value)
{
if (!Storage.ContainsKey(handle))
{
throw new ArgumentException($"CProvider does not contain handle {handle}");
}

Storage[handle] = value;
}

public static void Free(uint handle)
{
Storage.Remove(handle);
WorldMapping.Remove(handle);
}

public static void CleanDataInWorld(global::Unity.Entities.World world)
{
var handles = WorldMapping.Where(pair => pair.Value == world).Select(pair => pair.Key).ToList();

foreach (var handle in handles)
{
Free(handle);
}
}

private static uint GetNextHandle()
{
nextHandle++;

while (Storage.ContainsKey(nextHandle))
{
nextHandle++;
}

return nextHandle;
}
}


public static class DProvider
{
private static readonly Dictionary<uint, global::System.Collections.Generic.List<global::Improbable.TestSchema.SomeType>> Storage = new Dictionary<uint, global::System.Collections.Generic.List<global::Improbable.TestSchema.SomeType>>();
private static readonly Dictionary<uint, global::Unity.Entities.World> WorldMapping = new Dictionary<uint, global::Unity.Entities.World>();

private static uint nextHandle = 0;

public static uint Allocate(global::Unity.Entities.World world)
{
var handle = GetNextHandle();

Storage.Add(handle, default(global::System.Collections.Generic.List<global::Improbable.TestSchema.SomeType>));
WorldMapping.Add(handle, world);

return handle;
}

public static global::System.Collections.Generic.List<global::Improbable.TestSchema.SomeType> Get(uint handle)
{
if (!Storage.TryGetValue(handle, out var value))
{
throw new ArgumentException($"DProvider does not contain handle {handle}");
}

return value;
}

public static void Set(uint handle, global::System.Collections.Generic.List<global::Improbable.TestSchema.SomeType> value)
{
if (!Storage.ContainsKey(handle))
{
throw new ArgumentException($"DProvider does not contain handle {handle}");
}

Storage[handle] = value;
}

public static void Free(uint handle)
{
Storage.Remove(handle);
WorldMapping.Remove(handle);
}

public static void CleanDataInWorld(global::Unity.Entities.World world)
{
var handles = WorldMapping.Where(pair => pair.Value == world).Select(pair => pair.Key).ToList();

foreach (var handle in handles)
{
Free(handle);
}
}

private static uint GetNextHandle()
{
nextHandle++;

while (Storage.ContainsKey(nextHandle))
{
nextHandle++;
}

return nextHandle;
}
}


public static class EProvider
{
private static readonly Dictionary<uint, global::System.Collections.Generic.Dictionary<global::Improbable.TestSchema.SomeEnum, global::Improbable.TestSchema.SomeType>> Storage = new Dictionary<uint, global::System.Collections.Generic.Dictionary<global::Improbable.TestSchema.SomeEnum, global::Improbable.TestSchema.SomeType>>();
private static readonly Dictionary<uint, global::Unity.Entities.World> WorldMapping = new Dictionary<uint, global::Unity.Entities.World>();

private static uint nextHandle = 0;

public static uint Allocate(global::Unity.Entities.World world)
{
var handle = GetNextHandle();

Storage.Add(handle, default(global::System.Collections.Generic.Dictionary<global::Improbable.TestSchema.SomeEnum, global::Improbable.TestSchema.SomeType>));
WorldMapping.Add(handle, world);

return handle;
}

public static global::System.Collections.Generic.Dictionary<global::Improbable.TestSchema.SomeEnum, global::Improbable.TestSchema.SomeType> Get(uint handle)
{
if (!Storage.TryGetValue(handle, out var value))
{
throw new ArgumentException($"EProvider does not contain handle {handle}");
}

return value;
}

public static void Set(uint handle, global::System.Collections.Generic.Dictionary<global::Improbable.TestSchema.SomeEnum, global::Improbable.TestSchema.SomeType> value)
{
if (!Storage.ContainsKey(handle))
{
throw new ArgumentException($"EProvider does not contain handle {handle}");
}

Storage[handle] = value;
}

public static void Free(uint handle)
{
Storage.Remove(handle);
WorldMapping.Remove(handle);
}

public static void CleanDataInWorld(global::Unity.Entities.World world)
{
var handles = WorldMapping.Where(pair => pair.Value == world).Select(pair => pair.Key).ToList();

foreach (var handle in handles)
{
Free(handle);
}
}

private static uint GetNextHandle()
{
nextHandle++;

while (Storage.ContainsKey(nextHandle))
{
nextHandle++;
}

return nextHandle;
}
}


}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ namespace Improbable.DependentSchema
{
public partial class DependentComponent
{
public class DependentComponentViewStorage : IViewStorage, IViewComponentStorage<Snapshot>,
IViewComponentUpdater<Update>
public class DependentComponentViewStorage : IViewStorage, IViewComponentStorage<Snapshot>, IViewComponentUpdater<Update>
{
private readonly Dictionary<long, Authority> authorityStates = new Dictionary<long, Authority>();
private readonly Dictionary<long, Snapshot> componentData = new Dictionary<long, Snapshot>();
Expand Down Expand Up @@ -95,7 +94,6 @@ public void ApplyUpdate(long entityId, in Update update)
return;
}


if (update.A.HasValue)
{
data.A = update.A.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@ public Event(global::Improbable.TestSchema.SomeType payload)
}
}
}

}
}
Loading

0 comments on commit 900814e

Please sign in to comment.