feat: add inventory/item data
This commit is contained in:
parent
85aaec2371
commit
f6c2f4d2b6
5 changed files with 39 additions and 3 deletions
|
@ -14,4 +14,5 @@ public class Character
|
|||
public Gender Gender { get; set; }
|
||||
public long Experience { get; set; }
|
||||
public byte Level { get; set; }
|
||||
public ICollection<InventoryItem> InventoryItems { get; set; }
|
||||
}
|
||||
|
|
20
Server/DB/Documents/InventoryItem.cs
Normal file
20
Server/DB/Documents/InventoryItem.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
namespace Server.DB.Documents;
|
||||
|
||||
public class InventoryItem
|
||||
{
|
||||
public Guid CharacterId { get; set; }
|
||||
public Character Character { get; set; }
|
||||
public Guid Id { get; set; }
|
||||
public short ItemId { get; set; }
|
||||
public ushort Count { get; set; }
|
||||
public byte Slot { get; set; }
|
||||
public ItemType ItemType { get; set; }
|
||||
public byte Level { get; set; }
|
||||
public byte Rarity { get; set; }
|
||||
public byte AddOption { get; set; }
|
||||
public byte AddOption2 { get; set; }
|
||||
public byte AddOption3 { get; set; }
|
||||
public short Option { get; set; }
|
||||
public short Option2 { get; set; }
|
||||
public short Option3 { get; set; }
|
||||
}
|
12
Server/DB/Documents/ItemType.cs
Normal file
12
Server/DB/Documents/ItemType.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
namespace Server.DB.Documents;
|
||||
|
||||
public enum ItemType : byte
|
||||
{
|
||||
WornEquipment = 0,
|
||||
WornCashEquipment = 1,
|
||||
Equipment = 2,
|
||||
Etc = 3,
|
||||
Cash = 4,
|
||||
Warehouse = 5,
|
||||
GiftBox = 6
|
||||
}
|
|
@ -32,10 +32,13 @@ public class WonderkingContext : DbContext
|
|||
builder.Property(b => b.Password).HasColumnType("bytea");
|
||||
builder.Property(b => b.Salt).HasColumnType("bytea");
|
||||
builder.HasKey(b => b.Id);
|
||||
builder.HasMany(e => e.Characters).WithOne(e => e.Account).HasForeignKey(e => e.AccountId).IsRequired();
|
||||
builder.HasMany(e => e.Characters).WithOne(e => e.Account).HasForeignKey(e => e.AccountId)
|
||||
.IsRequired();
|
||||
}).Entity<Character>(builder =>
|
||||
{
|
||||
builder.HasKey(c => c.Id);
|
||||
builder.Property(c => c.Name).HasColumnType("varchar(20)");
|
||||
});
|
||||
builder.HasMany(e => e.InventoryItems).WithOne(e => e.Character)
|
||||
.HasForeignKey(e => e.CharacterId).IsRequired();
|
||||
}).Entity<InventoryItem>(builder => { builder.HasKey(i => i.Id); });
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="JetBrains.Annotations" Version="2023.2.0" />
|
||||
<PackageReference Include="Meziantou.Analyzer" Version="2.0.104">
|
||||
<PackageReference Include="Meziantou.Analyzer" Version="2.0.105">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
|
Loading…
Reference in a new issue