Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Sep 16, 2024
1 parent 6a0364b commit 1e695ef
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 49 deletions.
49 changes: 0 additions & 49 deletions src/Starward.Core/EnumExtension.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Starward.Core.Launcher;
using Starward.Core.SelfQuery;
using System.ComponentModel;
using System.Reflection;

Expand Down Expand Up @@ -36,52 +35,4 @@ public static string ToLocalization(this PostType postType)
};
}



public static string ToLocalization(this GenshinQueryType genshinQueryType)
{
return genshinQueryType switch
{
GenshinQueryType.Crystal => CoreLang.GenshinQueryType_GenesisCrystal,
GenshinQueryType.Primogem => CoreLang.GenshinQueryType_Primogem,
GenshinQueryType.Resin => CoreLang.GenshinQueryType_OriginalResin,
GenshinQueryType.Artifact => CoreLang.GenshinQueryType_Artifact,
GenshinQueryType.Weapon => CoreLang.GenshinQueryType_Weapon,
_ => "",
};
}



public static string ToLocalization(this StarRailQueryType starRailQueryType)
{
return starRailQueryType switch
{
StarRailQueryType.Stellar => CoreLang.StarRailQueryType_StellarJade,
StarRailQueryType.Dreams => CoreLang.StarRailQueryType_OneiricShared,
StarRailQueryType.Relic => CoreLang.StarRailQueryType_Relic,
StarRailQueryType.Cone => CoreLang.StarRailQueryType_LightCone,
StarRailQueryType.Power => CoreLang.StarRailQueryType_TrailblazePower,
_ => "",
};
}



public static string ToLocalization(this ZZZQueryType zZZQueryType)
{
return zZZQueryType switch
{
ZZZQueryType.Monochrome => CoreLang.ZZZQueryType_Monochrome,
ZZZQueryType.Ploychrome => CoreLang.ZZZQueryType_Ploychrome,
ZZZQueryType.PurchaseGift => CoreLang.ZZZQueryType_Bundle,
ZZZQueryType.Battery => CoreLang.ZZZQueryType_BatteryCharge,
ZZZQueryType.Engine => CoreLang.ZZZQueryType_WEngine,
ZZZQueryType.Disk => CoreLang.ZZZQueryType_DriveDisc,
_ => "",
};
}



}
50 changes: 50 additions & 0 deletions src/Starward.Core/SelfQuery/SelfQueryTpyeEnumExtension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
namespace Starward.Core.SelfQuery;

public static class SelfQueryTpyeEnumExtension
{

public static string ToLocalization(this GenshinQueryType genshinQueryType)
{
return genshinQueryType switch
{
GenshinQueryType.Crystal => CoreLang.GenshinQueryType_GenesisCrystal,
GenshinQueryType.Primogem => CoreLang.GenshinQueryType_Primogem,
GenshinQueryType.Resin => CoreLang.GenshinQueryType_OriginalResin,
GenshinQueryType.Artifact => CoreLang.GenshinQueryType_Artifact,
GenshinQueryType.Weapon => CoreLang.GenshinQueryType_Weapon,
_ => "",
};
}



public static string ToLocalization(this StarRailQueryType starRailQueryType)
{
return starRailQueryType switch
{
StarRailQueryType.Stellar => CoreLang.StarRailQueryType_StellarJade,
StarRailQueryType.Dreams => CoreLang.StarRailQueryType_OneiricShared,
StarRailQueryType.Relic => CoreLang.StarRailQueryType_Relic,
StarRailQueryType.Cone => CoreLang.StarRailQueryType_LightCone,
StarRailQueryType.Power => CoreLang.StarRailQueryType_TrailblazePower,
_ => "",
};
}



public static string ToLocalization(this ZZZQueryType zZZQueryType)
{
return zZZQueryType switch
{
ZZZQueryType.Monochrome => CoreLang.ZZZQueryType_Monochrome,
ZZZQueryType.Ploychrome => CoreLang.ZZZQueryType_Ploychrome,
ZZZQueryType.PurchaseGift => CoreLang.ZZZQueryType_Bundle,
ZZZQueryType.Battery => CoreLang.ZZZQueryType_BatteryCharge,
ZZZQueryType.Engine => CoreLang.ZZZQueryType_WEngine,
ZZZQueryType.Disk => CoreLang.ZZZQueryType_DriveDisc,
_ => "",
};
}

}
File renamed without changes.
File renamed without changes.

0 comments on commit 1e695ef

Please sign in to comment.