| 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{}; |