public static RegionEntry ReadMul(BinaryReader reader) { RegionEntry entry = new RegionEntry(); entry.m_Type = null; entry.m_City = null; entry.m_Name = reader.ReadFixedString(40); entry.ID = reader.ReadUInt16(); entry.X = reader.ReadUInt16(); entry.Y = reader.ReadUInt16(); entry.Width = reader.ReadUInt16(); entry.Height = reader.ReadUInt16(); entry.ZMin = reader.ReadInt16(); entry.ZMax = reader.ReadInt16(); entry.Flag = reader.ReadInt32(); entry.Description = reader.ReadFixedString(40); entry.unk1 = reader.ReadInt16(); entry.unk2 = reader.ReadInt16(); entry.unk3 = reader.ReadInt16(); entry.unk4 = reader.ReadByte(); entry.unk5 = reader.ReadInt16(); return(entry); }
public RegionMulItem(BinaryReader br) { m_Entry = RegionEntry.ReadMul(br); }
public RegionMulItem(RegionEntry entry) { m_Entry = entry; }
public static RegionEntry ReadTxt(string line) {// 2 3606 2463 11 17 0 20 1928062771 LIBRARY_OCLLO_1 17 0 0 0 0 the Ocllo Public Library RegionEntry entry = new RegionEntry(); string[] p = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); entry.m_Type = null; entry.m_City = null; int i = 0; bool errors = false; if (i < p.Length) { errors |= uint.TryParse(p[i++], out entry.ID); } if (i < p.Length) { errors |= ushort.TryParse(p[i++], out entry.X); } if (i < p.Length) { errors |= ushort.TryParse(p[i++], out entry.Y); } if (i < p.Length) { errors |= ushort.TryParse(p[i++], out entry.Width); } if (i < p.Length) { errors |= ushort.TryParse(p[i++], out entry.Height); } if (i < p.Length) { errors |= short.TryParse(p[i++], out entry.ZMin); } if (i < p.Length) { errors |= short.TryParse(p[i++], out entry.ZMax); } if (i < p.Length) { errors |= int.TryParse(p[i++], out entry.Flag); } if (i < p.Length) { entry.m_Name = p[i++]; } if (i < p.Length) { errors |= short.TryParse(p[i++], out entry.unk1); } if (i < p.Length) { errors |= short.TryParse(p[i++], out entry.unk2); } if (i < p.Length) { errors |= short.TryParse(p[i++], out entry.unk3); } if (i < p.Length) { errors |= byte.TryParse(p[i++], out entry.unk4); } if (i < p.Length) { errors |= short.TryParse(p[i++], out entry.unk5); } if (i < p.Length) { entry.Description = string.Join(" ", p, i, p.Length - i); } if (errors) { Debug.WriteLine("Error parsing Regions.txt"); } return(entry); }