Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
62
Scripts/Gumps/Go/LocationTree.cs
Normal file
62
Scripts/Gumps/Go/LocationTree.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class LocationTree
|
||||
{
|
||||
private readonly Map m_Map;
|
||||
private readonly ParentNode m_Root;
|
||||
private readonly Dictionary<Mobile, ParentNode> m_LastBranch;
|
||||
public LocationTree(string fileName, Map map)
|
||||
{
|
||||
this.m_LastBranch = new Dictionary<Mobile, ParentNode>();
|
||||
this.m_Map = map;
|
||||
|
||||
string path = Path.Combine("Data/Locations/", fileName);
|
||||
|
||||
if (File.Exists(path))
|
||||
{
|
||||
XmlTextReader xml = new XmlTextReader(new StreamReader(path));
|
||||
|
||||
xml.WhitespaceHandling = WhitespaceHandling.None;
|
||||
|
||||
this.m_Root = this.Parse(xml);
|
||||
|
||||
xml.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<Mobile, ParentNode> LastBranch
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_LastBranch;
|
||||
}
|
||||
}
|
||||
public Map Map
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Map;
|
||||
}
|
||||
}
|
||||
public ParentNode Root
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Root;
|
||||
}
|
||||
}
|
||||
private ParentNode Parse(XmlTextReader xml)
|
||||
{
|
||||
xml.Read();
|
||||
xml.Read();
|
||||
xml.Read();
|
||||
|
||||
return new ParentNode(xml, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user