использование встроенного делегата

This commit is contained in:
Inohara 2022-11-12 18:19:53 +04:00
parent 07e42412f4
commit cd006b5914
2 changed files with 3 additions and 11 deletions

View File

@ -19,7 +19,7 @@ namespace AircraftCarrier
/// <summary>
/// Событие
/// </summary>
private event WarshipDelegate EventAddWarshp;
private event Action<DrawingWarship> EventAddWarshp;
/// <summary>
/// Конструктор
/// </summary>
@ -52,11 +52,11 @@ namespace AircraftCarrier
/// Добавление события
/// </summary>
/// <param name="ev"></param>
public void AddEvent(WarshipDelegate ev)
public void AddEvent(Action<DrawingWarship> ev)
{
if (EventAddWarshp == null)
{
EventAddWarshp = new WarshipDelegate(ev);
EventAddWarshp = ev;
}
else
{

View File

@ -1,8 +0,0 @@
namespace AircraftCarrier
{
/// <summary>
/// Делегат для передачи объекта-корабля
/// </summary>
/// <param name="warship"></param>
public delegate void WarshipDelegate(DrawingWarship warship);
}