Open deltanedas opened 5 months ago
@ElectroJr you made it i think
smugleaf you dork.
:trollface: @DrSmugleaf
Entity should automatically convert to Entity<B?> adding .Owner is silly
One downside is that it might make it easier for people to make some mistakes. E.g., currently this would fail, which IMO is a good thing
public void Foo(Entity<CompA> entA, Entity<CompB> entB)
{
// Accidentally swap entA & entB
Bar(entB, entA)
}
public void Bar(Entity<CompA?> entA, Entity<CompB?> entB) { }
I think keeping the "component type checking" for arguments is probably worth having to use .Owner
Entity<A, B> should automatically convert to Entity<B?> with non-null Comp
I think this is easy enough to add, though I don't think we would want to extend this to anything with more than 2 generic arguments, because the possible permutations just start ballooning.
yeah it would still be great for usability with just A, B which is fairly common
Entity<A>
should automatically convert toEntity<B?>
adding.Owner
is sillyEntity<A, B>
should automatically convert toEntity<B?>
with non-null Comp