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:
@@ -38,7 +38,7 @@ public struct PlayCardCommand : ICommand
|
||||
|
||||
// Move from hand to field.
|
||||
world.RemoveComponent<HeldBy>(CardEntity);
|
||||
world.AddComponent(CardEntity, new OnField { Source = CardEntity, Target = fieldOwner });
|
||||
world.AddComponent(CardEntity, new OnField { Target = fieldOwner });
|
||||
world.AddComponent(CardEntity, new Card { Rank = Rank, FaceDown = FaceDown });
|
||||
|
||||
// Resolve on-play effects via registry.
|
||||
|
||||
Reference in New Issue
Block a user