continuity/Server/DB/Documents/Character.cs
Timothy Schenk 3efe3a5aac
All checks were successful
Build, Package and Push Images / preprocess (push) Successful in 2s
Build, Package and Push Images / build (push) Successful in 27s
Build, Package and Push Images / sbom-scan (push) Successful in 38s
Build, Package and Push Images / container-build (push) Successful in 1m20s
Build, Package and Push Images / sonarqube (push) Successful in 1m27s
Build, Package and Push Images / container-sbom-scan (push) Successful in 34s
fix: relationships bit messy
2023-11-25 12:24:42 +01:00

45 lines
1.3 KiB
C#

// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License.
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Wonderking.Game.Data.Character;
using Wonderking.Packets.Outgoing.Data;
namespace Server.DB.Documents;
[Index(nameof(Name), IsUnique = true)]
[Index(nameof(Id), IsUnique = true)]
public class Character
{
[DeleteBehavior(DeleteBehavior.Cascade)]
[Required]
public virtual Account Account { get; set; }
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; set; }
public ushort MapId { get; set; }
[MaxLength(20)] public string Name { get; set; }
public short LastXCoordinate { get; set; }
public short LastYCoordinate { get; set; }
public PvPLevel PvPLevel { get; set; }
public Gender Gender { get; set; }
public long Experience { get; set; }
public byte Level { get; set; }
[DeleteBehavior(DeleteBehavior.Cascade)]
public virtual ICollection<InventoryItem> InventoryItems { get; set; }
public BaseStats BaseStats { get; set; }
public JobData JobData { get; set; }
public int Health { get; set; }
public int Mana { get; set; }
[DeleteBehavior(DeleteBehavior.Cascade)]
public virtual GuildMember GuildMember { get; set; }
}