38 lines
1.0 KiB
C#
38 lines
1.0 KiB
C#
using LiteDB;
|
|
using System.Numerics;
|
|
using DeluxeBackend.Models;
|
|
using static DeluxeBackend.Enums;
|
|
|
|
namespace DeluxeBackend.Models
|
|
{
|
|
public class Relationship
|
|
{
|
|
[BsonId]
|
|
public long Id { get; set; }
|
|
|
|
[BsonRef("accounts")]
|
|
public required Account Player { get; set; }
|
|
|
|
[BsonRef("accounts")]
|
|
public required Account TargetPlayer { get; set; }
|
|
|
|
public RelationshipType RelationshipType { get; set; } = RelationshipType.None;
|
|
public MuteState Muted { get; set; } = MuteState.None;
|
|
public IgnoreState Ignored { get; set; } = IgnoreState.None;
|
|
public int Favorited { get; set; } = 0;
|
|
|
|
public Dictionary<string, object> ToDictionary()
|
|
{
|
|
return new Dictionary<string, object>
|
|
{
|
|
["PlayerID"] = TargetPlayer.Id,
|
|
["RelationshipType"] = (int)RelationshipType,
|
|
["Muted"] = (int)Muted,
|
|
["Ignored"] = (int)Ignored,
|
|
["Favorited"] = Favorited
|
|
};
|
|
}
|
|
|
|
}
|
|
}
|