code clean
This commit is contained in:
parent
b3da6936da
commit
8cf13efae3
@ -39,36 +39,36 @@ public class Tag
|
|||||||
case "highway":
|
case "highway":
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return new Tag(Tag.TagType.highway, (Tag.WayType)Enum.Parse(typeof(Tag.WayType), value, true));
|
return new Tag(TagType.highway, (WayType)Enum.Parse(typeof(WayType), value, true));
|
||||||
}
|
}
|
||||||
catch (ArgumentException)
|
catch (ArgumentException)
|
||||||
{
|
{
|
||||||
return new Tag(Tag.TagType.highway, Tag.WayType.unclassified);
|
return new Tag(TagType.highway, WayType.unclassified);
|
||||||
}
|
}
|
||||||
case "maxspeed":
|
case "maxspeed":
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
byte speed = Convert.ToByte(value);
|
byte speed = Convert.ToByte(value);
|
||||||
if (speed == 255)
|
if (speed == 255)
|
||||||
return new Tag(Tag.TagType.highway, false);
|
return new Tag(TagType.highway, false);
|
||||||
else
|
else
|
||||||
return new Tag(Tag.TagType.maxspeed, speed);
|
return new Tag(TagType.maxspeed, speed);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
//Console.WriteLine(e);
|
//Console.WriteLine(e);
|
||||||
//Console.WriteLine("Continuing...");
|
//Console.WriteLine("Continuing...");
|
||||||
return new Tag(Tag.TagType.maxspeed, byte.MaxValue);
|
return new Tag(TagType.maxspeed, byte.MaxValue);
|
||||||
}
|
}
|
||||||
case "oneway":
|
case "oneway":
|
||||||
switch (value)
|
switch (value)
|
||||||
{
|
{
|
||||||
case "yes":
|
case "yes":
|
||||||
return new Tag(Tag.TagType.oneway, true);
|
return new Tag(TagType.oneway, true);
|
||||||
case "-1":
|
case "-1":
|
||||||
return new Tag(Tag.TagType.forward, false);
|
return new Tag(TagType.forward, false);
|
||||||
case "no":
|
case "no":
|
||||||
return new Tag(Tag.TagType.oneway, false);
|
return new Tag(TagType.oneway, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user