Добавлен класс SetArtilleriesGeneric
This commit is contained in:
parent
396df2c24c
commit
a0ffa4e205
41
SelfPropelledArtilleryUnit/SetArtilleriesGeneric.cs
Normal file
41
SelfPropelledArtilleryUnit/SetArtilleriesGeneric.cs
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Artilleries
|
||||||
|
{
|
||||||
|
internal class SetArtilleriesGeneric<T>
|
||||||
|
where T : class
|
||||||
|
{
|
||||||
|
private readonly T[] _places;
|
||||||
|
public int Count => _places.Length;
|
||||||
|
|
||||||
|
public SetArtilleriesGeneric(int count)
|
||||||
|
{
|
||||||
|
_places = new T[count];
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Insert(T artillery)
|
||||||
|
{
|
||||||
|
return true; // TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Insert(T artillery, int position)
|
||||||
|
{
|
||||||
|
_places[position] = artillery;
|
||||||
|
return true; // TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Remove(int position)
|
||||||
|
{
|
||||||
|
return true; // TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
public T Get(int position)
|
||||||
|
{
|
||||||
|
return _places[position];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user