Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void readRoomInfo(TextReader reader, ref int lineNumber, Room current, string info, List<string> imageNames, List<string> imageFiles, ref string input)
- {
- string[] words = Regex.Split(input, " ");
- current.Name = words[1];
- readNextLine(reader, ref lineNumber, ref input);
- words = Regex.Split(input, " ");
- current.Width = Convert.ToInt16(words[1]);
- readNextLine(reader, ref lineNumber, ref input);
- words = Regex.Split(input, " ");
- current.Height = Convert.ToInt16(words[1]);
- readNextLine(reader, ref lineNumber, ref input);
- words = Regex.Split(input, " ");
- current.SquareSize = Convert.ToInt16(words[1]);
- readNextLine(reader, ref lineNumber, ref input);
- words = Regex.Split(input, " ");
- string name = words[1];
- readNextLine(reader, ref lineNumber, ref input);
- readNextLine(reader, ref lineNumber, ref input);
- current.Background = new Item(name, input);
- int nameIndex = 0;
- foreach (string i in imageNames)
- {
- if (i == name)
- break;
- nameIndex++;
- }
- current.Background.Sprite = this.Content.Load<Texture2D>(imageFiles[nameIndex]);
- readNextLine(reader, ref lineNumber, ref input);
- words = Regex.Split(input, " ");
- current.SpawnX = Convert.ToInt16(words[1]);
- current.SpawnY = Convert.ToInt16(words[2]);
- readNextLine(reader, ref lineNumber, ref input);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement