continuity/Continuity.AuthServer/DB/Documents/Character.cs

46 lines
1.3 KiB
C#
Raw Normal View History

2024-02-07 15:40:36 +00:00
// Licensed to Timothy Schenk under the GNU AGPL Version 3 License.
2023-11-20 18:58:30 +00:00
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
2023-11-16 11:06:36 +00:00
using Microsoft.EntityFrameworkCore;
2023-11-13 20:12:12 +00:00
using Wonderking.Game.Data.Character;
using Wonderking.Packets.Outgoing.Data;
2023-11-13 20:12:12 +00:00
namespace Continuity.AuthServer.DB.Documents;
2023-08-14 20:30:35 +00:00
2023-11-19 16:07:28 +00:00
[Index(nameof(Name), IsUnique = true)]
[Index(nameof(Id), IsUnique = true)]
2023-08-14 20:30:35 +00:00
public class Character
{
2023-11-22 09:16:16 +00:00
[DeleteBehavior(DeleteBehavior.Cascade)]
2023-11-25 11:24:42 +00:00
[Required]
public virtual Account Account { get; set; }
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
2023-08-14 20:30:35 +00:00
public Guid Id { get; set; }
2023-08-14 20:30:35 +00:00
public ushort MapId { get; set; }
2023-11-16 11:06:36 +00:00
2023-11-22 09:16:16 +00:00
[MaxLength(20)] public string Name { get; set; }
2023-11-16 11:06:36 +00:00
2023-08-14 21:05:53 +00:00
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; }
2023-11-22 09:16:16 +00:00
2023-11-21 21:00:55 +00:00
[DeleteBehavior(DeleteBehavior.Cascade)]
public virtual ICollection<InventoryItem> InventoryItems { get; set; }
2023-11-13 20:12:12 +00:00
public BaseStats BaseStats { get; set; }
public JobData JobData { get; set; }
public int Health { get; set; }
public int Mana { get; set; }
2023-11-25 11:24:42 +00:00
[DeleteBehavior(DeleteBehavior.Cascade)]
public virtual GuildMember GuildMember { get; set; }
2023-08-14 20:30:35 +00:00
}