Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AsciiByteMap.cs
Go to the documentation of this file.
2
4
5internal struct AsciiByteMap
6{
7 private unsafe fixed byte Buffer[128];
8
9 internal unsafe void InsertAsciiChar(char key, byte value)
10 {
11 if (key < '\u0080')
12 {
13 Buffer[(uint)key] = value;
14 }
15 }
16
17 [MethodImpl(MethodImplOptions.AggressiveInlining)]
18 internal unsafe readonly bool TryLookup(Rune key, out byte value)
19 {
20 if (key.IsAscii)
21 {
22 byte b = Buffer[(uint)key.Value];
23 if (b != 0)
24 {
25 value = b;
26 return true;
27 }
28 }
29 value = 0;
30 return false;
31 }
32}
unsafe void InsertAsciiChar(char key, byte value)
unsafe readonly bool TryLookup(Rune key, out byte value)