code clean

This commit is contained in:
glax 2023-04-01 14:21:58 +02:00
parent b3da6936da
commit 8cf13efae3

View File

@ -39,36 +39,36 @@ public class Tag
case "highway":
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)
{
return new Tag(Tag.TagType.highway, Tag.WayType.unclassified);
return new Tag(TagType.highway, WayType.unclassified);
}
case "maxspeed":
try
{
byte speed = Convert.ToByte(value);
if (speed == 255)
return new Tag(Tag.TagType.highway, false);
return new Tag(TagType.highway, false);
else
return new Tag(Tag.TagType.maxspeed, speed);
return new Tag(TagType.maxspeed, speed);
}
catch (Exception)
{
//Console.WriteLine(e);
//Console.WriteLine("Continuing...");
return new Tag(Tag.TagType.maxspeed, byte.MaxValue);
return new Tag(TagType.maxspeed, byte.MaxValue);
}
case "oneway":
switch (value)
{
case "yes":
return new Tag(Tag.TagType.oneway, true);
return new Tag(TagType.oneway, true);
case "-1":
return new Tag(Tag.TagType.forward, false);
return new Tag(TagType.forward, false);
case "no":
return new Tag(Tag.TagType.oneway, false);
return new Tag(TagType.oneway, false);
}
break;