|
Porytiles
|
A set of colors represented as a bitset. More...
#include <color_set.hpp>
Public Member Functions | |
| ColorSet ()=default | |
| bool | test (ColorIndex index) const |
| Tests whether a bit at the given index is set. | |
| void | set (ColorIndex index, bool value=true) |
| Sets a bit at the given index. | |
| void | reset (ColorIndex index) |
| Resets a bit at the given index to false. | |
| const std::bitset< num_colors > & | colors () const |
| Gets the underlying bitset. | |
| bool | operator== (const ColorSet &other) const =default |
| Compares two ColorSet objects for equality. | |
A set of colors represented as a bitset.
ColorSet tracks which colors are present in a set using a fixed-size bitset. Each bit position corresponds to a specific color index.
Definition at line 19 of file color_set.hpp.
|
default |
|
inline |
Gets the underlying bitset.
Returns a const reference to the internal bitset representation.
Definition at line 63 of file color_set.hpp.
|
default |
| void porytiles2::ColorSet::reset | ( | ColorIndex | index | ) |
Resets a bit at the given index to false.
Clears the bit at the specified index, setting it to false.
| index | The index of the bit to reset |
Definition at line 15 of file color_set.cpp.
| void porytiles2::ColorSet::set | ( | ColorIndex | index, |
| bool | value = true |
||
| ) |
Sets a bit at the given index.
Sets the bit at the specified index to the given value (default true).
| index | The index of the bit to set |
| value | The value to set (true or false) |
Definition at line 10 of file color_set.cpp.
| bool porytiles2::ColorSet::test | ( | ColorIndex | index | ) | const |
Tests whether a bit at the given index is set.
Returns true if the bit at the specified index is set, false otherwise.
| index | The index of the bit to test |
Definition at line 5 of file color_set.cpp.