refactor: remove Source property from IRelationship
Remove the redundant `Source` property from `IRelationship` and its implementations. Since the relationship component is inherently stored on the source entity, the `Source` field was unnecessary and required manual synchronization during deserialization. This change simplifies the relationship model, reduces memory usage, and removes the need for reflection-based fixups in the serializer.
This commit is contained in:
@@ -10,6 +10,5 @@ namespace Game.Blackjack;
|
||||
[MessagePackObject]
|
||||
public record struct Holds : IRelationship
|
||||
{
|
||||
[Key(0)] public Entity Source { get; set; }
|
||||
[Key(1)] public Entity Target { get; set; }
|
||||
[Key(0)] public Entity Target { get; set; }
|
||||
}
|
||||
@@ -10,6 +10,5 @@ namespace Game.Blackjack;
|
||||
[MessagePackObject]
|
||||
public record struct InDeck : IRelationship
|
||||
{
|
||||
[Key(0)] public Entity Source { get; set; }
|
||||
[Key(1)] public Entity Target { get; set; }
|
||||
[Key(0)] public Entity Target { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user