aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Horizon/Sdk/Ngc/Detail/Sbv.cs
blob: d6d0bfd607d9d875f47d6cbc3fa8eafcd6365697 (plain) (blame)
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
namespace Ryujinx.Horizon.Sdk.Ngc.Detail
{
    class Sbv
    {
        private readonly SbvSelect _sbvSelect;
        private readonly Set _set;

        public SbvSelect SbvSelect => _sbvSelect;
        public Set Set => _set;

        public Sbv()
        {
            _sbvSelect = new();
            _set = new();
        }

        public Sbv(int length)
        {
            _sbvSelect = new();
            _set = new(length);
        }

        public void Build()
        {
            _set.Build();
            _sbvSelect.Build(_set.BitVector.Array, _set.BitVector.BitLength);
        }

        public bool Import(ref BinaryReader reader)
        {
            return _set.Import(ref reader) && _sbvSelect.Import(ref reader);
        }
    }
}