public Entity CreateEntity(string name)
        {
            var entity = new Entity(this, _nextEntityId, name);

            _entities.Add(entity);

            if (name != null)
            {
                _entitiesByName.Add(name, entity);
            }

            EntityCreated?.Invoke(this, entity);
            _nextEntityId++;
            return(entity);
        }
Beispiel #2
0
 private void OnEntityCreated(Entity entity)
 {
     entity.Manager = this;
     EntityCreated?.Invoke(entity);
 }
Beispiel #3
0
 public void EntityAdd(Entity e)
 {
     EntityCreated?.Invoke(e);
 }
Beispiel #4
0
 internal void OnEntityCreated(object sender, T entity)
 {
     EntityCreated?.Invoke(sender, new EntityChangedEventArgs <T>(entity));
 }
 protected void OnCreate()
 {
     EntityCreated?.Invoke(this);
     AllEntities.Add(this);
 }