mirror of
https://github.com/MikuLeaks/MikuSB.git
synced 2026-06-04 10:03:57 +00:00
Add character & inventory manager
This commit is contained in:
50
Common/Database/Character/CharacterData.cs
Normal file
50
Common/Database/Character/CharacterData.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using MikuSB.Proto;
|
||||
using SqlSugar;
|
||||
|
||||
namespace MikuSB.Database.Character;
|
||||
|
||||
[SugarTable("character_data")]
|
||||
public class CharacterData : BaseDatabaseDataHelper
|
||||
{
|
||||
[SugarColumn(IsJson = true)] public List<CharacterInfo> Characters { get; set; } = [];
|
||||
public uint NextCharacterGuid { get; set; } = 0;
|
||||
}
|
||||
|
||||
public class CharacterInfo
|
||||
{
|
||||
public uint Guid { get; set; }
|
||||
public ulong TemplateId { get; set; }
|
||||
public uint Level { get; set; }
|
||||
public int Exp { get; set; }
|
||||
public uint Break { get; set; }
|
||||
public int Evolue { get; set; }
|
||||
public int Trust { get; set; }
|
||||
public uint WeaponUniqueId { get; set; }
|
||||
public uint SkinId { 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> Affixs { get; set; } = [];
|
||||
public long Timestamp { get; set; }
|
||||
public uint Count { get; set; } = 1;
|
||||
|
||||
public Item ToProto()
|
||||
{
|
||||
var proto = new Item
|
||||
{
|
||||
Id = Guid,
|
||||
Template = TemplateId,
|
||||
Count = Count,
|
||||
Enhance = new Enhance
|
||||
{
|
||||
Level = Level,
|
||||
Break = Break
|
||||
}
|
||||
};
|
||||
|
||||
proto.Slots[4] = WeaponUniqueId;
|
||||
proto.Slots[5] = SkinId;
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user