Fix SetArtilleriesGeneric

This commit is contained in:
Сергей Полевой 2022-10-24 22:22:51 +04:00
parent 675c220c79
commit b481b124a8

View File

@ -9,11 +9,11 @@ public class SetArtilleriesGeneric<T> {
_places = new Object[count]; _places = new Object[count];
} }
public int Insert(T artillery) { public int insert(T artillery) {
return Insert(artillery, 0); return insert(artillery, 0);
} }
public int Insert(T artillery, int position) { public int insert(T artillery, int position) {
if (position < 0 || position >= getCount()) { if (position < 0 || position >= getCount()) {
return -1; return -1;
} }
@ -46,7 +46,7 @@ public class SetArtilleriesGeneric<T> {
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public T Remove(int position) { public T remove(int position) {
if (position < 0 || position >= getCount()) if (position < 0 || position >= getCount())
{ {
return null; return null;
@ -60,7 +60,7 @@ public class SetArtilleriesGeneric<T> {
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public T Get(int position) { public T get(int position) {
if (position < 0 || position >= getCount()) { if (position < 0 || position >= getCount()) {
return null; return null;
} }