コード例 #1
0
 public void GetAllComponentsOnAllEntities()
 {
     for (var i = 0; i < Entities; i++)
     {
         _system.Process(_entities[i]);
     }
 }
コード例 #2
0
        public IDisposable ProcessEntity(IReactToEntitySystem system, IEntity entity)
        {
            var hasEntityPredicate = system.Group is IHasPredicate;
            var reactObservable    = system.ReactToEntity(entity);

            if (false == hasEntityPredicate)
            {
                return(reactObservable.Subscribe(system.Process));
            }

            var groupPredicate = (IHasPredicate)system.Group;

            return(reactObservable.Subscribe(x =>
            {
                if (groupPredicate.CanProcessEntity(x))
                {
                    system.Process(x);
                }
            }));
        }