-
Notifications
You must be signed in to change notification settings - Fork 1
/
Data1TextFormatter.cs
45 lines (39 loc) · 1.4 KB
/
Data1TextFormatter.cs
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
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Fire_Emblem_Three_Houses_Randomizer_V2
{
public class Data1TextFormatter : TextFormatter
{
readonly long euOffset = 6119094304;
List<Data1TextLanguageSection> languages;
public Data1TextFormatter(byte[] buffer)
{
languages = new List<Data1TextLanguageSection>();
languages.Add(new Data1TextLanguageSection(buffer, "am"));
languages.Add(new Data1TextLanguageSection(buffer, "eu"));
}
public override byte[] getBytes()
{
byte[] bytes = languages[0].getBytes();
byte[] euBytes = languages[1].getBytes();
for (int i = (int)(euOffset - Randomizer.textSectionOffset); i < bytes.Length; i++)
bytes[i] = euBytes[i];
return bytes;
}
public override List<string> getStrings(bool includeInvalids)
{
return languages[0].getStrings(includeInvalids);
}
public override void setStrings(List<string> strings, bool includeInvalids)
{
List<string> euStrings = new List<string>();
euStrings.AddRange(strings);
languages[0].setStrings(strings, includeInvalids);
languages[1].setStrings(euStrings, includeInvalids);
}
}
}