public void CreateSolid(Vector2 a, Vector2 b) { EditorObject obj; if (typeIndex == 0) { obj = new SolidObject(this, a, b, editor); objectList.Add(obj); } else { obj = new EventObject(this, a, b, editor); objectList.Add(obj); } obj.Select(); }
public override void DuplicateSelected() { List <EditorObject> newObjects = new List <EditorObject>(); foreach (EditorObject obj in objectList) { if (obj.Selected) { EditorObject copy = null; if (obj is SolidObject) { copy = new SolidObject(this, obj, editor); } if (obj is EventObject) { copy = new EventObject(this, (obj as EventObject), editor); } if (copy != null) { newObjects.Add(copy); } } } if (newObjects.Count > 0) { CreateObject(newObjects.ToArray()); editor.DeselectAll(); foreach (EditorObject obj in newObjects) { editor.SelectAdd(obj.Vertices); } } }