I must be doing something wrong
public interface IActor { //actor stuff } public class BaseShip : IActor { //base ship stuff } public class PlayerShip: BaseShip { //Only the stuff for this particular ship }
Why then doesn’t this work:
IActor player = new PlayerShip();
Or
List<IActor> actors = new List<IActor>(){new PlayerShip()};
I get Cannot convert from [PlayerShip] to [IActor]
note: snipped code for brevity
Update
I accidently defined the interface in two different namespaces. Nothing more to it.
Are you certain this is your structure? I copied and pasted your code and the actions compiled and ran fine for me.
EDIT:
You guys need to step back for a second…interfaces certainly do propogate down the chain of inheritance. You’re telling me that an inherited control doesn’t implement IDisposable?