Porytiles
Loading...
Searching...
No Matches
pack_set.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace porytiles2 {
6
7class PackSet {
8 public:
9 static constexpr int unassigned = -1;
10
11 PackSet(unsigned int tile_index, const ColorSet &color_set)
12 : tile_index_{tile_index}, color_set_{color_set}, assigned_pal_index_{unassigned}
13 {
14 }
15
16 [[nodiscard]] unsigned int tile_index() const
17 {
18 return tile_index_;
19 }
20
21 [[nodiscard]] const ColorSet &color_set() const
22 {
23 return color_set_;
24 }
25
26 [[nodiscard]] int assigned_pal_index() const
27 {
28 return assigned_pal_index_;
29 }
30
31 void assign_pal_index(int pal_index)
32 {
33 assigned_pal_index_ = pal_index;
34 }
35
36 private:
37 unsigned int tile_index_;
38 ColorSet color_set_;
39 int assigned_pal_index_;
40};
41
42} // namespace porytiles2
A set of colors represented as a bitset.
Definition color_set.hpp:19
const ColorSet & color_set() const
Definition pack_set.hpp:21
unsigned int tile_index() const
Definition pack_set.hpp:16
int assigned_pal_index() const
Definition pack_set.hpp:26
void assign_pal_index(int pal_index)
Definition pack_set.hpp:31
static constexpr int unassigned
Definition pack_set.hpp:9
PackSet(unsigned int tile_index, const ColorSet &color_set)
Definition pack_set.hpp:11