Пример #1
0
        public void SchedulerContainsAllSystems()
        {
            var systems = new List<ISystemInstance>()
            {
                new SystemInstanceFake(),
                new SystemInstanceFake(),
                new SystemInstanceFake(),
                new SystemInstanceFake(),
            };

            var updateScheduler = new SystemUpdateScheduler(systems);

            var scheduledSystems = updateScheduler.UpdateBursts.Single().Systems;
            scheduledSystems.Should().HaveSameCount(systems).And.Contain(systems);
        }
Пример #2
0
        public RuntimeEngine(RuntimeEntityService entityService, ISystemManager systemManager, EventQueue eventQueue, ILogger logger)
        {
            AddEntityAccessGate = new AccessGate();
            EventQueue = eventQueue;
            _logger = logger;
            EntityService = entityService;
            EntityService.AddEntityAccessGate = AddEntityAccessGate;
            SystemManager = systemManager;
            SystemUpdateScheduler = new SystemUpdateScheduler(SystemManager.Systems);

            foreach (var updateBurst in SystemUpdateScheduler.UpdateBursts)
            {
                _logger.Info($"Update Burst: {string.Join(", ", updateBurst.Systems.Select(p => p.System.Name))}");
            }

            // Add any entities that are already loaded into the engine.
            SystemManager.AddEntities(entityService.Entities);
        }