Closed Maximusya closed 10 years ago
Oh, that "are you serious" thing IComponent
Ok, I think it's time to ditch IComponent<T>
interface.
To make the test pass - i.e. add derived component as a base component, you should change public void TestDerivedComponents()
:
entity.AddComponent(derived);
to this
entity.AddComponent(derived as TestBaseComponent);
See? C# power! Clear intentions, intuitive - not some hidden hack.
Add this to the pull request. So i can merge all at once Em 12/12/2013 12:06, "Maximusya" notifications@github.com escreveu:
Ok, I think it's time to ditch IComponent
interface. To make the test pass - i.e. add derived component as a base component, you should change public void TestDerivedComponents(): entity.AddComponent(derived);
to this
entity.AddComponent(derived as TestBaseComponent);
See? C# power! Clear intentions, intuitive - not some hidden hack.
— Reply to this email directly or view it on GitHubhttps://github.com/thelinuxlich/artemis_CSharp/pull/54#issuecomment-30424220 .
It looks like it was automatically added to the initial pull request - when I commited latest changes to the branch
Fixed: All the
AddComponent<T>(IComponent component)
method chain was dead code by default:entity.AddComponent(new MyComponent());
always chose non-genericEntity.AddComponent(IComponent component)