4_1
This commit is contained in:
parent
4892fb36de
commit
a289c89c8b
37
SelfPropelledArtilleryUnit/Generics/SPAUGenericStorage.java
Normal file
37
SelfPropelledArtilleryUnit/Generics/SPAUGenericStorage.java
Normal file
@ -0,0 +1,37 @@
|
||||
package SelfPropelledArtilleryUnit.Generics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import SelfPropelledArtilleryUnit.DrawningObjects.DrawningSPAU;
|
||||
import SelfPropelledArtilleryUnit.MovementStrategy.DrawningObjectSPAU;
|
||||
|
||||
public class SPAUGenericStorage {
|
||||
private final Map<String, SPAUGenericCollection<DrawningSPAU, DrawningObjectSPAU>> SPAUStorages;
|
||||
private final int pictureWidth;
|
||||
private final int pictureHeight;
|
||||
|
||||
public SPAUGenericStorage(int pictureWidth, int pictureHeight) {
|
||||
this.SPAUStorages = new HashMap<>();
|
||||
this.pictureWidth = pictureWidth;
|
||||
this.pictureHeight = pictureHeight;
|
||||
}
|
||||
|
||||
public List<String> getKeys() {
|
||||
return new ArrayList<>(SPAUStorages.keySet());
|
||||
}
|
||||
|
||||
public void addSet(String name) {
|
||||
SPAUStorages.put(name, new SPAUGenericCollection<>(pictureWidth, pictureHeight));
|
||||
}
|
||||
|
||||
public void delSet(String name) {
|
||||
SPAUStorages.remove(name);
|
||||
}
|
||||
|
||||
public SPAUGenericCollection<DrawningSPAU, DrawningObjectSPAU> get(String ind) {
|
||||
return SPAUStorages.get(ind);
|
||||
}
|
||||
}
|
@ -5,7 +5,6 @@ public class SelfPropelledArtilleryUnit {
|
||||
public static void main(String[] args) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
FormSPAUCollection form = new FormSPAUCollection();
|
||||
FormHard formHard = new FormHard();
|
||||
form.setSize(900, 500);
|
||||
form.setVisible(true);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user