Remove raw array use from PrintQueue
This commit is contained in:
parent
ae99d41cf4
commit
0b72b7efdc
|
@ -15,6 +15,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <aoc/Grid.hpp>
|
||||
#include <aoc/Solver.hpp>
|
||||
|
||||
class PrintQueue
|
||||
|
@ -31,8 +34,8 @@ class PrintQueue
|
|||
static const int maxPageNo_{ 99 };
|
||||
bool isProcessingOrderingRules_;
|
||||
int pageNoMapIndex_;
|
||||
int pageNoMap_[maxPageNo_ + 1];
|
||||
bool orderingRules_[nPages_][nPages_];
|
||||
std::vector<int> pageNoMap_;
|
||||
Grid<bool> orderingRules_;
|
||||
size_t getMapped(const int pageNo);
|
||||
void processOrderingRule(const std::string& line);
|
||||
void processUpdatePages(const std::string& line);
|
||||
|
|
|
@ -20,20 +20,10 @@
|
|||
#include <vector>
|
||||
|
||||
PrintQueue::PrintQueue()
|
||||
: Solver{}, pageNoMapIndex_{ 0 }, isProcessingOrderingRules_{ true }, orderingRules_{}
|
||||
: Solver{}, isProcessingOrderingRules_{ true }, pageNoMapIndex_{ 0 }, pageNoMap_(maxPageNo_ + 1, -1),
|
||||
orderingRules_(nPages_, nPages_)
|
||||
{
|
||||
for (size_t i = 0; i <= maxPageNo_; i++)
|
||||
{
|
||||
pageNoMap_[i] = -1;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < nPages_; i++)
|
||||
{
|
||||
for (size_t j = 0; j < nPages_; j++)
|
||||
{
|
||||
orderingRules_[i][j] = false;
|
||||
}
|
||||
}
|
||||
orderingRules_.fill(false);
|
||||
}
|
||||
|
||||
const std::string PrintQueue::getPuzzleName() const
|
||||
|
|
Loading…
Reference in New Issue