| 195 | } |
| 196 | |
| 197 | BrushConstPtr parseObjectBrush(Json const& brush) { |
| 198 | String object; |
| 199 | Star::Direction direction; |
| 200 | Json parameters; |
| 201 | |
| 202 | object = brush.getString(1); |
| 203 | JsonObject settings; |
| 204 | if (brush.size() > 2) |
| 205 | settings = brush.getObject(2); |
| 206 | if (settings.contains("direction")) |
| 207 | direction = DirectionNames.getLeft(settings.get("direction").toString()); |
| 208 | else |
| 209 | direction = Star::Direction::Left; |
| 210 | |
| 211 | if (settings.contains("parameters")) |
| 212 | parameters = settings.get("parameters"); |
| 213 | return make_shared<const ObjectBrush>(object, direction, parameters); |
| 214 | } |
| 215 | |
| 216 | BrushConstPtr parseSurfaceBrush(Json const& brush) { |
| 217 | Json settings = Json::ofType(Json::Type::Object); |