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

Function getObjectBrush

source/game/StarTilesetDatabase.cpp:72–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 }
71
72 BrushConstPtr getObjectBrush(String const& objectName, Tiled::Properties& properties) {
73 Star::Direction direction = Star::Direction::Right;
74 Json parameters;
75
76 if (properties.contains("tilesetDirection"))
77 direction = DirectionNames.getLeft(properties.get<String>("tilesetDirection"));
78 if (properties.contains("flipX"))
79 direction = -direction;
80
81 if (properties.contains("parameters")) {
82 parameters = properties.get<Json>("parameters");
83 }
84
85 parameters = parameters.opt().value(JsonObject{});
86
87 return make_shared<const ObjectBrush>(objectName, direction, parameters);
88 }
89
90 BrushConstPtr getVehicleBrush(String const& vehicleName, Tiled::Properties& properties) {
91 Json parameters = JsonObject{};

Callers

nothing calls this directly

Calls 3

containsMethod · 0.45
valueMethod · 0.45
optMethod · 0.45

Tested by

no test coverage detected