From 8b2b9e2882ddd2d358415c80f2cee6dbc32b34ed Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 3 Dec 2021 11:54:12 +0100 Subject: [PATCH] rename variables in SiedlerBoard --- src/ch/zhaw/catan/SiedlerBoard.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ch/zhaw/catan/SiedlerBoard.java b/src/ch/zhaw/catan/SiedlerBoard.java index 64a2646..d560b7a 100644 --- a/src/ch/zhaw/catan/SiedlerBoard.java +++ b/src/ch/zhaw/catan/SiedlerBoard.java @@ -10,7 +10,7 @@ import java.util.*; public class SiedlerBoard extends HexBoard { - Map lowerFieldLabel = new HashMap<>(); + Map fields = new HashMap<>(); public void createFixGamefield(){ Map resourcePlacement = Config.getStandardLandPlacement(); @@ -21,10 +21,10 @@ public class SiedlerBoard extends HexBoard { String numberAsString = dicePlacement.get(resourceField.getKey()).toString(); char[] numbersInChar = numberAsString.toCharArray(); if (numberAsString.length() < 2) { - lowerFieldLabel.put(resourceField.getKey(), new Field(resourceField.getValue(), new Label('0', numbersInChar[0]))); + fields.put(resourceField.getKey(), new Field(resourceField.getValue(), new Label('0', numbersInChar[0]))); } else { - lowerFieldLabel.put(resourceField.getKey(), new Field(resourceField.getValue(), new Label(numbersInChar[0],numbersInChar[1]))); + fields.put(resourceField.getKey(), new Field(resourceField.getValue(), new Label(numbersInChar[0],numbersInChar[1]))); } } } @@ -32,15 +32,15 @@ public class SiedlerBoard extends HexBoard { private int getDiceNumber(Point field) { - Label label = lowerFieldLabel.get(field).getLabel(); + Label label = fields.get(field).getLabel(); return Integer.parseInt(label.toString()); } public String getTextView () { SiedlerBoardTextView view = new SiedlerBoardTextView(this); - for (Map.Entry e : lowerFieldLabel.entrySet()) { - view.setLowerFieldLabel(e.getKey(), e.getValue().getLabel()); + for (Map.Entry field : fields.entrySet()) { + view.setLowerFieldLabel(field.getKey(), field.getValue().getLabel()); } return view.toString(); } @@ -58,7 +58,7 @@ public class SiedlerBoard extends HexBoard { */ public List getFieldsForDiceValue(int dice) { ArrayList fields = new ArrayList<>(); - for(Point field : lowerFieldLabel.keySet()){ + for(Point field : this.fields.keySet()){ if(getDiceNumber(field) == dice){ fields.add(field); }