diff --git a/util/Grid.cpp b/util/Grid.cpp index 2f294c4..2e44298 100644 --- a/util/Grid.cpp +++ b/util/Grid.cpp @@ -15,6 +15,10 @@ Grid::Grid(cells gridCells, cells background, const std::map std::copy_if(background.begin(), background.end(), std::back_inserter(slipperyEast), [](cell c) { return c.type == Type::SlipperyEast; }); std::copy_if(background.begin(), background.end(), std::back_inserter(slipperySouth), [](cell c) { return c.type == Type::SlipperySouth; }); std::copy_if(background.begin(), background.end(), std::back_inserter(slipperyWest), [](cell c) { return c.type == Type::SlipperyWest; }); + std::copy_if(background.begin(), background.end(), std::back_inserter(slipperyNorthWest), [](cell c) { return c.type == Type::SlipperyNorthWest; }); + std::copy_if(background.begin(), background.end(), std::back_inserter(slipperyNorthEast), [](cell c) { return c.type == Type::SlipperyNorthEast; }); + std::copy_if(background.begin(), background.end(), std::back_inserter(slipperySouthWest), [](cell c) { return c.type == Type::SlipperySouthWest; }); + std::copy_if(background.begin(), background.end(), std::back_inserter(slipperySouthEast), [](cell c) { return c.type == Type::SlipperySouthEast; }); std::copy_if(gridCells.begin(), gridCells.end(), std::back_inserter(lockedDoors), [](cell c) { return c.type == Type::LockedDoor; }); std::copy_if(gridCells.begin(), gridCells.end(), std::back_inserter(unlockedDoors), [](cell c) { return c.type == Type::Door; }); std::copy_if(gridCells.begin(), gridCells.end(), std::back_inserter(goals), [](cell c) { return c.type == Type::Goal; }); @@ -157,7 +161,7 @@ void Grid::printToPrism(std::ostream& os, std::vector& configurat std::map wallRestrictions = {{"North", northRestriction}, {"East", eastRestriction}, {"South", southRestriction}, {"West", westRestriction}}; - std::map slipperyTiles = {{"North", slipperyNorth}, {"East", slipperyEast}, {"South", slipperySouth}, {"West", slipperyWest}}; + std::map slipperyTiles = {{"North", slipperyNorth}, {"East", slipperyEast}, {"South", slipperySouth}, {"West", slipperyWest}, {"NorthWest", slipperyNorthWest}, {"NorthEast", slipperyNorthEast},{"SouthWest", slipperySouthWest},{"SouthEast", slipperySouthEast}}; std::vector agentNames; std::transform(agentNameAndPositionMap.begin(), diff --git a/util/Grid.h b/util/Grid.h index 3d7f23d..f741473 100644 --- a/util/Grid.h +++ b/util/Grid.h @@ -46,6 +46,10 @@ class Grid { cells slipperyEast; cells slipperySouth; cells slipperyWest; + cells slipperyNorthWest; + cells slipperyNorthEast; + cells slipperySouthWest; + cells slipperySouthEast; cells lockedDoors; cells unlockedDoors; cells boxes; diff --git a/util/MinigridGrammar.h b/util/MinigridGrammar.h index e2cfddc..ea6c1cf 100644 --- a/util/MinigridGrammar.h +++ b/util/MinigridGrammar.h @@ -66,6 +66,10 @@ template ("e", Type::SlipperyEast) ("s", Type::SlipperySouth) ("w", Type::SlipperyWest) + ("a", Type::SlipperyNorthWest) + ("b", Type::SlipperyNorthEast) + ("c", Type::SlipperySouthWest) + ("d", Type::SlipperySouthEast) ("X", Type::Agent) ("Z", Type::Adversary); color_.add @@ -74,8 +78,9 @@ template ("B", Color::Blue) ("P", Color::Purple) ("Y", Color::Yellow) + ("W", Color::White) (" ", Color::None); - + cell_ = type_ > color_; row_ = (cell_ % -qi::char_("\n")); diff --git a/util/cell.h b/util/cell.h index ca71559..5e69e3b 100644 --- a/util/cell.h +++ b/util/cell.h @@ -23,7 +23,11 @@ enum class Type : char { SlipperyNorth = 'n', SlipperySouth = 's', SlipperyEast = 'e', - SlipperyWest = 'w' + SlipperyWest = 'w', + SlipperyNorthWest = 'a', + SlipperyNorthEast = 'b', + SlipperySouthWest = 'c', + SlipperySouthEast = 'd' }; enum class Color : char { Red = 'R', @@ -31,6 +35,7 @@ enum class Color : char { Blue = 'B', Purple = 'P', Yellow = 'Y', + White = 'W', //Grey = 'G', None = ' ' };