コード例 #1
0
 public BackwardsScanner(FileStream str, WorldHeader head)
 {
     stream     = str;
     MaxX       = head.MaxTiles.X;
     MaxY       = head.MaxTiles.Y;
     header     = head;
     backReader = new BackwardsBinaryReader(stream);
 }
コード例 #2
0
		public BackwardsScanner(FileStream str, WorldHeader head)
		{
			stream = str;
			MaxX = head.MaxTiles.X;
			MaxY = head.MaxTiles.Y;
			header = head;
			backReader = new BackwardsBinaryReader(stream);
		}
コード例 #3
0
ファイル: World.cs プロジェクト: Terminologies/MoreTerra
		public String GetWorldName(String worldFile)
		{
			String worldName;
			String headerName;
			int headerId;

			try
			{
				stream = new FileStream(worldFile, FileMode.Open, FileAccess.Read);
				reader = new BinaryReader(stream);
				backReader = new BackwardsBinaryReader(stream);
			}
			catch (Exception e)
			{
				e.ToString();
				return "Error loading worldname";
			}

			// Skip the release number.
			reader.ReadInt32();
			headerName = reader.ReadString();
			headerId = reader.ReadInt32();

			if (CompareFooter(headerName, headerId) == true)
				worldName = headerName;
			else
				worldName = "Not a valid World file";

			reader.Close();

			return worldName;
		}