A library for parsing Tiled maps.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

no need to be so verbose and redundant

+13 -13
+13 -13
src/object.zig
··· 148 148 y: ?f32 = null, 149 149 150 150 pub fn applyTemplate(self: *JsonObject, template: JsonObject) void { 151 - if (self.ellipse == null) self.ellipse = if (template.ellipse) |ellipse| ellipse else null; 152 - if (self.id == null) self.id = if (template.id) |id| id else null; 153 - if (self.gid == null) self.gid = if (template.gid) |gid| gid else null; 154 - if (self.height == null) self.height = if (template.height) |height| height else null; 155 - if (self.opacity == null) self.opacity = if (template.opacity) |opacity| opacity else null; 156 - if (self.point == null) self.point = if (template.point) |point| point else null; 157 - if (self.polygon == null) self.polygon = if (template.polygon) |polygon| polygon else null; 158 - if (self.polyline == null) self.polyline = if (template.polyline) |polyline| polyline else null; 159 - if (self.rotation == null) self.rotation = if (template.rotation) |rotation| rotation else null; 160 - if (self.text == null) self.text = if (template.text) |text| text else null; 161 - if (self.type == null) self.type = if (template.type) |t| t else null; 162 - if (self.visible == null) self.visible = if (template.visible) |visible| visible else null; 163 - if (self.width == null) self.width = if (template.width) |width| width else null; 151 + self.ellipse = self.ellipse orelse template.ellipse; 152 + self.id = self.id orelse template.id; 153 + self.gid = self.gid orelse template.gid; 154 + self.height = self.height orelse template.height; 155 + self.opacity = self.opacity orelse template.opacity; 156 + self.point = self.point orelse template.point; 157 + self.polygon = self.polygon orelse template.polygon; 158 + self.polyline = self.polyline orelse template.polyline; 159 + self.rotation = self.rotation orelse template.rotation; 160 + self.text = self.text orelse template.text; 161 + self.type = self.type orelse template.type; 162 + self.visible = self.visible orelse template.visible; 163 + self.width = self.width orelse template.width; 164 164 } 165 165 }; 166 166 };