public void CopySelectionInto(IVIStar target) { if (target.Entry is IVIFile) { Debug.Log("Won't copy selection: target is not a directory"); return; } foreach (IVIStar star in selection_star_system.Root.Children) { try { if (target.Entry.FullPath.StartsWith(star.Entry.FullPath)) { continue; } IVIEntry new_entry = star.Entry.CopyTo(target.Entry as IVIDirectory); IVIStar star_in_src_sys = null; selection_sys_to_src_sys.TryGetValue(star, out star_in_src_sys); star_in_src_sys.Entry = new_entry; SourceStarSystem.NotifyCopy(dst: target, src: star_in_src_sys); } catch (Exception e) { Console.WriteLine("Failed to copy `" + star.Entry.FullPath + "` : " + e); } } DeselectAll(); }
public void GenerateNextLevel(int depth, IVIStarSystem sys, List <IVIStar> addTo) { if (depth != 1) { return; } if (Entry is IVIFile) { return; } Entry = new IVIDirectory(Entry.FullPath, 1); // XXX FIXME !! It's ugly ! This is done in two places. DoRecursively(s => s.RegenerateChildren(depth, sys.transform)); DoRecursively(s => s.PlaceChildrenAround()); DoRecursively(ComputedDepth, (s, d) => s.ResetDistanceAndScale(level: 2, sys: sys)); // XXX Hack !! DoRecursively(s => s.SetMaterial()); DoRecursively(s => s.SetLight()); DoRecursively(s => addTo.Add(s)); addTo.Remove(this); }