diff --git a/ProjectContainerShip/ProjectContainerShip/CollectionGenericObjects/MassiveGenericObjects.cs b/ProjectContainerShip/ProjectContainerShip/CollectionGenericObjects/MassiveGenericObjects.cs index 13f4640..01743cf 100644 --- a/ProjectContainerShip/ProjectContainerShip/CollectionGenericObjects/MassiveGenericObjects.cs +++ b/ProjectContainerShip/ProjectContainerShip/CollectionGenericObjects/MassiveGenericObjects.cs @@ -50,21 +50,21 @@ public class MassiveGenericObjects : ICollectionGenericObjects return null; } - public bool Insert(T obj) + public int Insert(T obj) { return Insert(obj, 0); } - public bool Insert(T obj, int position) + public int Insert(T obj, int position) { if (position < 0 || position >= Count) { - return false; + return -1; } if (_collection[position] == null) { _collection[position] = obj; - return true; + return position; } for (int i = position + 1; i < Count; i++) @@ -72,7 +72,7 @@ public class MassiveGenericObjects : ICollectionGenericObjects if (_collection[i] == null) { _collection[i] = obj; - return true; + return i; } } for (int i = position - 1; i >= 0; i--) @@ -80,21 +80,21 @@ public class MassiveGenericObjects : ICollectionGenericObjects if (_collection[i] == null) { _collection[i] = obj; - return true; + return i; } } - return false; + return -1; } - public bool Remove(int position) + public T Remove(int position) { if (position < 0 || position >= Count) { - return false; + return null; } T obj = _collection[position]; _collection[position] = null; - return true; + return obj; } } \ No newline at end of file