Fix RCS1099

This commit is contained in:
RoosterDragon
2023-03-18 12:51:42 +00:00
committed by Gustas
parent 60e86f563c
commit c63788b686
3 changed files with 10 additions and 7 deletions

View File

@@ -1004,6 +1004,9 @@ dotnet_diagnostic.RCS1084.severity = warning
# Remove empty region.
dotnet_diagnostic.RCS1091.severity = warning
# Default label should be the last label in a switch section.
dotnet_diagnostic.RCS1099.severity = warning
# Unnecessary interpolation.
dotnet_diagnostic.RCS1105.severity = warning

View File

@@ -151,8 +151,8 @@ namespace OpenRA
case TargetType.Terrain:
return HashUsingHashCode(t.CenterPosition);
default:
case TargetType.Invalid:
default:
return 0;
}
}

View File

@@ -120,8 +120,8 @@ namespace OpenRA.Traits
return FrozenActor.IsValid && FrozenActor.Visible && !FrozenActor.Hidden;
case TargetType.Invalid:
return false;
default:
case TargetType.Terrain:
default:
return true;
}
}
@@ -164,8 +164,8 @@ namespace OpenRA.Traits
return FrozenActor.CenterPosition;
case TargetType.Terrain:
return terrainCenterPosition;
default:
case TargetType.Invalid:
default:
throw new InvalidOperationException("Attempting to query the position of an invalid Target");
}
}
@@ -186,8 +186,8 @@ namespace OpenRA.Traits
return FrozenActor.TargetablePositions ?? NoPositions;
case TargetType.Terrain:
return terrainPositions;
default:
case TargetType.Invalid:
default:
return NoPositions;
}
}
@@ -215,8 +215,8 @@ namespace OpenRA.Traits
case TargetType.Terrain:
return terrainCenterPosition.ToString();
default:
case TargetType.Invalid:
default:
return "Invalid";
}
}
@@ -239,8 +239,8 @@ namespace OpenRA.Traits
case TargetType.FrozenActor:
return me.FrozenActor == other.FrozenActor;
default:
case TargetType.Invalid:
default:
return false;
}
}
@@ -270,8 +270,8 @@ namespace OpenRA.Traits
case TargetType.FrozenActor:
return FrozenActor.GetHashCode();
default:
case TargetType.Invalid:
default:
return 0;
}
}