Skip to content

Commit

Permalink
Add Player leveling, item storage/consumption, stamina (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeFZ authored Jul 28, 2023
1 parent 2c4ecc6 commit 159d534
Show file tree
Hide file tree
Showing 42 changed files with 2,826 additions and 284 deletions.
2 changes: 2 additions & 0 deletions DragaliaAPI.Database/ApiContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,6 @@ but EF Core doesn't like this and the client probably stops you anyway?
public DbSet<DbPlayerEventPassive> PlayerEventPassives { get; set; }

public DbSet<DbQuestClearPartyUnit> QuestClearPartyUnits { get; set; }

public DbSet<DbPlayerUseItem> PlayerUseItems { get; set; }
}
23 changes: 23 additions & 0 deletions DragaliaAPI.Database/Entities/DbPlayerItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using DragaliaAPI.Shared.Definitions.Enums;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;

namespace DragaliaAPI.Database.Entities;

[Index(nameof(DeviceAccountId))]
[PrimaryKey(nameof(DeviceAccountId), nameof(ItemId))]
public class DbPlayerUseItem : IDbHasAccountId
{
/// <inheritdoc />
public virtual DbPlayer? Owner { get; set; }

/// <inheritdoc />
[ForeignKey(nameof(Owner))]
public required string DeviceAccountId { get; set; }

[Column("ItemId")]
public required UseItem ItemId { get; set; }

[Column("Quantity")]
public int Quantity { get; set; }
}
Loading

0 comments on commit 159d534

Please sign in to comment.