I am currently working on a shooter, and want to have a common projectile class, and then have each weapon have its own effect. so each WeaponClass that derives from WeaponBase (abstract base class) will override a delegate implementation.
then the Projectile will have an instance of that delegate that will be handed to the receiver, to actually apply the effect.
if ObjectA holds a reference to a delegate defined in a class on ObjectB. what happens when ObjectB is destroyed (released for garbage collection), and in addition what happens if ObjectA handed that same delegate reference to an ObjectC (to run the delegate over a series of loops)
for the final paragraph it can be assumed that ObjectA will also be destroyed as well after the delegate reference is passed.
– gardian06I don't really get it, what you show is not a delegate but an abstract method, still you talk about it like a delegate.
– fafasethe abstract method matches the signature of a delegate defined externally which is completely legal.
– gardian06@gardian06: Hmm, why have you included a line that isn't actually related to the problem, but the actual delegate is not there.
– Bunny83edited to clear up confusion.
– gardian06