PIbd-21 Potapov N.S. LabWork04 Hard #4
36
ProjectStormtrooper/PlanesGenericStorage.java
Normal file
36
ProjectStormtrooper/PlanesGenericStorage.java
Normal file
@ -0,0 +1,36 @@
|
||||
package ProjectStormtrooper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class PlanesGenericStorage {
|
||||
final HashMap<String, PlanesGenericCollection<DrawingPlane, DrawingObjectPlane>> _planeStorages;
|
||||
|
||||
public ArrayList<String> Keys() {
|
||||
return (ArrayList<String>) _planeStorages.keySet().stream().toList();
|
||||
}
|
||||
|
||||
private final int _pictureWidth;
|
||||
private final int _pictureHeight;
|
||||
|
||||
public PlanesGenericStorage(int pictureWidth, int pictureHeight) {
|
||||
_planeStorages = new HashMap<>();
|
||||
_pictureWidth = pictureWidth;
|
||||
_pictureHeight = pictureHeight;
|
||||
}
|
||||
|
||||
public void AddSet(String name) {
|
||||
_planeStorages.put(name, new PlanesGenericCollection<>(_pictureWidth, _pictureHeight));
|
||||
}
|
||||
|
||||
public void DelSet(String name) {
|
||||
_planeStorages.remove(name);
|
||||
}
|
||||
|
||||
public PlanesGenericCollection<DrawingPlane, DrawingObjectPlane> Get(String ind) {
|
||||
if (_planeStorages.containsKey(ind))
|
||||
return _planeStorages.get(ind);
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user