var Unit = { Millimeters: 0, Centimeters: 1, Meters: 2, Kilometers: 3, Inches: 4, Feet: 5, Yards: 6, Miles: 7, Points: 8, USSurveyFeet: 9 }; function toMeter(unit, value) { switch(unit) { case Unit.Millimeters: return value * 0.001000; case Unit.Centimeters: return value * 0.010000; case Unit.Kilometers: return value * 1000.000000; case Unit.Inches: return value * 0.025400; case Unit.Feet: return value * 0.304800; case Unit.Yards: return value * 0.914400; case Unit.Miles: return value * 1609.344000; case Unit.Points: return value * 0.000353; case Unit.USSurveyFeet: return value * 0.304801; } } function Process(SOURCE, BUILDINGS) { BUILDINGS.EXTERNAL_ID = SOURCE["FeatId"]; BUILDINGS.ROOF_HEIGHT = toMeter(5,(Math.random() * 50) + 10); if(BUILDINGS.ROOF_HEIGHT >= toMeter(5,40)){ BUILDINGS.ROOF_SLOPE = 0; switch (Math.floor(Math.random() * 3)) { case 0: BUILDINGS.ROOF_MATERIAL = "Material/Roadway/Suface Dark Grey Asphalt 2.048w 2.048h"; break; case 1: BUILDINGS.ROOF_MATERIAL = "Material/Roadway/Parking Lane Mosaic Cobblestones 0.384w 0.512h"; break; default: BUILDINGS.ROOF_MATERIAL = "Material/Roadway/Surface Dark Grey Asphalt 1w 1h"; } switch (Math.floor(Math.random() * 7)) { case 0: BUILDINGS.RULE_STYLE = "Facade/Brick/Barracuda"; break; case 1: BUILDINGS.RULE_STYLE = "Facade/Brick/Bandit"; break; case 2: BUILDINGS.RULE_STYLE = "Facade/Brick/Paulus"; break; case 3: BUILDINGS.RULE_STYLE = "Facade/Metal & Glass/Lear"; break; case 4: BUILDINGS.RULE_STYLE = "Facade/Marble & Stone/Abigail"; break; case 5: BUILDINGS.RULE_STYLE = "Facade/Concrete & Glass/Esmeralda"; break; default: BUILDINGS.RULE_STYLE = "Facade/Marble & Stone/Butts"; } } else{ BUILDINGS.ROOF_SLOPE = (Math.random() * 25); switch (Math.floor(Math.random() * 3)) { case 0: BUILDINGS.ROOF_MATERIAL = "Material/Roadway/Parking Lane Diamond Tile w_ Center Pattern 1.024w 1.024h"; break; case 1: BUILDINGS.ROOF_MATERIAL = "Material/Roofing/Shingles Composite Grey"; break; default: BUILDINGS.ROOF_MATERIAL = "Material/Roofing/Wood Tile"; } switch (Math.floor(Math.random() * 5)) { case 0: BUILDINGS.RULE_STYLE = "Facade/Brick/Biron"; break; case 1: BUILDINGS.RULE_STYLE = "Facade/Marble & Stone/Antenor"; break; case 2: BUILDINGS.RULE_STYLE = "Facade/Brick/Paulus"; break; case 3: BUILDINGS.RULE_STYLE = "Facade/Marble & Stone/Abigail"; break; default: BUILDINGS.RULE_STYLE = "Facade/Brick/Servilius"; } } return true; }
© Copyright 2025 Paperzz