41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
|
namespace ElectricLocomotive;
|
|||
|
|
|||
|
public class LocosGenericStorage
|
|||
|
{
|
|||
|
readonly Dictionary<string, LocosGenericCollection<DrawingLocomotiv, DrawingObjectLocomotiv>> _electricLocoStorages;
|
|||
|
public List<string> Keys => _electricLocoStorages.Keys.ToList();
|
|||
|
|
|||
|
private readonly int _pictureWidth;
|
|||
|
|
|||
|
private readonly int _pictureHeight;
|
|||
|
|
|||
|
public LocosGenericStorage(int pictureWidth, int pictureHeight)
|
|||
|
{
|
|||
|
_electricLocoStorages = new Dictionary<string,
|
|||
|
LocosGenericCollection<DrawingLocomotiv, DrawingObjectLocomotiv>>();
|
|||
|
_pictureWidth = pictureWidth;
|
|||
|
_pictureHeight = pictureHeight;
|
|||
|
}
|
|||
|
|
|||
|
public void AddSet(string name)
|
|||
|
{
|
|||
|
_electricLocoStorages.Add(name, new LocosGenericCollection<DrawingLocomotiv, DrawingObjectLocomotiv> (_pictureWidth, _pictureHeight));
|
|||
|
}
|
|||
|
|
|||
|
public void DelSet(string name)
|
|||
|
{
|
|||
|
if (!_electricLocoStorages.ContainsKey(name))
|
|||
|
return;
|
|||
|
_electricLocoStorages.Remove(name);
|
|||
|
}
|
|||
|
|
|||
|
public LocosGenericCollection<DrawingLocomotiv, DrawingObjectLocomotiv>? this[string ind]
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (_electricLocoStorages.ContainsKey(ind))
|
|||
|
return _electricLocoStorages[ind];
|
|||
|
return null;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|