public void Clear()
        {
            const int queryCount = 3;

            // fill with some stub data so we can verify that clearing works
            for (var i = 0; i < queryCount; i++)
            {
                var proxy = TestUtils.CreateDefaultTestProxy(out GameObject go, i);
                m_Data.Register(QueryMatchID.Generate(), GetTestQueryArgs(proxy));
                UnityObject.DestroyImmediate(go);
            }

            Assert.AreEqual(queryCount, m_Data.Count);

            m_Data.Clear();

            Assert.Zero(m_Data.Count);
            Assert.Zero(m_Data.MatchIdToIndex.Count);
            // make sure all the working index sets get cleared
            Assert.Zero(m_Data.AcquiringIndices.Count);
            Assert.Zero(m_Data.FilteredAcquiringIndices.Count);
            Assert.Zero(m_Data.PotentialMatchAcquiringIndices.Count);
            Assert.Zero(m_Data.DefiniteMatchAcquireIndices.Count);
            Assert.Zero(m_Data.UpdatingIndices.Count);
            // make sure all the actual query data gets cleared
            AssertUtils.AllEqual(m_Data.QueryMatchIds);
            AssertUtils.AllNull(m_Data.QueryArgs);
            AssertUtils.AllNull(m_Data.Conditions);
            AssertUtils.AllNull(m_Data.TraitRequirements);
            AssertUtils.AllNull(m_Data.CachedTraits);
            AssertUtils.AllNull(m_Data.ConditionRatings);
            AssertUtils.AllNull(m_Data.ConditionMatchSets);
            AssertUtils.AllNull(m_Data.ReducedConditionRatings);
            AssertUtils.AllEqual(m_Data.BestMatchDataIds);
            AssertUtils.AllNull(m_Data.QueryResults);
            AssertUtils.AllEqual(m_Data.ReAcquireOnLoss);
            AssertUtils.AllEqual(m_Data.TimeOuts);
            AssertUtils.AllEqual(m_Data.UpdateMatchInterval);
            AssertUtils.AllNull(m_Data.AcquireHandlers);
            AssertUtils.AllNull(m_Data.UpdateHandlers);
            AssertUtils.AllNull(m_Data.LossHandlers);
            AssertUtils.AllNull(m_Data.TimeoutHandlers);
        }
Ejemplo n.º 2
0
        public void Clear()
        {
            const int queryCount = 3;

            // fill with some stub data so we can verify that clearing works
            for (var i = 0; i < queryCount; i++)
            {
                GameObject go;
                TestUtils.CreateDefaultTestProxy(out go);
                RegisterFromSetArgs(GetTestQueryArgs(go));
            }

            Assert.AreEqual(queryCount, m_Data.Count);

            m_Data.Clear();

            Assert.Zero(m_Data.Count);
            Assert.Zero(m_Data.MatchIdToIndex.Count);
            // make sure all the working index sets get cleared
            Assert.Zero(m_Data.AcquiringIndices.Count);
            Assert.Zero(m_Data.FilteredAcquiringIndices.Count);
            Assert.Zero(m_Data.PotentialMatchAcquiringIndices.Count);
            Assert.Zero(m_Data.DefiniteMatchAcquireIndices.Count);
            Assert.Zero(m_Data.UpdatingIndices.Count);
            // make sure the query data gets cleared by making sure all data is the default for their type
            AssertUtils.AllEqual(m_Data.QueryMatchIds);
            AssertUtils.AllEqual(m_Data.ReAcquireOnLoss);
            AssertUtils.AllEqual(m_Data.TimeOuts);
            AssertUtils.AllEqual(m_Data.UpdateMatchInterval);
            AssertUtils.AllEqual(m_Data.LastUpdateCheckTime);
            AssertUtils.AllNull(m_Data.Relations);
            AssertUtils.AllNull(m_Data.SetQueryArgs);
            AssertUtils.AllNull(m_Data.CachedTraits);
            AssertUtils.AllNull(m_Data.RelationRatings);
            AssertUtils.AllNull(m_Data.UsedByMatch);
            AssertUtils.AllNull(m_Data.SearchData);
            AssertUtils.AllNull(m_Data.QueryResults);
            AssertUtils.AllNull(m_Data.AcquireHandlers);
            AssertUtils.AllNull(m_Data.UpdateHandlers);
            AssertUtils.AllNull(m_Data.LossHandlers);
            AssertUtils.AllNull(m_Data.TimeoutHandlers);
        }
Ejemplo n.º 3
0
        public void Clear()
        {
            const int queryCount = 3;

            // fill with some stub data so we can verify that clearing works
            for (var i = 0; i < queryCount; i++)
            {
                GameObject go;
                var        proxy = TestUtils.CreateDefaultTestProxy(out go, i);
                m_MemberData.Register(QueryMatchID.Generate(), proxy, TestUtils.DefaultSetChildArgs(proxy));
            }

            Assert.AreEqual(queryCount, m_MemberData.Count);

            m_MemberData.Clear();

            Assert.Zero(m_MemberData.Count);
            Assert.Zero(m_MemberData.MatchIdToIndex.Count);
            // make sure all the working index sets get cleared
            Assert.Zero(m_MemberData.AcquiringIndices.Count);
            Assert.Zero(m_MemberData.FilteredAcquiringIndices.Count);
            Assert.Zero(m_MemberData.PotentialMatchAcquiringIndices.Count);
            Assert.Zero(m_MemberData.DefiniteMatchAcquireIndices.Count);
            Assert.Zero(m_MemberData.UpdatingIndices.Count);
            // make sure all the actual query data gets cleared
            AssertUtils.AllEqual(m_MemberData.QueryMatchIds);
            AssertUtils.AllNull(m_MemberData.Conditions);
            AssertUtils.AllNull(m_MemberData.TraitRequirements);
            AssertUtils.AllNull(m_MemberData.CachedTraits);
            AssertUtils.AllNull(m_MemberData.ConditionRatings);
            AssertUtils.AllNull(m_MemberData.ConditionMatchSets);
            AssertUtils.AllNull(m_MemberData.ReducedConditionRatings);
            AssertUtils.AllEqual(m_MemberData.QueryMatchIds);
            AssertUtils.AllEqual(m_MemberData.BestMatchDataIds);
            AssertUtils.AllNull(m_MemberData.QueryResults);
        }