23.03 магия
This commit is contained in:
parent
00df3818cf
commit
8790849a68
@ -77,7 +77,7 @@ public abstract class AbstractCompany
|
||||
public DrawningWarmlyShip? GetRandomObject()
|
||||
{
|
||||
Random rnd = new();
|
||||
return _collection.Get(rnd.Next(GetMaxCount));
|
||||
return _collection?.Get(rnd.Next(GetMaxCount));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -57,7 +57,7 @@ public class MassiveGenericObjects<T> : ICollectionGenericObjects<T>
|
||||
public bool Insert(T obj, int position)
|
||||
{
|
||||
// TODO проверка позиции
|
||||
if(position != null ||position < 0|| position > _collection.Length)
|
||||
if(position < 0|| position > _collection.Length)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ public class WarmlyShip2SharingService : AbstractCompany
|
||||
{
|
||||
public WarmlyShip2SharingService(int picWidth, int picHeight, ICollectionGenericObjects<DrawningWarmlyShip> collection) : base(picWidth, picHeight, collection)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void DrawBackgound(Graphics g)
|
||||
|
Loading…
Reference in New Issue
Block a user