protected ImmutableBag<Component> getComponents(Entity e)
    {
        entityComponents.clear();
        
        for (int i = 0; i < componentsByType.size(); ++i)
        {
            Bag<Component> components = componentsByType.get(i);
            
            if (components != null && e.getId() < components.size())
            {
                Component component = components.get(e.getId());
                
                if (component != null)
                {
                    entityComponents.add(component);
                }
            }
        }
        
        return entityComponents;
    }