Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region ReadRooms
- private ResourceCollection<Room> ReadRooms(ResourceCollection<Object> objects)
- {
- ReadInt();
- ResourceCollection<Room> rooms = new ResourceCollection<Room>();
- int count = ReadInt();
- for (int i = 0; i < count; i++)
- {
- if (!ReadBool())
- {
- rooms.LastId++;
- continue;
- }
- Room room = new Room();
- room.Id = i;
- room.Name = ReadString();
- ReadInt();
- room.Caption = ReadString();
- room.Width = ReadInt();
- room.Height = ReadInt();
- room.SnapY = ReadInt();
- room.SnapX = ReadInt();
- room.IsometricGrid = ReadBool();
- room.Speed = ReadInt();
- room.Persistent = ReadBool();
- room.BackgroundColor = ReadInt();
- room.DrawBackgroundColor = ReadBool();
- room.CreationCode = ReadString();
- room.Parallaxs = new Parallax[ReadInt()];
- for (int j = 0; j < room.Parallaxs.Length; j++)
- {
- room.Parallaxs[j] = new Parallax();
- room.Parallaxs[j].Visible = ReadBool();
- room.Parallaxs[j].Foreground = ReadBool();
- room.Parallaxs[j].BackgroundId = ReadInt();
- room.Parallaxs[j].X = ReadInt();
- room.Parallaxs[j].Y = ReadInt();
- room.Parallaxs[j].TileHorizontally = ReadBool();
- room.Parallaxs[j].TileVertically = ReadBool();
- room.Parallaxs[j].HorizontalSpeed = ReadInt();
- room.Parallaxs[j].VerticalSpeed = ReadInt();
- room.Parallaxs[j].Stretch = ReadBool();
- }
- room.EnableViews = ReadBool();
- room.Views = new View[ReadInt()];
- for (int j = 0; j < room.Views.Length; j++)
- {
- room.Views[j] = new View();
- room.Views[j].Visible = ReadBool();
- room.Views[j].ViewX = ReadInt();
- room.Views[j].ViewY = ReadInt();
- room.Views[j].ViewWidth = ReadInt();
- room.Views[j].ViewHeight = ReadInt();
- room.Views[j].PortX = ReadInt();
- room.Views[j].PortY = ReadInt();
- room.Views[j].PortWidth = ReadInt();
- room.Views[j].PortHeight = ReadInt();
- room.Views[j].HorizontalBorder = ReadInt();
- room.Views[j].VerticalBorder = ReadInt();
- room.Views[j].HorizontalSpeed = ReadInt();
- room.Views[j].VerticalSpeed = ReadInt();
- room.Views[j].FollowObject = ReadInt();
- }
- int instanceCount = ReadInt();
- for (int j = 0; j < instanceCount; j++)
- {
- Instance instance = new Instance();
- instance.X = ReadInt();
- instance.Y = ReadInt();
- instance.ObjectId = ReadInt();
- instance.Id = ReadInt();
- instance.CreationCode = ReadString();
- instance.Locked = ReadBool();
- Object obj = objects.Find(delegate(Object o) { return o.Id == instance.ObjectId; });
- if (obj != null)
- {
- instance.Name = obj.Name;
- instance.Depth = obj.Depth;
- }
- room.Instances.Add(instance);
- }
- int tileCount = ReadInt();
- for (int j = 0; j < tileCount; j++)
- {
- Tile tile = new Tile();
- tile.X = ReadInt();
- tile.Y = ReadInt();
- tile.BackgroundId = ReadInt();
- tile.BackgroundX = ReadInt();
- tile.BackgroundY = ReadInt();
- tile.Width = ReadInt();
- tile.Height = ReadInt();
- tile.Depth = ReadInt();
- tile.Locked = ReadBool();
- room.Tiles.Add(tile);
- }
- room.RememberWindowSize = ReadBool();
- room.EditorWidth = ReadInt();
- room.EditorHeight = ReadInt();
- room.ShowGrid = ReadBool();
- room.ShowObjects = ReadBool();
- room.ShowTiles = ReadBool();
- room.ShowBackgrounds = ReadBool();
- room.ShowForegrounds = ReadBool();
- room.ShowViews = ReadBool();
- room.DeleteUnderlyingObjects = ReadBool();
- room.DeleteUnderlyingTiles = ReadBool();
- room.CurrentTab = (TabSetting)ReadInt();
- room.ScrollBarX = ReadInt();
- room.ScrollBarY = ReadInt();
- rooms.Add(room);
- }
- return rooms;
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement