use enum for item slots

This commit is contained in:
Naruse
2026-04-29 09:46:21 +08:00
parent e32319aa50
commit 1969c1ec89
4 changed files with 58 additions and 20 deletions

View File

@@ -29,8 +29,7 @@ public class CharacterInfo
[SugarColumn(IsJson = true)] public List<uint> UnlockedSkin { get; set; } = []; [SugarColumn(IsJson = true)] public List<uint> UnlockedSkin { get; set; } = [];
[SugarColumn(IsJson = true)] public List<uint> Spines { get; set; } = []; [SugarColumn(IsJson = true)] public List<uint> Spines { get; set; } = [];
[SugarColumn(IsJson = true)] public List<uint> Affixs { get; set; } = []; [SugarColumn(IsJson = true)] public List<uint> Affixs { get; set; } = [];
// Key = EqSlot (= support card Detail), Value = support card UniqueId [SugarColumn(IsJson = true)] public Dictionary<uint, uint> SupportSlots { get; set; } = []; // Key = EqSlot (= support card Detail), Value = support card UniqueId
[SugarColumn(IsJson = true)] public Dictionary<uint, uint> SupportSlots { get; set; } = [];
public long Timestamp { get; set; } public long Timestamp { get; set; }
public uint Count { get; set; } = 1; public uint Count { get; set; } = 1;
@@ -56,9 +55,9 @@ public class CharacterInfo
proto.Enhance.Spines.AddRange(Spines.Select(x => (ulong)x)); proto.Enhance.Spines.AddRange(Spines.Select(x => (ulong)x));
proto.Enhance.Affixs.AddRange(Affixs); proto.Enhance.Affixs.AddRange(Affixs);
proto.Slots[4] = WeaponUniqueId; proto.Slots[(uint)ItemCardSlotTypeEnum.SLOT_WEAPON] = WeaponUniqueId;
proto.Slots[5] = SkinId; proto.Slots[(uint)ItemCardSlotTypeEnum.SLOT_SKIN] = SkinId;
proto.Slots[6] = WeaponSkinId; proto.Slots[(uint)ItemCardSlotTypeEnum.SLOT_WEAPON_SKIN] = WeaponSkinId;
foreach (var (slot, uid) in SupportSlots) foreach (var (slot, uid) in SupportSlots)
proto.Slots[slot] = uid; proto.Slots[slot] = uid;

View File

@@ -93,7 +93,7 @@ public class GameSkinInfo : BaseGameItemInfo
Count = ItemCount, Count = ItemCount,
Flag = (uint)Flag, Flag = (uint)Flag,
}; };
proto.Slots[11] = Math.Min(SkinType, 1); proto.Slots[(uint)ItemSkinSlotTypeEnum.SLOT_CARD_SKIL_TYPE] = Math.Min(SkinType, 1);
return proto; return proto;
} }
} }
@@ -116,7 +116,7 @@ public class GameSupportCardInfo : BaseGameItemInfo
Exp = Exp Exp = Exp
} }
}; };
proto.Slots[1] = AffixId; proto.Slots[(uint)ItemSupportCardSlotTypeEnum.SLOT_AFFIXINDEX] = AffixId;
return proto; return proto;
} }
} }

View File

@@ -1,13 +0,0 @@
namespace MikuSB.Enums.Item;
public enum ItemFlagEnum
{
FLAG_USE = 1,// 使用中
FLAG_LOCK = 2,// 锁定中
FLAG_READED = 4,// 道具已查看
FLAG_LEAVE = 8,// 角色大招后离场
FLAG_WEAPON_DEFAULT = 16,// 武器显示原始样式
FLAG_WEAPON_AUDIO = 32,// 武器消音器音效
FLAG_ROLE_LIKE = 64,// 心选角色
}

View File

@@ -25,4 +25,56 @@ public enum ItemTypeEnum
TYPE_MAIN_SCENE = 21, //主界面场景道具 TYPE_MAIN_SCENE = 21, //主界面场景道具
TYPE_AR = 24, //AR道具 TYPE_AR = 24, //AR道具
TYPE_CALL = 25, //电话陪伴道具 TYPE_CALL = 25, //电话陪伴道具
}
public enum ItemCardSlotTypeEnum
{
SLOT_SUPPORTERCARD1 = 1, // 后勤卡
SLOT_SUPPORTERCARD2 = 2, // 后勤卡
SLOT_SUPPORTERCARD3 = 3, // 后勤卡
SLOT_WEAPON = 4, // 武器
SLOT_SKIN = 5, // 时装
SLOT_WEAPON_SKIN = 6, // 武器时装
SLOT_SUPPORTERINDEX = 7, // 当前使用的后勤组
SLOT_SUPPORTERCARD4 = 8, // 后勤卡
SLOT_SUPPORTERCARD5 = 9, // 后勤卡
SLOT_SUPPORTERCARD6 = 10, // 后勤卡
SLOT_SUPPORTERCARD7 = 11, // 后勤卡
SLOT_SUPPORTERCARD8 = 12, // 后勤卡
SLOT_SUPPORTERCARD9 = 13, // 后勤卡
}
public enum ItemSkinPartSlotTypeEnum
{
SLOT_SkinPartSlot1 = 1,
SLOT_SkinPartSlot2 = 2,
SLOT_SkinPartSlot3 = 3,
SLOT_SkinPartSlot4 = 4,
SLOT_SkinPartSlot5 = 5,
SLOT_SkinPartSlot6 = 6,
SLOT_SkinPartSlot7 = 7,
SLOT_SkinPartSlot8 = 8,
SLOT_SkinPartSlot9 = 9,
SLOT_SkinPartSlot10 = 10,
}
public enum ItemSkinSlotTypeEnum
{
SLOT_CARD_SKIL_TYPE = 11
}
public enum ItemSupportCardSlotTypeEnum
{
SLOT_AFFIXINDEX = 1 // 可洗练的初始词缀索引
}
public enum ItemFlagEnum
{
FLAG_USE = 1, // 使用中
FLAG_LOCK = 2, // 锁定中
FLAG_READED = 4, // 道具已查看
FLAG_LEAVE = 8, // 角色大招后离场
FLAG_WEAPON_DEFAULT = 16, // 武器显示原始样式
FLAG_WEAPON_AUDIO = 32, // 武器消音器音效
FLAG_ROLE_LIKE = 64, // 心选角色
} }