mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-06 16:16:44 +08:00
fix(game): 清理路由与 UI 交互配置的 analyzer warning
- 修复 RouterBase 中路由键比较的 MA0006,显式使用 Ordinal 字符串比较 - 修复 UiInteractionProfiles 中位掩码判定的 MA0099,改为与显式枚举值比较
This commit is contained in:
parent
c106e53a74
commit
9deafac234
@ -218,7 +218,7 @@ public abstract class RouterBase<TRoute, TContext> : AbstractSystem
|
||||
/// <returns>如果栈中包含指定路由返回 true,否则返回 false</returns>
|
||||
public bool Contains(string routeKey)
|
||||
{
|
||||
return Stack.Any(r => r.Key == routeKey);
|
||||
return Stack.Any(r => string.Equals(r.Key, routeKey, StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -237,7 +237,7 @@ public abstract class RouterBase<TRoute, TContext> : AbstractSystem
|
||||
/// <returns>如果栈顶是指定路由返回 true,否则返回 false</returns>
|
||||
public bool IsTop(string routeKey)
|
||||
{
|
||||
return Stack.Count != 0 && Stack.Peek().Key.Equals(routeKey);
|
||||
return Stack.Count != 0 && string.Equals(Stack.Peek().Key, routeKey, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -51,8 +51,8 @@ public static class UiInteractionProfiles
|
||||
{
|
||||
return action switch
|
||||
{
|
||||
UiInputAction.Cancel => (profile.CapturedActions & UiInputActionMask.Cancel) != 0,
|
||||
UiInputAction.Confirm => (profile.CapturedActions & UiInputActionMask.Confirm) != 0,
|
||||
UiInputAction.Cancel => (profile.CapturedActions & UiInputActionMask.Cancel) != UiInputActionMask.None,
|
||||
UiInputAction.Confirm => (profile.CapturedActions & UiInputActionMask.Confirm) != UiInputActionMask.None,
|
||||
_ => false
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user