MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / parseObjectBrush

Function parseObjectBrush

source/game/StarDungeonGenerator.cpp:197–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers 1

parseMethod · 0.85

Calls 6

getStringMethod · 0.80
sizeMethod · 0.45
getObjectMethod · 0.45
containsMethod · 0.45
toStringMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected