continuity/Server/DB/Documents/Character.cs

48 lines
1.4 KiB
C#
Raw Normal View History

2023-11-21 20:37:50 +00:00
// Copyright (c) 2023 Timothy Schenk. Subject to 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-22 09:16:16 +00:00
using JetBrains.Annotations;
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
2023-10-12 07:15:34 +00:00
namespace Server.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)]
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)]
2023-11-22 09:16:16 +00:00
[CanBeNull]
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; }
[DeleteBehavior(DeleteBehavior.Restrict)]
2023-11-22 09:16:16 +00:00
[CanBeNull]
public virtual Guild Guild { get; set; }
2023-08-14 20:30:35 +00:00
}