예제 #1
0
        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);
        }
예제 #2
0
 public void AddFile(BinaryFile file)
 {
     MemoryMap.Files.Add(file);
 }
예제 #3
0
        public bool FileExists(string relativePath)
        {
            BinaryFile f = GetFile(relativePath);

            return(f != null);
        }
예제 #4
0
 public T GetMainFileObject <T>(BinaryFile file) where T : R1Serializable
 {
     if (file == null)
     {
         return(default);