Example #1
0
        public void AddComponent(IEntity entity, Type componenType)
        {
            ReactorConnection connection;

            if (!_connections.TryGetValue(componenType, out connection))
            {
                var set = new HashSet <Type>(TargetTypes)
                {
                    componenType
                };
                SystemReactor reactor = _systemExecutor.GetSystemReactor(set);
                connection = new ReactorConnection(reactor, this);
                this.AddReactorsConnection(componenType, connection, reactor);
            }
            entity.Reactor = connection.UpReactor;
            _systemExecutor.AddSystemsToEntity(entity, connection);
        }
Example #2
0
 public void AddEntityToReactor(IEntity entity)
 {
     _systemExecutor.AddSystemsToEntity(entity, this);
 }