예제 #1
0
            public void PopulateReactiveCommandComponents(CommandSystem commandSystem, EntityManager entityManager, WorkerSystem workerSystem, World world)
            {
                var receivedRequests = commandSystem.GetRequests <FirstCommand.ReceivedRequest>();

                // todo Not efficient if it keeps jumping all over entities but don't care right now
                for (int i = 0; i < receivedRequests.Count; ++i)
                {
                    if (!workerSystem.TryGetEntity(receivedRequests[i].EntityId, out var entity))
                    {
                        continue;
                    }

                    List <FirstCommand.ReceivedRequest> requests;
                    if (entityManager.HasComponent <global::Improbable.Gdk.Tests.NonblittableTypes.NonBlittableComponent.CommandRequests.FirstCommand>(entity))
                    {
                        requests = entityManager.GetComponentData <global::Improbable.Gdk.Tests.NonblittableTypes.NonBlittableComponent.CommandRequests.FirstCommand>(entity).Requests;
                    }
                    else
                    {
                        var data = new global::Improbable.Gdk.Tests.NonblittableTypes.NonBlittableComponent.CommandRequests.FirstCommand
                        {
                            CommandListHandle = ReferenceTypeProviders.FirstCommandRequestsProvider.Allocate(world)
                        };
                        data.Requests = new List <FirstCommand.ReceivedRequest>();
                        requests      = data.Requests;
                        entityManager.AddComponentData(entity, data);
                    }

                    requests.Add(receivedRequests[i]);
                }


                var receivedResponses = commandSystem.GetResponses <FirstCommand.ReceivedResponse>();

                // todo Not efficient if it keeps jumping all over entities but don't care right now
                for (int i = 0; i < receivedResponses.Count; ++i)
                {
                    ref readonly var response = ref receivedResponses[i];
 public DispatcherHandler(WorkerSystem worker, World world) : base(worker, world)
 {
     entityManager = world.GetOrCreateManager <EntityManager>();
     var bookkeepingSystem = world.GetOrCreateManager <CommandRequestTrackerSystem>();
 }
 protected SubscriptionManager(World world)
 {
     World        = world;
     WorkerSystem = world.GetExistingSystem <WorkerSystem>();
 }
예제 #4
0
            public void PopulateReactiveComponents(ComponentUpdateSystem updateSystem, EntityManager entityManager, WorkerSystem workerSystem, World world)
            {
                var updatesReceived = updateSystem.GetComponentUpdatesReceived <Update>();

                for (int i = 0; i < updatesReceived.Count; ++i)
                {
                    ref readonly var update = ref updatesReceived[i];
예제 #5
0
 public EntityGameObjectLinker(World world, WorkerSystem worker)
 {
     this.world    = world;
     this.worker   = worker;
     entityManager = world.GetExistingManager <EntityManager>();
 }
예제 #6
0
 public TestComponentDispatcherBase(WorkerSystem worker, World world) : base(worker, world)
 {
     EntityManager = world.GetOrCreateManager <EntityManager>();
 }
예제 #7
0
 public SecondComponentDispatcher(WorkerSystem worker, World world) : base(worker, world)
 {
 }
예제 #8
0
 public FirstComponentDispatcher(WorkerSystem worker, World world) : base(worker, world)
 {
 }