Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.63 KB | None | 0 0
  1.  void readRoomInfo(TextReader reader, ref int lineNumber, Room current, string info, List<string> imageNames, List<string> imageFiles, ref string input)
  2.         {
  3.             string[] words = Regex.Split(input, " ");
  4.             current.Name = words[1];
  5.             readNextLine(reader, ref lineNumber, ref input);
  6.  
  7.             words = Regex.Split(input, " ");
  8.             current.Width = Convert.ToInt16(words[1]);
  9.             readNextLine(reader, ref lineNumber, ref input);
  10.  
  11.             words = Regex.Split(input, " ");
  12.             current.Height = Convert.ToInt16(words[1]);
  13.             readNextLine(reader, ref lineNumber, ref input);
  14.  
  15.             words = Regex.Split(input, " ");
  16.             current.SquareSize = Convert.ToInt16(words[1]);
  17.             readNextLine(reader, ref lineNumber, ref input);
  18.  
  19.             words = Regex.Split(input, " ");
  20.             string name = words[1];
  21.             readNextLine(reader, ref lineNumber, ref input);
  22.             readNextLine(reader, ref lineNumber, ref input);
  23.             current.Background = new Item(name, input);
  24.             int nameIndex = 0;
  25.             foreach (string i in imageNames)
  26.             {
  27.                 if (i == name)
  28.                     break;
  29.                 nameIndex++;
  30.             }
  31.             current.Background.Sprite = this.Content.Load<Texture2D>(imageFiles[nameIndex]);
  32.             readNextLine(reader, ref lineNumber, ref input);
  33.  
  34.             words = Regex.Split(input, " ");
  35.             current.SpawnX = Convert.ToInt16(words[1]);
  36.             current.SpawnY = Convert.ToInt16(words[2]);
  37.             readNextLine(reader, ref lineNumber, ref input);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement