45 lines
1.5 KiB
C#
45 lines
1.5 KiB
C#
using Hydroplane.DrawningObjects;
|
|
using Hydroplane.MovementStrategy;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Hydroplane.Generics
|
|
{
|
|
internal class PlanesGenericStorage
|
|
{
|
|
readonly Dictionary<string, PlanesGenericCollection<DrawningPlane, DrawningObjectPlane>> _planeStorages;
|
|
public List<string> Keys => _planeStorages.Keys.ToList();
|
|
private readonly int _pictureWidth;
|
|
private readonly int _pictureHeight;
|
|
public PlanesGenericStorage(int pictureWidth, int pictureHeight)
|
|
{
|
|
_planeStorages = new Dictionary<string, PlanesGenericCollection<DrawningPlane, DrawningObjectPlane>>();
|
|
_pictureWidth = pictureWidth;
|
|
_pictureHeight = pictureHeight;
|
|
}
|
|
public void AddSet(string name)
|
|
{
|
|
if (_planeStorages.ContainsKey(name)) return;
|
|
_planeStorages[name] = new PlanesGenericCollection<DrawningPlane, DrawningObjectPlane>(_pictureWidth, _pictureHeight);
|
|
}
|
|
|
|
public void DelSet(string name)
|
|
{
|
|
if (!_planeStorages.ContainsKey(name)) return;
|
|
_planeStorages.Remove(name);
|
|
}
|
|
|
|
public PlanesGenericCollection<DrawningPlane, DrawningObjectPlane>?
|
|
this[string ind]
|
|
{
|
|
get
|
|
{
|
|
if (_planeStorages.ContainsKey(ind)) return _planeStorages[ind];
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
} |