private void OnDestroyCall(int ship_id) { DestroyEventArgs args = new DestroyEventArgs(); args.ship_id = ship_id; OnDestroy(args); }
protected virtual void OnDestroy(DestroyEventArgs e) { EventHandler <DestroyEventArgs> handler = ShipDestroyed; Console.WriteLine("handler null? {0}", handler == null);// handler?.Invoke(this, e); }
private void OnDestroyCall(int ship_id) { DestroyEventArgs args = new DestroyEventArgs(); Console.WriteLine("Ship destroyed, id: {0}", ship_id); args.ship_id = ship_id; OnDestroy(args); }
protected virtual void OnDestroy(DestroyEventArgs e) { EventHandler <DestroyEventArgs> handler = ShipDestroyed; handler?.Invoke(this, e); }