Lodestone.Common
Loading...
Searching...
No Matches
BitStorage.h
Go to the documentation of this file.
1//
2// Created by Zero on 11/25/25.
3//
4
5#ifndef LODESTONE_BITSTORAGE_H
6#define LODESTONE_BITSTORAGE_H
7#include <cstdint>
8
10
12
14 public:
15 BitStorage(unsigned int length, unsigned int bits);
16 BitStorage(uint8_t *data, unsigned int bits);
17 ~BitStorage() override;
18
19 int getIndex(unsigned int x, unsigned int y, unsigned int z) const override;
20 int getNibble(unsigned int x, unsigned int y, unsigned int z) const override;
21 void setNibble(unsigned int x, unsigned int y, unsigned int z, unsigned int value) override;
22
23 private:
27 uint8_t *m_data;
28
29 const unsigned int m_bitWidth;
30
32 bool m_owned;
33 };
34
35} // namespace lodestone::level::types
36
37#endif // LODESTONE_BITSTORAGE_H
uint8_t * m_data
Indexed by YZX.
Definition BitStorage.h:27
BitStorage(unsigned int length, unsigned int bits)
Definition BitStorage.cpp:8
const unsigned int m_bitWidth
Definition BitStorage.h:29
int getIndex(unsigned int x, unsigned int y, unsigned int z) const override
Definition BitStorage.cpp:14
int getNibble(unsigned int x, unsigned int y, unsigned int z) const override
Definition BitStorage.cpp:18
void setNibble(unsigned int x, unsigned int y, unsigned int z, unsigned int value) override
Definition BitStorage.cpp:28
~BitStorage() override
Definition BitStorage.cpp:12
bool m_owned
Whether we own the array we're storing.
Definition BitStorage.h:32
Definition AbstractBitStorage.cpp:6