32 lines
960 B
C#
32 lines
960 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Server.Data.Enums;
|
|
|
|
namespace Server.Data.Entities;
|
|
/// <summary>
|
|
/// Actual item instance owned by a character (inventory or equipped)
|
|
/// </summary>
|
|
[Table("dungeon_character_items")]
|
|
public class DungeonCharacterItem
|
|
{
|
|
[Key]
|
|
public ulong Id { get; set; }
|
|
|
|
public ulong CharacterId { get; set; }
|
|
public int ItemDefinitionId { get; set; }
|
|
|
|
public int Quantity { get; set; } = 1;
|
|
public int SlotIndex { get; set; } // Inventory position (0-29), or -1 if equipped
|
|
|
|
public bool IsEquipped { get; set; } = false;
|
|
public DungeonEquipmentSlot? EquipSlot { get; set; }
|
|
|
|
public DateTime AcquiredAt { get; set; } = DateTime.UtcNow;
|
|
|
|
// Navigation
|
|
public virtual DungeonCharacter? Character { get; set; }
|
|
|
|
[ForeignKey(nameof(ItemDefinitionId))]
|
|
public virtual DungeonItemDefinition? ItemDefinition { get; set; }
|
|
}
|