コード例 #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];
コード例 #2
0
 public DispatcherHandler(WorkerSystem worker, World world) : base(worker, world)
 {
     entityManager = world.GetOrCreateManager <EntityManager>();
     var bookkeepingSystem = world.GetOrCreateManager <CommandRequestTrackerSystem>();
 }
コード例 #3
0
 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)
 {
 }