mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Switch from checking comp.Owner == ent to GetComp(ent) == comp (#5776)
This commit is contained in:
@@ -36,7 +36,7 @@ public sealed partial class EntityManagerCopyTests
|
||||
|
||||
var targetComp = entManager.CopyComponent(original, target, comp);
|
||||
|
||||
Assert.That(targetComp!.Owner == target);
|
||||
Assert.That(entManager.GetComponent<AComponent>(target), Is.EqualTo(targetComp));
|
||||
Assert.That(targetComp.Value, Is.EqualTo(comp.Value));
|
||||
Assert.That(!ReferenceEquals(comp, targetComp));
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public sealed partial class EntityManagerCopyTests
|
||||
|
||||
var targetComp = entManager.CopyComponent(original, target, (IComponent) comp);
|
||||
|
||||
Assert.That(targetComp!.Owner == target);
|
||||
Assert.That(entManager.GetComponent<AComponent>(target), Is.EqualTo(targetComp));
|
||||
Assert.That(((AComponent) targetComp).Value, Is.EqualTo(comp.Value));
|
||||
Assert.That(!ReferenceEquals(comp, targetComp));
|
||||
}
|
||||
@@ -102,10 +102,10 @@ public sealed partial class EntityManagerCopyTests
|
||||
var targetComp = entManager.GetComponent<AComponent>(target);
|
||||
var targetComp2 = entManager.GetComponent<BComponent>(target);
|
||||
|
||||
Assert.That(targetComp!.Owner == target);
|
||||
Assert.That(entManager.GetComponent<AComponent>(target), Is.EqualTo(targetComp));
|
||||
Assert.That(targetComp.Value, Is.EqualTo(comp.Value));
|
||||
|
||||
Assert.That(targetComp2!.Owner == target);
|
||||
Assert.That(entManager.GetComponent<BComponent>(target), Is.EqualTo(targetComp2));
|
||||
Assert.That(targetComp2.Value, Is.EqualTo(comp2.Value));
|
||||
|
||||
Assert.That(!ReferenceEquals(comp, targetComp));
|
||||
@@ -142,16 +142,16 @@ public sealed partial class EntityManagerCopyTests
|
||||
var targetComp = entManager.GetComponent<AComponent>(target);
|
||||
var targetComp2 = entManager.GetComponent<BComponent>(target);
|
||||
|
||||
Assert.That(targetComp!.Owner == target);
|
||||
Assert.That(entManager.GetComponent<AComponent>(target), Is.EqualTo(targetComp));
|
||||
Assert.That(targetComp.Value, Is.EqualTo(comp.Value));
|
||||
|
||||
Assert.That(targetComp2!.Owner == target);
|
||||
Assert.That(entManager.GetComponent<BComponent>(target), Is.EqualTo(targetComp2));
|
||||
Assert.That(targetComp2.Value, Is.EqualTo(comp2.Value));
|
||||
|
||||
Assert.That(!ReferenceEquals(comp, targetComp));
|
||||
Assert.That(!ReferenceEquals(comp2, targetComp2));
|
||||
}
|
||||
|
||||
|
||||
[DataDefinition]
|
||||
private sealed partial class AComponent : Component
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user