| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using ET;
- namespace GFGGame
- {
- public class NumericUtil
- {
- public static int GetNumericTypeByItemId(int itemId)
- {
- switch (itemId)
- {
- case ConstItemID.EXP:
- return NumericType.Exp;
- case ConstItemID.POWER:
- return NumericType.Power;
- case ConstItemID.DAILY_LIVENESS:
- return NumericType.DailyLiveness;
- case ConstItemID.WEEKLY_LIVENESS:
- return NumericType.WeeklyLiveness;
- }
- return 0;
- }
- //通过数值类型获取道具Id
- public static int GetItemIdByNumericType(int numericType)
- {
- return numericType switch
- {
- NumericType.Exp => ConstItemID.EXP,
- NumericType.Power => ConstItemID.POWER,
- NumericType.DailyLiveness => ConstItemID.DAILY_LIVENESS,
- NumericType.WeeklyLiveness => ConstItemID.WEEKLY_LIVENESS,
- _ => 0
- };
- }
- public static int GetLeagueNumericTypeByItemId(int itemId)
- {
- switch (itemId)
- {
- case ConstItemID.LEAGUE_COIN:
- return LeagueNumericType.LeagueCoin;
- // case ConstItemID.LEAGUE_CONTRIBUTION:
- // return LeagueNumericType.LeagueCoin;
- // case ConstItemID.LEAGUE_CURRENCY:
- // return LeagueNumericType.LeagueCoin;
- }
- return 0;
- }
- }
- }
|