Exemple #1
0
 public NbtFileNode(NbtTreeModel tree, INode parent, NbtFile file) : base(tree, parent)
 {
     File = file;
     File.RootTag.OnChanged       += RootTag_Changed;
     File.RootTag.ActionPerformed += RootTag_ActionPerformed;
     File.OnSaved += File_OnSaved;
 }
 public RegionFileNode(NbtTreeModel tree, INode parent, RegionFile file) : base(tree, parent)
 {
     Region = file;
     Region.ChunksChanged += Region_ChunksChanged;
     Region.ActionPerformed += Region_ActionPerformed;
     Region.OnSaved += Region_OnSaved;
 }
Exemple #3
0
 public static INode CreateNode(NbtTreeModel tree, INode parent, object item)
 {
     foreach (var converter in RegisteredConverters)
     {
         if (converter.Key.IsInstanceOfType(item))
         {
             return(converter.Value(tree, parent, item));
         }
     }
     throw new InvalidOperationException($"No registered converter for {item.GetType()}");
 }
Exemple #4
0
 public ChunkNode(NbtTreeModel tree, INode parent, Chunk chunk) : base(tree, parent)
 {
     Chunk = chunk;
     if (Chunk.IsLoaded)
     {
         SetupEvents();
     }
     else
     {
         Chunk.OnLoaded += Chunk_OnLoaded;
     }
 }
Exemple #5
0
 public ModelRootNode(NbtTreeModel tree, IEnumerable <object> children) : base(tree, null)
 {
     ChildObjects = children.ToList();
 }
Exemple #6
0
 public static INode CreateRootNode(NbtTreeModel tree, object item) => CreateNode(tree, null, item);
Exemple #7
0
 public NbtTagNode(NbtTreeModel tree, INode parent, NbtTag tag) : base(tree, parent)
 {
     Tag                  = tag;
     Tag.OnChanged       += Tag_Changed;
     Tag.ActionPerformed += Tag_ActionPerformed;
 }
Exemple #8
0
 public ModelNode(NbtTreeModel tree, INode parent)
 {
     Tree   = tree;
     Parent = parent;
 }
Exemple #9
0
 public FolderNode(NbtTreeModel tree, INode parent, NbtFolder folder) : base(tree, parent)
 {
     Folder = folder;
     Folder.ContentsChanged += Folder_ContentsChanged;
 }