Создание класса TractorGenericStorage
This commit is contained in:
parent
e173941bbc
commit
a92d29b242
46
ProjectBulldozer/Generics/TractorGenericStorage.cs
Normal file
46
ProjectBulldozer/Generics/TractorGenericStorage.cs
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
using ProjectBulldozer.Drawning;
|
||||||
|
namespace ProjectBulldozer.Generics
|
||||||
|
{
|
||||||
|
internal class TractorGenericStorage
|
||||||
|
{
|
||||||
|
readonly Dictionary<string, TractorGenericCollection<DrawingTractor, DrawingObjectTractor>> _TractorsStorage;
|
||||||
|
public List<string> Keys => _TractorsStorage.Keys.ToList();
|
||||||
|
private readonly int _pictureWidth;
|
||||||
|
private readonly int _pictureHeight;
|
||||||
|
/// <param name="pictureWidth"></param>
|
||||||
|
/// <param name="pictureHeight"></param>
|
||||||
|
public TractorGenericStorage(int pictureWidth, int pictureHeight)
|
||||||
|
{
|
||||||
|
_TractorsStorage = new Dictionary<string, TractorGenericCollection<DrawingTractor, DrawingObjectTractor>>();
|
||||||
|
_pictureWidth = pictureWidth;
|
||||||
|
_pictureHeight = pictureHeight;
|
||||||
|
}
|
||||||
|
public void AddSet(string name)
|
||||||
|
{
|
||||||
|
if (!_TractorsStorage.ContainsKey(name))
|
||||||
|
{
|
||||||
|
_TractorsStorage.Add(name, new TractorGenericCollection<DrawingTractor, DrawingObjectTractor>(_pictureWidth, _pictureHeight));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void DelSet(string name)
|
||||||
|
{
|
||||||
|
if (_TractorsStorage.ContainsKey(name))
|
||||||
|
{
|
||||||
|
_TractorsStorage.Remove(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Доступ к набору
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ind"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public TractorGenericCollection<DrawingTractor, DrawingObjectTractor>?
|
||||||
|
this[string ind]
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user