示例#1
0
 public Location(string name, GameLocationReader gameReader, GameLocationWriter gameWriter, XmlLocationReader xmlReader, XmlLocationWriter xmlWriter)
 {
     Name        = Exceptions.CheckArgumentNullOrEmprty(name, "name");
     _gameReader = Exceptions.CheckArgumentNull(gameReader, "gameReader");
     _gameWriter = Exceptions.CheckArgumentNull(gameWriter, "gameWriter");
     _xmlReader  = Exceptions.CheckArgumentNull(xmlReader, "xmlReader");
     _xmlWriter  = Exceptions.CheckArgumentNull(xmlWriter, "xmlWriter");
     _readers    = new LocationReaders(this, _xmlReader, _gameReader);
 }
示例#2
0
        public static Location FindLocation(string name)
        {
            Exceptions.CheckArgumentNullOrEmprty(name, "name");
            if (name.Length < 2)
            {
                throw new ArgumentException("name");
            }

            string transformedPath = GetTransformedPath(name);

            ArchiveDirectoryEntry locationDirectory = FindLocationDirectory(name);

            if (locationDirectory == null)
            {
                return(null);
            }

            GameLocationReader gameReader = new GameLocationReader(locationDirectory, name);
            GameLocationWriter gameWriter = new GameLocationWriter(locationDirectory, name);
            XmlLocationReader  xmlReader  = new XmlLocationReader(transformedPath);
            XmlLocationWriter  xmlWriter  = new XmlLocationWriter(transformedPath);

            return(new Location(name, gameReader, gameWriter, xmlReader, xmlWriter));
        }