Using interface
Monkey Forums/Monkey Programming/Using interface
| ||
hi all I have interface and some classes which implements interface. Can i use interface as param type at method? For example: Method Clone:Type( factory:Interface = Null ) For now the error is: : Type 'Interface' not found Thanks. |
| ||
One more thing, i'm using reflection. Maybe here is the problem? |
| ||
You should be able to - what's the name of the interface? If you had and 'Interface Bleh' the param would be 'factory:Bleh' Cheers, Dmitriy |
| ||
Yes i'm using like this: Method Clone:Particle( factory:ParticleFactory = Null ) Local p:Particle If( factory ) Then p = factory.CreateParticle() Else p = new Particle() Endif return CloneInto( p ) End Method Where ParticleFactory is interface. But if I import reflection, then became error. |