Beispiel #1
0
        internal MultithreadedSystem(MultithreadedSystemSharedContext sharedData, ISystem system)
        {
            System  = system;
            _shared = sharedData;

            PerformanceData = new PerformanceInformation(system);

            ITriggerFilterProvider trigger = system as ITriggerFilterProvider;

            if (trigger != null)
            {
                _filter      = new Filter(DataAccessorFactory.MapTypesToDataAccessors(trigger.RequiredDataTypes));
                _entityCache = new EntityCache(_filter);

                // all of these triggers require a filter
                _triggerAdded    = trigger as Trigger.Added;
                _triggerRemoved  = trigger as Trigger.Removed;
                _triggerModified = trigger as Trigger.Modified;
                _triggerUpdate   = trigger as Trigger.Update;
                _triggerInput    = trigger as Trigger.Input;
            }

            // these triggers don't require a filter
            _triggerGlobalPreUpdate  = system as Trigger.GlobalPreUpdate;
            _triggerGlobalPostUpdate = system as Trigger.GlobalPostUpdate;
            _triggerGlobalInput      = system as Trigger.GlobalInput;
        }
        internal MultithreadedSystem(MultithreadedSystemSharedContext sharedData, ISystem system) {
            System = system;
            _shared = sharedData;

            PerformanceData = new PerformanceInformation(system);

            ITriggerFilterProvider trigger = system as ITriggerFilterProvider;
            if (trigger != null) {
                _filter = new Filter(DataAccessorFactory.MapTypesToDataAccessors(trigger.RequiredDataTypes));
                _entityCache = new EntityCache(_filter);

                // all of these triggers require a filter
                _triggerAdded = trigger as Trigger.Added;
                _triggerRemoved = trigger as Trigger.Removed;
                _triggerModified = trigger as Trigger.Modified;
                _triggerUpdate = trigger as Trigger.Update;
                _triggerInput = trigger as Trigger.Input;
            }

            // these triggers don't require a filter
            _triggerGlobalPreUpdate = system as Trigger.GlobalPreUpdate;
            _triggerGlobalPostUpdate = system as Trigger.GlobalPostUpdate;
            _triggerGlobalInput = system as Trigger.GlobalInput;
        }