This commit is contained in:
Putoo
2026-05-27 18:26:50 +08:00
parent 36a7575990
commit 0d5443ef36
28 changed files with 1043 additions and 25 deletions

View File

@@ -1,5 +1,4 @@
namespace Application.Domain;
namespace Application.Domain;
public class GameTool
{
@@ -21,6 +20,7 @@ public class GameTool
data.levUpdate = TimeExtend.GetTimeStampSeconds;
return data;
}
/// <summary>
/// 获取等级升级经验
/// </summary>
@@ -32,10 +32,59 @@ public class GameTool
return result;
}
public static bool AreaVerify( int area,string areas)
public static bool AreaVerify(int area, string areas)
{
List<string> onArea = new List<string>() {"0",area.ToString() };
List<string> onArea = new List<string>() { "0", area.ToString() };
return onArea.Any(it => areas.Contains(it));
}
public static string GetCurrencyName(string payCode)
{
string result = "";
switch (payCode)
{
case "gold":
result = "金元";
break;
case "cowry":
result = "金贝";
break;
case "copper":
result = "铜贝";
break;
case "teach":
result = "师德";
break;
case "renown":
result = "声望";
break;
}
return result;
}
public static async Task<int> GetPropWeight(string goodsType, string parameter)
{
int weight = 0;
if (goodsType.Equals(nameof(GameEnum.PropCode.Goods)))
{
var goodsService = App.GetService<IGameGoodsService>();
var info = await goodsService.GetGoodsInfo(Convert.ToInt32(parameter));
if (info != null)
{
weight = (int)info.weight;
}
}
else if (goodsType.Equals(nameof(GameEnum.PropCode.Equ)))
{
var equService = App.GetService<IGameEquService>();
var info = await equService.GetEquInfo(Convert.ToInt32(parameter));
if (info != null)
{
weight = (int)info.weight;
}
}
return weight;
}
}