forked from ReClassNET/ReClass.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReClassNetFile.cs
More file actions
88 lines (79 loc) · 2.58 KB
/
Copy pathReClassNetFile.cs
File metadata and controls
88 lines (79 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Xml.Linq;
using ReClassNET.Logger;
using ReClassNET.Nodes;
using ReClassNET.Util;
namespace ReClassNET.DataExchange
{
public partial class ReClassNetFile : IReClassImport, IReClassExport
{
public const string FormatName = "ReClass.NET File";
public const string FileExtension = ".rcnet";
private const string Version1 = "1";
private const string DataFileName = "Data.xml";
private const string SerialisationClassName = "__Serialization_Class__";
public const string XmlRootElement = "reclass";
public const string XmlClassesElement = "classes";
public const string XmlClassElement = "class";
public const string XmlNodeElement = "node";
public const string XmlMethodElement = "method";
public const string XmlVersionAttribute = "version";
public const string XmlUuidAttribute = "uuid";
public const string XmlNameAttribute = "name";
public const string XmlCommentAttribute = "comment";
public const string XmlAddressAttribute = "address";
public const string XmlTypeAttribute = "type";
public const string XmlReferenceAttribute = "reference";
public const string XmlCountAttribute = "count";
public const string XmlBitsAttribute = "bits";
public const string XmlLengthAttribute = "length";
private ReClassNetProject project;
public ReClassNetFile(ReClassNetProject project)
{
Contract.Requires(project != null);
this.project = project;
}
private static Dictionary<string, Type> BuildInStringToTypeMap = new Type[]
{
typeof(BitFieldNode),
typeof(ClassInstanceArrayNode),
typeof(ClassInstanceNode),
typeof(ClassPtrArrayNode),
typeof(ClassPtrNode),
typeof(DoubleNode),
typeof(FloatNode),
typeof(FunctionPtrNode),
typeof(Hex8Node),
typeof(Hex16Node),
typeof(Hex32Node),
typeof(Hex64Node),
typeof(Int8Node),
typeof(Int16Node),
typeof(Int32Node),
typeof(Int64Node),
typeof(Matrix3x3Node),
typeof(Matrix3x4Node),
typeof(Matrix4x4Node),
typeof(UInt8Node),
typeof(UInt16Node),
typeof(UInt32Node),
typeof(UInt64Node),
typeof(UTF8TextNode),
typeof(UTF8TextPtrNode),
typeof(UTF16TextNode),
typeof(UTF16TextPtrNode),
typeof(UTF32TextNode),
typeof(UTF32TextPtrNode),
typeof(Vector2Node),
typeof(Vector3Node),
typeof(Vector4Node),
typeof(VTableNode)
}.ToDictionary(t => t.Name, t => t);
private static Dictionary<Type, string> BuildInTypeToStringMap = BuildInStringToTypeMap.ToDictionary(kv => kv.Value, kv => kv.Key);
}
}