Exemplo n.º 1
0
        protected override void addEntity(TKey key, Entity entity)
        {
            if (_index.ContainsKey(key))
            {
                throw new EntityIndexException(
                          "Entity for key '" + key + "' already exists!",
                          "Only one entity for a primary key is allowed.");
            }

            _index.Add(key, entity);

            var safeAerc = entity.aerc as SafeAERC;

            if (safeAerc != null)
            {
                if (!safeAerc.owners.Contains(this))
                {
                    entity.Retain(this);
                }
            }
            else
            {
                entity.Retain(this);
            }
        }
Exemplo n.º 2
0
        void addEntity(Group group, Entity entity, int index, IComponent component)
        {
            var added = _collectedEntities.Add(entity);

            if (added)
            {
                entity.Retain(this);
            }
        }
Exemplo n.º 3
0
        protected override void addEntity(TKey key, Entity entity)
        {
            GetEntities(key).Add(entity);

            var safeAerc = entity.aerc as SafeAERC;

            if (safeAerc != null)
            {
                if (!safeAerc.owners.Contains(this))
                {
                    entity.Retain(this);
                }
            }
            else
            {
                entity.Retain(this);
            }
        }
Exemplo n.º 4
0
        void addEntitySilently(Entity entity)
        {
            var added = _entities.Add(entity);

            if (added)
            {
                _entitiesCache     = null;
                _singleEntityCache = null;
                entity.Retain();
            }
        }
Exemplo n.º 5
0
        bool addEntitySilently(Entity entity)
        {
            var added = _entities.Add(entity);

            if (added)
            {
                _entitiesCache     = null;
                _singleEntityCache = null;
                entity.Retain(this);
            }

            return(added);
        }
Exemplo n.º 6
0
        protected override void addEntity(Entity entity, IComponent component)
        {
            var key = _getKey(entity, component);

            if (_index.ContainsKey(key))
            {
                throw new EntityIndexException("Entity for key '" + key + "' already exists!",
                                               "Only one entity for a primary key is allowed.");
            }

            _index.Add(key, entity);
            entity.Retain(this);
        }
Exemplo n.º 7
0
        void addEntity(Entity entity, int index, IComponent component)
        {
            var added = _entities.Add(entity);

            if (added)
            {
                _entitiesCache     = null;
                _singleEntityCache = null;
                entity.Retain();
                if (OnEntityAdded != null)
                {
                    OnEntityAdded(this, entity, index, component);
                }
            }
        }
Exemplo n.º 8
0
 void addEntity(Group group,
                Entity entity,
                int index,
                IComponent component)
 {
     var added = _collectedEntities.Add(entity);
     if(added) {
         entity.Retain(this);
     }
 }
Exemplo n.º 9
0
 void addEntity(Group group, Entity entity, int index, IComponent component)
 {
     _collectedEntities.Add(entity.Retain());
 }
Exemplo n.º 10
0
 protected override void addEntity(Entity entity, IComponent component)
 {
     GetEntities(_getKey(entity, component)).Add(entity);
     entity.Retain(this);
 }
Exemplo n.º 11
0
        bool addEntitySilently(Entity entity)
        {
            if(entity.isEnabled) {
                var added = _entities.Add(entity);
                if(added) {
                    _entitiesCache = null;
                    _singleEntityCache = null;
                    entity.Retain(this);
                }

                return added;
            }

            return false;
        }