public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { string str = reader.Value as string; if (str != null) { Match match = Regex.Match(str, PointerPattern); if (match.Success) { string offset = match.Groups["offset"].Value; string file = match.Groups["file"].Value; if (uint.TryParse(offset, System.Globalization.NumberStyles.HexNumber, default, out uint result)) { BinaryFile f = LevelEditorData.MainContext.GetFile(file); if (f != null) { return(new Pointer(result, f)); } } } } return(existingValue); }
public void AddFile(BinaryFile file) { MemoryMap.Files.Add(file); }
public bool FileExists(string relativePath) { BinaryFile f = GetFile(relativePath); return(f != null); }
public T GetMainFileObject <T>(BinaryFile file) where T : R1Serializable { if (file == null) { return(default);