修改为luban

This commit is contained in:
Bob.Song
2026-03-05 15:03:45 +08:00
parent 13e4315a70
commit 36067705f2
122 changed files with 10497 additions and 2216 deletions

View File

@@ -12,7 +12,7 @@ public static class ItemFactory
/// <param name="configId"></param>
/// <param name="count"></param>
/// <returns></returns>
public static Item Create(Scene scene, uint configId, int count = 1)
public static Item Create(Scene scene, int configId, int count = 1)
{
var item = Entity.Create<Item>(scene, true, true);
item.ConfigId = configId;

View File

@@ -2,7 +2,7 @@ namespace NB.Game;
public static class ItemHelper
{
public static ItemBasicType GetType(uint id)
public static ItemBasicType GetType(int id)
{
return (ItemBasicType)(id / 10000);
}

View File

@@ -95,7 +95,7 @@ public static class PlayerItemContainerComponentSystem
#region Add
public static async FTask Add(this PlayerItemContainerComponent self, Dictionary<uint, int> items)
public static async FTask Add(this PlayerItemContainerComponent self, Dictionary<int, int> items)
{
foreach (var (configId, count) in items)
{
@@ -105,7 +105,7 @@ public static class PlayerItemContainerComponentSystem
await self.Save();
}
public static async FTask Add(this PlayerItemContainerComponent self, uint configId, int count,
public static async FTask Add(this PlayerItemContainerComponent self, int configId, int count,
bool needSave = true)
{
var item = ItemFactory.Create(self.Scene, configId, count);

View File

@@ -158,27 +158,28 @@ public static class PlayerManageComponentSystem
player.Exp = 999;
player.Head = "xxx.png";
var list = InitConfig.GetList();
// var list = InitConfig.GetList();
var list = Configs.Tables.TbInitItemConfig.DataList;
Dictionary<ItemBasicType, Dictionary<uint, int>>
addDic = new Dictionary<ItemBasicType, Dictionary<uint, int>>();
Dictionary<ItemBasicType, Dictionary<int, int>>
addDic = new Dictionary<ItemBasicType, Dictionary<int, int>>();
foreach (var initConfig in list)
{
var itemType = ItemHelper.GetType(initConfig.Id);
if (!addDic.TryGetValue(itemType, out var dic))
{
dic = new Dictionary<uint, int>();
dic = new Dictionary<int, int>();
addDic.Add(itemType, dic);
}
if (!dic.ContainsKey(initConfig.Id))
{
dic.Add(initConfig.Id, initConfig.Amount);
dic.Add(initConfig.Id, initConfig.Count);
}
else
{
dic[initConfig.Id] += initConfig.Amount;
dic[initConfig.Id] += initConfig.Count;
}
}

View File

@@ -45,7 +45,7 @@ public static class PlayerSystem
/// <param name="self"></param>
/// <param name="id"></param>
/// <param name="items"></param>
public static async FTask AddItems(this Player self, Dictionary<uint, int> items)
public static async FTask AddItems(this Player self, Dictionary<int, int> items)
{
var itemContainer = self.GetComponent<PlayerItemContainerComponent>();

View File

@@ -25,7 +25,7 @@ public static class PlayerWalletComponentSystem
/// <param name="configId"></param>
/// <param name="count"></param>
/// <returns></returns>
public static bool Have(this PlayerWalletComponent self, uint configId, int count)
public static bool Have(this PlayerWalletComponent self, int configId, int count)
{
if (self.Currency.TryGetValue(configId, out var value))
{
@@ -38,7 +38,7 @@ public static class PlayerWalletComponentSystem
return false;
}
public static async FTask Add(this PlayerWalletComponent self, uint configId, int count)
public static async FTask Add(this PlayerWalletComponent self, int configId, int count)
{
if (count < 1)
{
@@ -54,7 +54,7 @@ public static class PlayerWalletComponentSystem
await self.Save();
}
public static async FTask Sub(this PlayerWalletComponent self, uint configId, int count)
public static async FTask Sub(this PlayerWalletComponent self, int configId, int count)
{
if (count > 0)
{