чтобы не ругалось

This commit is contained in:
Evgeny Egov 2024-01-06 19:42:32 +04:00
parent 936eda3a52
commit 3c43df8a45
Failed to extract signature
5 changed files with 52 additions and 4 deletions

View File

@ -48,7 +48,7 @@ public abstract class AbstractCompany
_pictureWidth = picWidth;
_pictureHeight = picHeight;
_collection = collection;
_collection.SetMaxCount = GetMaxCount;
_collection.MaxCount = GetMaxCount;
}
/// <summary>

View File

@ -1,4 +1,5 @@
namespace ProjectSportCar.CollectionGenericObjects;

namespace ProjectSportCar.CollectionGenericObjects;
/// <summary>
/// Параметризованный набор объектов
@ -19,7 +20,20 @@ public class ListGenericObjects<T> : ICollectionGenericObjects<T>
public int Count => _collection.Count;
public int SetMaxCount { set { if (value > 0) { _maxCount = value; } } }
public int MaxCount
{
get => _maxCount;
set
{
if (value > 0)
{
_maxCount = value;
}
}
}
public CollectionType GetCollectionType => throw new NotImplementedException();
/// <summary>
/// Конструктор
@ -56,4 +70,9 @@ public class ListGenericObjects<T> : ICollectionGenericObjects<T>
// TODO удаление объекта из списка
return true;
}
public IEnumerable<T?> GetItems()
{
throw new NotImplementedException();
}
}

View File

@ -84,6 +84,15 @@ public class DrawningCar
EntityCar = new EntityCar(speed, weight, bodyColor);
}
/// <summary>
/// Конструктор
/// </summary>
/// <param name="car">Класс-сущность</param>
public DrawningCar(EntityCar car) : this()
{
// TODO продумать логику
}
/// <summary>
/// Конструктор для наследников
/// </summary>

View File

@ -20,7 +20,16 @@ public class DrawningSportCar : DrawningCar
public DrawningSportCar(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool wing, bool sportLine) : base(110, 60)
{
EntityCar = new EntitySportCar(speed, weight, bodyColor, additionalColor, bodyKit, wing, sportLine);
}
}
/// <summary>
/// Конструктор
/// </summary>
/// <param name="car">Класс-сущность</param>
public DrawningSportCar(EntityCar car) : base(110, 60)
{
// TODO продумать логику
}
public override void DrawTransport(Graphics g)
{

View File

@ -44,4 +44,15 @@ public class EntitySportCar : EntityCar
}
//TODO Прописать метод
/// <summary>
/// Создание объекта из массива строк
/// </summary>
/// <param name="strs"></param>
/// <returns></returns>
public static EntitySportCar? CreateEntitySportCar(string[] strs)
{
// TODO продумать логику
return null;
}
}