22 std::bitset<GRID_CELL_NUM> bitset ;
35 GridComponent(
int xpos,
int ypos,
int tscaled, std::bitset<GRID_CELL_NUM> collider_bitSet = std::bitset<GRID_CELL_NUM>())
42 bitset = collider_bitSet.set();
47 auto flippedBitset = ~bitset;
49 if (flippedBitset.none()) {
55 for (
auto gridindex = 0; gridindex < TILE_NUM_GRID_ELEMENTS; gridindex++)
57 if (bitset[gridindex]) {
58 gridPos.x = (gridindex % GRID_COLUMNS) * GRID_ELEMENT_WIDTH;
59 gridPos.y = (int)(gridindex / GRID_ROWS) * GRID_ELEMENT_HEIGHT;
69 void update(
float deltaTime)
override
74 std::string GetComponentName()
override {
75 return "GridComponent";