示例#1
0
        public void TestClear()
        {
            var multi = new MultiMap <string, int> {
                { "coso", 1 }, { "coso", 2 }, { "coso", 3 }
            };

            multi.Clear();

            Assert.IsTrue(multi.Count == 0);
        }
示例#2
0
        //应用按钮
        private void tsrbtnOk_Click(object sender, EventArgs e)
        {
            string guid = NXFun.GetOnShowSheetGuid();

            if (string.IsNullOrEmpty(guid) || guid != OnEidtSheetGuid)
            {
                SetStatusLabel("当前信息与当前图纸不对应,请点击取消后重新查询尺寸标注,或者切换到之前的图纸!", 1);
                return;
            }
            Apply();
            IsEdit = false;
            //初始化
            LabelDimMap.Clear();
            LabelFcfMap.Clear();
            LabelDimList.Clear();
            LabelFcfList.Clear();
            RefreshDisplay();
            SetStatusLabel("标号编辑成功!", 2);
        }
        protected void ClearInterceptors()
        {
            foreach (KeyValuePair <MethodInfo, IList <IInterceptor> > entry in interceptors)
            {
                foreach (IInterceptor interceptor in entry.Value)
                {
                    instrumentor.RemoveInterceptor(entry.Key, interceptor);
                }
            }

            interceptors.Clear();
        }
示例#4
0
    protected override bool ModifyInternal(RoomSpec spec)
    {
        int size = spec.Random.Next(3, 5);

        BigBoss.Debug.w(Logs.LevelGen, "Size: " + size);
        // Add an extra 2 for stroke width for analysis
        size += 2;
        List <Bounding> locations = spec.Grids.FindRectangles(size, size, false, new StrokedAction <GenSpace>()
        {
            UnitAction   = Draw.Or(Draw.IsType <GenSpace>(GridType.Floor), Draw.IsType <GenSpace>(GridType.Wall)).And(Draw.Empty()),
            StrokeAction = Draw.Walkable()
        },
                                                              spec.Grids.Bounding);

        if (locations.Count == 0)
        {
            return(false);
        }
        #region Debug
        if (BigBoss.Debug.logging(Logs.LevelGen) && BigBoss.Debug.Flag(DebugManager.DebugFlag.FineSteps))
        {
            BigBoss.Debug.w(Logs.LevelGen, locations.Count + " Options: ");
            var save = new MultiMap <GenSpace>();
            var copy = new Array2D <GenSpace>(spec.Grids);
            foreach (Bounding r in locations)
            {
                save.Clear();
                copy.DrawRect(r.XMin + 1, r.XMax - 1, r.YMin + 1, r.YMax - 1, Draw.AddTo(save).And(Draw.SetTo(GridType.Path_Vert, spec.Theme)));
                copy.ToLog(Logs.LevelGen);
                copy.PutAll(save);
            }
        }
        #endregion
        Bounding l = locations.Random(spec.Random);
        // Draw inner square without stroke (stroke was just used to analyze surroundings)
        spec.Grids.DrawRect(l.XMin + 1, l.XMax - 1, l.YMin + 1, l.YMax - 1, Draw.SetTo(GridType.Wall, spec.Theme));
        return(true);
    }
示例#5
0
 public void Reset()
 {
     _bounding = null;
     Additional.Clear();
 }
示例#6
0
 public void Clear()
 {
     map.Add(Key1, Value1);
     map.Clear();
     AssertSize(0);
 }
示例#7
0
 public virtual void Reset()
 {
     _stateToRecursionOverflowConfigurationsMap.Clear();
 }
示例#8
0
 public void Clear()
 {
     graph.Clear();
     searchHelper.Clear();
 }
示例#9
0
        public override void OnHeaderGUI()
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.BeginVertical();
            bool changed = false;

            changed |= EditorGUILayoutEx.Toggle("Apply On Selection", ref applyOnSelection);
            if (!applyOnSelection)
            {
                changed |= EditorGUILayoutEx.ObjectField <Transform>("Root", ref root, true);
            }
            changed |= typeSelector.DrawSelector();
            Type type = typeSelector.type;

            if (typeSelector.GetType() != null)
            {
                if (fieldInspector.DrawFieldPopup(type, ref field))
                {
                    changed  = true;
                    property = null;
                }
                if (fieldInspector.DrawPropertyPopup(type, ref property))
                {
                    changed = true;
                    field   = null;
                }
            }
            EditorGUILayout.EndVertical();
            if (type != null && changed)
            {
                if (applyOnSelection)
                {
                    if (Selection.gameObjects.Length > 0)
                    {
                        targets.Clear();
                        foreach (GameObject o in Selection.gameObjects)
                        {
                            foreach (Component c in o.GetComponentsInChildren(type, true))
                            {
                                targets.Add(type, c);
                            }
                        }
                    }
                    else if (Selection.objects.Length > 0)
                    {
                        targets.Clear();
                        foreach (Object o in Selection.objects)
                        {
                            if (o is Component)
                            {
                                targets.Add(o.GetType(), o as Component);
                            }
                        }
                    }
                }
                else if (!applyOnSelection && root != null)
                {
                    targets.Clear();
                    foreach (Component c in root.GetComponentsInChildren(type, true))
                    {
                        targets.Add(type, c);
                    }
                }
            }
            EditorGUILayout.EndHorizontal();
        }
示例#10
0
 public void DeleteAllHoldings()
 {
     Holdings.Clear();
 }
示例#11
0
 private void ClearStep()
 {
     currentStepStack.Clear();
     continuationMap.Clear();
 }