コード例 #1
0
        private void RemoveUniqueValue(MonoBehaviourField mbField, InspectorVariableUsage variableUsage)
        {
            var valueHash = variableUsage.Value.GetHashCode();

            var previousCount = myUniqueValuesCount.GetOrEmpty(mbField).Count;

            myUniqueValuesCount.Remove(mbField, valueHash);
            var newCount = myUniqueValuesCount.GetOrEmpty(mbField).Count;

            if (newCount < 2 && newCount != previousCount)
            {
                var isRemoved = myUniqueValuesInstances.Remove(mbField, variableUsage.Value);
                Assertion.Assert(isRemoved, "value should be presented");
            }
        }
コード例 #2
0
        public void UpdateIncludes([NotNull] FileSystemPath includer, [NotNull] ICollection <FileSystemPath> includees)
        {
            lock (_locker) {
                foreach (FileSystemPath includee in _includerToIncludees[includer])
                {
                    _includeeToIncluders.Remove(includee, includer);
                }
                _includerToIncludees.RemoveKey(includer);

                if (includees.Count > 0)
                {
                    _includerToIncludees.AddRange(includer, includees);
                    foreach (FileSystemPath includee in includees)
                    {
                        _includeeToIncluders.Add(includee, includer);
                    }
                }
            }
        }