public Clouds() { this.coverage = CloudsCoverage.Clear; this.kind = CloudsKind.None; this.height = 0; this.accuracy = CloudsAccuracy.Exactly; }
public Clouds (string coverage, string height, string kind) { switch (coverage) { case "VV": this.coverage = CloudsCoverage.Vertical; break; case "FEW": this.coverage = CloudsCoverage.Few; break; case "SKC": case "CLR": this.coverage = CloudsCoverage.Clear; break; case "SCT": this.coverage = CloudsCoverage.Scatterred; break; case "BKN": this.coverage = CloudsCoverage.Broken; break; case "OVC": this.coverage = CloudsCoverage.Overcast; break; default: this.coverage = CloudsCoverage.Invalid; break; } if (height == "000") { this.height = 100.0; accuracy = CloudsAccuracy.LessThan; } else if (height == "///") { this.height = -1.0; accuracy = CloudsAccuracy.Nil; } else { try { this.height = Convert.ToDouble (height) * 100.0; accuracy = CloudsAccuracy.Exactly; } catch { this.height = -1; accuracy = CloudsAccuracy.Invalid; } } Console.WriteLine ("kind == {0}", kind); if (!String.IsNullOrEmpty (kind)) { switch (kind) { case "CB": this.kind = CloudsKind.Cumulonimbus; break; case "CU": this.kind = CloudsKind.Cumulus; break; case "TCU": this.kind = CloudsKind.Cumulus; break; case "CI": this.kind = CloudsKind.Cirrus; break; default: this.kind = CloudsKind.Invalid; break; } } }
public Clouds () { this.coverage = CloudsCoverage.Clear; this.kind = CloudsKind.None; this.height = 0; this.accuracy = CloudsAccuracy.Exactly; }
public Clouds(string coverage, string height, string kind) { switch (coverage) { case "VV": this.coverage = CloudsCoverage.Vertical; break; case "FEW": this.coverage = CloudsCoverage.Few; break; case "SKC": case "CLR": this.coverage = CloudsCoverage.Clear; break; case "SCT": this.coverage = CloudsCoverage.Scatterred; break; case "BKN": this.coverage = CloudsCoverage.Broken; break; case "OVC": this.coverage = CloudsCoverage.Overcast; break; default: this.coverage = CloudsCoverage.Invalid; break; } if (height == "000") { this.height = 100.0; accuracy = CloudsAccuracy.LessThan; } else if (height == "///") { this.height = -1.0; accuracy = CloudsAccuracy.Nil; } else { try { this.height = Convert.ToDouble(height) * 100.0; accuracy = CloudsAccuracy.Exactly; } catch { this.height = -1; accuracy = CloudsAccuracy.Invalid; } } Console.WriteLine("kind == {0}", kind); if (!String.IsNullOrEmpty(kind)) { switch (kind) { case "CB": this.kind = CloudsKind.Cumulonimbus; break; case "CU": this.kind = CloudsKind.Cumulus; break; case "TCU": this.kind = CloudsKind.Cumulus; break; case "CI": this.kind = CloudsKind.Cirrus; break; default: this.kind = CloudsKind.Invalid; break; } } }