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
72 lines (66 loc) · 2.07 KB
/
Copy pathReClassNetFile.cs
File metadata and controls
72 lines (66 loc) · 2.07 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
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using ReClassNET.Nodes;
namespace ReClassNET.DataExchange.ReClass
{
public partial class ReClassNetFile : IReClassImport, IReClassExport
{
private readonly ReClassNetProject project;
public ReClassNetFile(ReClassNetProject project)
{
Contract.Requires(project != null);
this.project = project;
}
static ReClassNetFile()
{
// Obsolete: The name of the class was changed. Because of this older files can't load this nodes.
buildInStringToTypeMap["UTF8TextNode"] = typeof(Utf8TextNode);
buildInStringToTypeMap["UTF8TextPtrNode"] = typeof(Utf8TextPtrNode);
buildInStringToTypeMap["UTF16TextNode"] = typeof(Utf16TextNode);
buildInStringToTypeMap["UTF16TextPtrNode"] = typeof(Utf16TextPtrNode);
buildInStringToTypeMap["UTF32TextNode"] = typeof(Utf32TextNode);
buildInStringToTypeMap["UTF32TextPtrNode"] = typeof(Utf32TextPtrNode);
}
private static readonly Dictionary<string, Type> buildInStringToTypeMap = new[]
{
typeof(BoolNode),
typeof(BitFieldNode),
typeof(ClassInstanceArrayNode),
typeof(ClassInstanceNode),
typeof(ClassPtrArrayNode),
typeof(ClassPtrNode),
typeof(DoubleNode),
typeof(FloatNode),
typeof(FunctionNode),
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 readonly Dictionary<Type, string> buildInTypeToStringMap = buildInStringToTypeMap.ToDictionary(kv => kv.Value, kv => kv.Key);
}
}