Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Bits64.cs
Go to the documentation of this file.
1namespace Terraria.Utilities;
2
3public struct Bits64
4{
5 private ulong v;
6
7 public bool this[int i]
8 {
9 get
10 {
11 return (v & (ulong)(1L << i)) != 0;
12 }
13 set
14 {
15 if (value)
16 {
17 v |= (ulong)(1L << i);
18 }
19 else
20 {
21 v &= (ulong)(~(1L << i));
22 }
23 }
24 }
25
26 public bool IsEmpty => v == 0;
27
28 public static implicit operator ulong(Bits64 b)
29 {
30 return b.v;
31 }
32
33 public static implicit operator Bits64(ulong v)
34 {
35 Bits64 result = default(Bits64);
36 result.v = v;
37 return result;
38 }
39}