From a0ffa4e20518d57f4eae1f007cc2abf8d2783c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9F=D0=BE=D0=BB?= =?UTF-8?q?=D0=B5=D0=B2=D0=BE=D0=B9?= Date: Fri, 30 Sep 2022 16:33:17 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=20SetArtilleriesGeneric?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetArtilleriesGeneric.cs | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 SelfPropelledArtilleryUnit/SetArtilleriesGeneric.cs diff --git a/SelfPropelledArtilleryUnit/SetArtilleriesGeneric.cs b/SelfPropelledArtilleryUnit/SetArtilleriesGeneric.cs new file mode 100644 index 0000000..07163b6 --- /dev/null +++ b/SelfPropelledArtilleryUnit/SetArtilleriesGeneric.cs @@ -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 + 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]; + } + } +}