public void loopStart()
    {
        if (!refreshed.isEmpty())
        {
            for (int i = 0; i < refreshed.size(); ++i)
            {
                entityManager.refresh(refreshed.get(i));
            }
            
            refreshed.clear();
        }
        
        if (!deleted.isEmpty())
        {
            for (int i = 0; i < deleted.size(); ++i)
            {
                Entity e = deleted.get(i);
                groupManager.remove(e);
                entityManager.remove(e);
            }
            
            deleted.clear();
        }
    }