contour-creator/src/CaseMap.cpp

15 lines
353 B
C++

#include "CaseMap.hh"
CaseMap::CaseMap(int width, int height, int* cases)
{
this->width = width;
this->height = height;
this->cases = cases;
}
int CaseMap::get_case(int x, int y)
{
// all the cases are in an array of ints from left to right, top to bottom
int offset = ((this->width * y) + x);
return *(this->cases + offset);
}