#W# Source and Scripts added. Added Scripts/Settings.cs to expose some basic tweak able settings.
This commit is contained in:
parent
b51c58f514
commit
3045c83799
3512 changed files with 627673 additions and 0 deletions
67
Scripts/Gumps/Go/LocationTree.cs
Normal file
67
Scripts/Gumps/Go/LocationTree.cs
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using Server;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class LocationTree
|
||||
{
|
||||
private Map m_Map;
|
||||
private ParentNode m_Root;
|
||||
private Dictionary<Mobile, ParentNode> m_LastBranch;
|
||||
|
||||
public LocationTree( string fileName, Map map )
|
||||
{
|
||||
m_LastBranch = new Dictionary<Mobile, ParentNode>();
|
||||
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;
|
||||
|
||||
m_Root = Parse( xml );
|
||||
|
||||
xml.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<Mobile, ParentNode> LastBranch
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_LastBranch;
|
||||
}
|
||||
}
|
||||
|
||||
public Map Map
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Map;
|
||||
}
|
||||
}
|
||||
|
||||
public ParentNode Root
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Root;
|
||||
}
|
||||
}
|
||||
|
||||
private ParentNode Parse( XmlTextReader xml )
|
||||
{
|
||||
xml.Read();
|
||||
xml.Read();
|
||||
xml.Read();
|
||||
|
||||
return new ParentNode( xml, null );
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue