From d16a35a31c249099f6eff580a287d30ce1aaf1eb Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Wed, 16 Nov 2022 10:40:17 +0400 Subject: [PATCH 1/4] =?UTF-8?q?=D0=9A=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CreaterGeneric.java | 4 ++-- src/FormCreater.java | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/CreaterGeneric.java b/src/CreaterGeneric.java index 692c0c7..988034c 100644 --- a/src/CreaterGeneric.java +++ b/src/CreaterGeneric.java @@ -10,7 +10,7 @@ public class CreaterGeneric(warshipsCount); Blocks=new ArrayList<>(blocksCount); } - public int AddWarship(T warship){ + public int Add(T warship){ if(WarshipsCount<=Warships.size()){ Warships.add(warship); WarshipsCount++; @@ -18,7 +18,7 @@ public class CreaterGeneric { @@ -80,7 +80,7 @@ public class FormCreater extends JDialog{ if(fblock==null) return; fblock.SetBlockCount(block.GetBlockCount()); - createrGeneric.AddBlock(fblock); + createrGeneric.Add(fblock); }); TriangleFormRadioButton.addActionListener(e -> { @@ -91,7 +91,7 @@ public class FormCreater extends JDialog{ if(fblock==null) return; fblock.SetBlockCount(block.GetBlockCount()); - createrGeneric.AddBlock(fblock); + createrGeneric.Add(fblock); }); BasicRadioButton.addActionListener(e -> { @@ -99,7 +99,7 @@ public class FormCreater extends JDialog{ if(Integer.parseInt(SpeedTextField.getText())==0 || Integer.parseInt(WeightTextField.getText())==0 || color==null){ return; } - createrGeneric.AddWarship(new EntityWarship(Integer.parseInt(SpeedTextField.getText()),Integer.parseInt(WeightTextField.getText()),color)); + createrGeneric.Add(new EntityWarship(Integer.parseInt(SpeedTextField.getText()),Integer.parseInt(WeightTextField.getText()),color)); }); AdvancedRadioButton.addActionListener(e -> { @@ -111,7 +111,7 @@ public class FormCreater extends JDialog{ if(color2==null){ return; } - createrGeneric.AddWarship(new EntityAdvancedWarship(Integer.parseInt(SpeedTextField.getText()),Integer.parseInt(WeightTextField.getText()), + createrGeneric.Add(new EntityAdvancedWarship(Integer.parseInt(SpeedTextField.getText()),Integer.parseInt(WeightTextField.getText()), color1,color2,HelipadCheckBox.isSelected(),AntennaCheckBox.isSelected(),MissileCheckBox.isSelected())); }); From 21c99afc20d82ea3fa1897641d016b5059d78d95 Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Fri, 18 Nov 2022 10:35:08 +0400 Subject: [PATCH 2/4] =?UTF-8?q?=D0=9A=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CreaterGeneric.java | 4 ++-- src/FormCreater.java | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/CreaterGeneric.java b/src/CreaterGeneric.java index 692c0c7..988034c 100644 --- a/src/CreaterGeneric.java +++ b/src/CreaterGeneric.java @@ -10,7 +10,7 @@ public class CreaterGeneric(warshipsCount); Blocks=new ArrayList<>(blocksCount); } - public int AddWarship(T warship){ + public int Add(T warship){ if(WarshipsCount<=Warships.size()){ Warships.add(warship); WarshipsCount++; @@ -18,7 +18,7 @@ public class CreaterGeneric { @@ -80,7 +80,7 @@ public class FormCreater extends JDialog{ if(fblock==null) return; fblock.SetBlockCount(block.GetBlockCount()); - createrGeneric.AddBlock(fblock); + createrGeneric.Add(fblock); }); TriangleFormRadioButton.addActionListener(e -> { @@ -91,7 +91,7 @@ public class FormCreater extends JDialog{ if(fblock==null) return; fblock.SetBlockCount(block.GetBlockCount()); - createrGeneric.AddBlock(fblock); + createrGeneric.Add(fblock); }); BasicRadioButton.addActionListener(e -> { @@ -99,7 +99,7 @@ public class FormCreater extends JDialog{ if(Integer.parseInt(SpeedTextField.getText())==0 || Integer.parseInt(WeightTextField.getText())==0 || color==null){ return; } - createrGeneric.AddWarship(new EntityWarship(Integer.parseInt(SpeedTextField.getText()),Integer.parseInt(WeightTextField.getText()),color)); + createrGeneric.Add(new EntityWarship(Integer.parseInt(SpeedTextField.getText()),Integer.parseInt(WeightTextField.getText()),color)); }); AdvancedRadioButton.addActionListener(e -> { @@ -111,7 +111,7 @@ public class FormCreater extends JDialog{ if(color2==null){ return; } - createrGeneric.AddWarship(new EntityAdvancedWarship(Integer.parseInt(SpeedTextField.getText()),Integer.parseInt(WeightTextField.getText()), + createrGeneric.Add(new EntityAdvancedWarship(Integer.parseInt(SpeedTextField.getText()),Integer.parseInt(WeightTextField.getText()), color1,color2,HelipadCheckBox.isSelected(),AntennaCheckBox.isSelected(),MissileCheckBox.isSelected())); }); From 52ec14ad060bbba9d6d89672829eff068a80ee41 Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Fri, 18 Nov 2022 12:20:25 +0400 Subject: [PATCH 3/4] =?UTF-8?q?=D0=9A=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CreaterGeneric.java | 4 ++-- src/FormCreater.java | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/CreaterGeneric.java b/src/CreaterGeneric.java index 692c0c7..988034c 100644 --- a/src/CreaterGeneric.java +++ b/src/CreaterGeneric.java @@ -10,7 +10,7 @@ public class CreaterGeneric(warshipsCount); Blocks=new ArrayList<>(blocksCount); } - public int AddWarship(T warship){ + public int Add(T warship){ if(WarshipsCount<=Warships.size()){ Warships.add(warship); WarshipsCount++; @@ -18,7 +18,7 @@ public class CreaterGeneric { @@ -80,7 +80,7 @@ public class FormCreater extends JDialog{ if(fblock==null) return; fblock.SetBlockCount(block.GetBlockCount()); - createrGeneric.AddBlock(fblock); + createrGeneric.Add(fblock); }); TriangleFormRadioButton.addActionListener(e -> { @@ -91,7 +91,7 @@ public class FormCreater extends JDialog{ if(fblock==null) return; fblock.SetBlockCount(block.GetBlockCount()); - createrGeneric.AddBlock(fblock); + createrGeneric.Add(fblock); }); BasicRadioButton.addActionListener(e -> { @@ -99,7 +99,7 @@ public class FormCreater extends JDialog{ if(Integer.parseInt(SpeedTextField.getText())==0 || Integer.parseInt(WeightTextField.getText())==0 || color==null){ return; } - createrGeneric.AddWarship(new EntityWarship(Integer.parseInt(SpeedTextField.getText()),Integer.parseInt(WeightTextField.getText()),color)); + createrGeneric.Add(new EntityWarship(Integer.parseInt(SpeedTextField.getText()),Integer.parseInt(WeightTextField.getText()),color)); }); AdvancedRadioButton.addActionListener(e -> { @@ -111,7 +111,7 @@ public class FormCreater extends JDialog{ if(color2==null){ return; } - createrGeneric.AddWarship(new EntityAdvancedWarship(Integer.parseInt(SpeedTextField.getText()),Integer.parseInt(WeightTextField.getText()), + createrGeneric.Add(new EntityAdvancedWarship(Integer.parseInt(SpeedTextField.getText()),Integer.parseInt(WeightTextField.getText()), color1,color2,HelipadCheckBox.isSelected(),AntennaCheckBox.isSelected(),MissileCheckBox.isSelected())); }); From f997a031fb94b4e3c3b8f3f2eb2417deba505971 Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Fri, 18 Nov 2022 12:27:45 +0400 Subject: [PATCH 4/4] =?UTF-8?q?=D0=9A=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MapsCollection.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/MapsCollection.java b/src/MapsCollection.java index e234adb..f0d6a89 100644 --- a/src/MapsCollection.java +++ b/src/MapsCollection.java @@ -37,4 +37,12 @@ public class MapsCollection { } return null; } + + public DrawingObjectWarship get(String name,int i) { + if (_mapStorages.containsKey(name)) + { + return _mapStorages.get(name).GetWarshipInList(i); + } + return null; + } }