public ExhaustiveSingularData(bool field1, float field2, byte[] field3, int field4, long field5, double field6, string field7, uint field8, ulong field9, int field10, long field11, uint field12, ulong field13, int field14, long field15, global::Improbable.Gdk.Core.EntityId field16, global::Improbable.Gdk.Tests.SomeType field17, global::Improbable.Gdk.Tests.SomeEnum field18) { Field1 = field1; Field2 = field2; Field3 = field3; Field4 = field4; Field5 = field5; Field6 = field6; Field7 = field7; Field8 = field8; Field9 = field9; Field10 = field10; Field11 = field11; Field12 = field12; Field13 = field13; Field14 = field14; Field15 = field15; Field16 = field16; Field17 = field17; Field18 = field18; }
private void LogInvalidAuthorityTransition(Authority newAuthority, Authority expectedOldAuthority, global::Improbable.Gdk.Core.EntityId entityId) { LogDispatcher.HandleLog(LogType.Error, new LogEvent(InvalidAuthorityChange) .WithField(LoggingUtils.LoggerName, LoggerName) .WithField(LoggingUtils.EntityId, entityId.Id) .WithField("New Authority", newAuthority) .WithField("Expected Old Authority", expectedOldAuthority) .WithField("Component", "Improbable.Gdk.Tests.ExhaustiveBlittableSingular") ); }
private void ApplyAuthorityChange(Unity.Entities.Entity entity, Authority authority, global::Improbable.Gdk.Core.EntityId entityId) { switch (authority) { case Authority.Authoritative: if (!entityManager.HasComponent <NotAuthoritative <Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Component> >(entity)) { LogInvalidAuthorityTransition(Authority.Authoritative, Authority.NotAuthoritative, entityId); return; } entityManager.RemoveComponent <NotAuthoritative <Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Component> >(entity); entityManager.AddComponent(entity, ComponentType.Create <Authoritative <Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Component> >()); // Add event senders break; case Authority.AuthorityLossImminent: if (!entityManager.HasComponent <Authoritative <Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Component> >(entity)) { LogInvalidAuthorityTransition(Authority.AuthorityLossImminent, Authority.Authoritative, entityId); return; } entityManager.AddComponent(entity, ComponentType.Create <AuthorityLossImminent <Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Component> >()); break; case Authority.NotAuthoritative: if (!entityManager.HasComponent <Authoritative <Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Component> >(entity)) { LogInvalidAuthorityTransition(Authority.NotAuthoritative, Authority.Authoritative, entityId); return; } if (entityManager.HasComponent <AuthorityLossImminent <Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Component> >(entity)) { entityManager.RemoveComponent <AuthorityLossImminent <Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Component> >(entity); } entityManager.RemoveComponent <Authoritative <Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Component> >(entity); entityManager.AddComponent(entity, ComponentType.Create <NotAuthoritative <Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Component> >()); // Remove event senders break; } List <Authority> authorityChanges; if (entityManager.HasComponent <AuthorityChanges <Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Component> >(entity)) { authorityChanges = entityManager.GetComponentData <AuthorityChanges <Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Component> >(entity).Changes; } else { var changes = new AuthorityChanges <Improbable.Gdk.Tests.ExhaustiveBlittableSingular.Component> { Handle = AuthorityChangesProvider.Allocate(World) }; AuthorityChangesProvider.Set(changes.Handle, new List <Authority>()); authorityChanges = changes.Changes; entityManager.AddComponentData(entity, changes); } authorityChanges.Add(authority); }
private void ApplyAuthorityChange(Unity.Entities.Entity entity, Authority authority, global::Improbable.Gdk.Core.EntityId entityId) { switch (authority) { case Authority.Authoritative: if (!entityManager.HasComponent <NotAuthoritative <Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component> >(entity)) { LogInvalidAuthorityTransition(Authority.Authoritative, Authority.NotAuthoritative, entityId); return; } entityManager.RemoveComponent <NotAuthoritative <Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component> >(entity); entityManager.AddComponent(entity, ComponentType.Create <Authoritative <Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component> >()); // Add event senders { var eventSender = new EventSender.MyEvent() { handle = ReferenceTypeProviders.MyEventProvider.Allocate(World) }; ReferenceTypeProviders.MyEventProvider.Set(eventSender.handle, new List <global::Improbable.Gdk.Tests.AlternateSchemaSyntax.RandomDataType>()); entityManager.AddComponentData(entity, eventSender); } break; case Authority.AuthorityLossImminent: if (!entityManager.HasComponent <Authoritative <Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component> >(entity)) { LogInvalidAuthorityTransition(Authority.AuthorityLossImminent, Authority.Authoritative, entityId); return; } entityManager.AddComponent(entity, ComponentType.Create <AuthorityLossImminent <Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component> >()); break; case Authority.NotAuthoritative: if (!entityManager.HasComponent <Authoritative <Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component> >(entity)) { LogInvalidAuthorityTransition(Authority.NotAuthoritative, Authority.Authoritative, entityId); return; } if (entityManager.HasComponent <AuthorityLossImminent <Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component> >(entity)) { entityManager.RemoveComponent <AuthorityLossImminent <Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component> >(entity); } entityManager.RemoveComponent <Authoritative <Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component> >(entity); entityManager.AddComponent(entity, ComponentType.Create <NotAuthoritative <Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component> >()); // Remove event senders { var eventSender = entityManager.GetComponentData <EventSender.MyEvent>(entity); ReferenceTypeProviders.MyEventProvider.Free(eventSender.handle); entityManager.RemoveComponent <EventSender.MyEvent>(entity); } break; } List <Authority> authorityChanges; if (entityManager.HasComponent <AuthorityChanges <Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component> >(entity)) { authorityChanges = entityManager.GetComponentData <AuthorityChanges <Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component> >(entity).Changes; } else { var changes = new AuthorityChanges <Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component> { Handle = AuthorityChangesProvider.Allocate(World) }; AuthorityChangesProvider.Set(changes.Handle, new List <Authority>()); authorityChanges = changes.Changes; entityManager.AddComponentData(entity, changes); } authorityChanges.Add(authority); }
public CreatePlayerResponse(global::Improbable.Gdk.Core.EntityId createdEntityId) { CreatedEntityId = createdEntityId; }