Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Vertical64BitStrips.cs
Go to the documentation of this file.
1using System;
2using System.Text;
3
4namespace Terraria.Utilities;
5
6public struct Vertical64BitStrips
7{
8 private Bits64[] arr;
9
10 public Bits64 this[int x]
11 {
12 get
13 {
14 return arr[x];
15 }
16 set
17 {
18 arr[x] = value;
19 }
20 }
21
23 {
24 arr = new Bits64[len];
25 }
26
27 public void Clear()
28 {
29 Array.Clear(arr, 0, arr.Length);
30 }
31
32 public void Expand3x3()
33 {
34 for (int i = 0; i < arr.Length - 1; i++)
35 {
36 ref Bits64 reference = ref arr[i];
37 reference = (ulong)reference | (ulong)arr[i + 1];
38 }
39 for (int num = arr.Length - 1; num > 0; num--)
40 {
41 ref Bits64 reference2 = ref arr[num];
42 reference2 = (ulong)reference2 | (ulong)arr[num - 1];
43 }
44 for (int j = 0; j < arr.Length; j++)
45 {
46 Bits64 bits = arr[j];
47 arr[j] = ((ulong)bits << 1) | (ulong)bits | ((ulong)bits >> 1);
48 }
49 }
50
51 public override string ToString()
52 {
53 StringBuilder stringBuilder = new StringBuilder(arr.Length * 65);
54 for (int i = 0; i < 64; i++)
55 {
56 if (i > 0)
57 {
58 stringBuilder.Append('\n');
59 }
60 for (int j = 0; j < arr.Length; j++)
61 {
62 stringBuilder.Append(this[j][i] ? 'x' : ' ');
63 }
64 }
65 return stringBuilder.ToString();
66 }
67}
static unsafe void Clear(Array array)
Definition Array.cs:755
override string ToString()
StringBuilder Append(char value, int repeatCount)