dfhack/library/include/df/custom/coord2d_path.methods.inc

21 lines
396 B
PHTML

size_t size() const { return x.size(); }
2012-01-21 06:18:53 -07:00
coord2d operator[] (size_t idx) const {
2012-01-21 06:18:53 -07:00
if (idx >= x.size())
return coord2d();
else
return coord2d(x[idx], y[idx]);
}
void erase(size_t idx) {
2012-01-21 06:18:53 -07:00
if (idx < x.size()) {
x.erase(x.begin()+idx);
y.erase(y.begin()+idx);
}
}
void push_back(const coord2d &crd) {
x.push_back(crd.x);
y.push_back(crd.y);
}