Open alexey-malov opened 5 years ago
string fieldString = R"(
# G#
# ##
###)";
std::vector<std::vector<char>> m_fields;
if (CanFill({ current.x - 1, current.y }))
{
coordsStack.push({ current.x - 1, current.y });
}
if (CanFill({ current.x + 1, current.y }))
{
coordsStack.push({ current.x + 1, current.y });
}
if (CanFill({ current.x, current.y - 1 }))
{
coordsStack.push({ current.x, current.y - 1 });
}
if (CanFill({ current.x, current.y + 1 }))
{
coordsStack.push({ current.x, current.y + 1 });
}
while (m_fields.size() <= paintCoords.y)
{
m_fields.push_back({});
}
лучше сделать if () m_field.resize(paintCoords.y);
while (m_fields[paintCoords.y].size() <= paintCoords.x)
{
m_fields[paintCoords.y].push_back(EMPTY_CHAR);
}