public void DestroySharedComponentDataSetsOrderVersionToZero()
        {
            var sharedData = new SharedData1(1);
            var entity     = m_Manager.CreateEntity();

            m_Manager.AddSharedComponentData(entity, sharedData);

            m_Manager.DestroyEntity(entity);

            Assert.AreEqual(0, m_Manager.GetSharedComponentOrderVersion(sharedData));
        }
        public void DestroySharedComponentEntity()
        {
            var sharedData = new SharedData1(1);

            var destroyEntity = m_Manager.CreateEntity(typeof(SharedData1));

            m_Manager.SetSharedComponentData(destroyEntity, sharedData);
            /*var dontDestroyEntity = */ m_Manager.Instantiate(destroyEntity);

            Assert.LessOrEqual(2, m_Manager.GetSharedComponentOrderVersion(sharedData));

            m_Manager.DestroyEntity(destroyEntity);

            Assert.LessOrEqual(3, m_Manager.GetSharedComponentOrderVersion(sharedData));
        }
        void AddEvenOddTestData()
        {
            var archetype  = m_Manager.CreateArchetype(typeof(EcsTestData));
            var evenShared = new SharedData1(evenTestValue);
            var oddShared  = new SharedData1(oddTestValue);

            for (int i = 0; i < 100; i++)
            {
                Entity e        = m_Manager.CreateEntity(archetype);
                var    testData = m_Manager.GetComponentData <EcsTestData>(e);
                testData.value = i;
                m_Manager.SetComponentData(e, testData);
                if ((i & 0x01) == 0)
                {
                    m_Manager.AddSharedComponentData(e, evenShared);
                }
                else
                {
                    m_Manager.AddSharedComponentData(e, oddShared);
                }
            }
        }