From b09f774d422263ce15b97d6d0804beddf856176d Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sun, 27 Feb 2022 11:53:57 -0500 Subject: feat: improve formating :) --- .../notenoughupdates/mbgui/MBGuiGroup.java | 104 ++++++++++----------- 1 file changed, 52 insertions(+), 52 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java index 3582a549..4540b146 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java @@ -8,56 +8,56 @@ import java.util.HashMap; import java.util.Map; public abstract class MBGuiGroup extends MBGuiElement { - public int width; - public int height; - protected HashMap childrenPosition = new HashMap<>(); - - public MBGuiGroup() {} - - public abstract Collection getChildren(); - - public Map getChildrenPosition() { - return Collections.unmodifiableMap(childrenPosition); - } - - @Override - public int getWidth() { - return width; - } - - @Override - public int getHeight() { - return height; - } - - @Override - public void mouseClick(float x, float y, int mouseX, int mouseY) { - Map childrenPos = getChildrenPosition(); - - for (MBGuiElement child : getChildren()) { - Vector2f childPos = childrenPos.get(child); - if (mouseX > x + childPos.x && mouseX < x + childPos.x + child.getWidth()) { - if (mouseY > y + childPos.y && mouseY < y + childPos.y + child.getHeight()) { - child.mouseClick(x + childPos.x, y + childPos.y, mouseX, mouseY); - } - } - } - } - - @Override - public void mouseClickOutside() { - for (MBGuiElement child : getChildren()) { - child.mouseClickOutside(); - } - } - - @Override - public void render(float x, float y) { - Map childrenPos = getChildrenPosition(); - - for (MBGuiElement child : getChildren()) { - Vector2f childPos = childrenPos.get(child); - child.render(x + childPos.x, y + childPos.y); - } - } + public int width; + public int height; + protected HashMap childrenPosition = new HashMap<>(); + + public MBGuiGroup() {} + + public abstract Collection getChildren(); + + public Map getChildrenPosition() { + return Collections.unmodifiableMap(childrenPosition); + } + + @Override + public int getWidth() { + return width; + } + + @Override + public int getHeight() { + return height; + } + + @Override + public void mouseClick(float x, float y, int mouseX, int mouseY) { + Map childrenPos = getChildrenPosition(); + + for (MBGuiElement child : getChildren()) { + Vector2f childPos = childrenPos.get(child); + if (mouseX > x + childPos.x && mouseX < x + childPos.x + child.getWidth()) { + if (mouseY > y + childPos.y && mouseY < y + childPos.y + child.getHeight()) { + child.mouseClick(x + childPos.x, y + childPos.y, mouseX, mouseY); + } + } + } + } + + @Override + public void mouseClickOutside() { + for (MBGuiElement child : getChildren()) { + child.mouseClickOutside(); + } + } + + @Override + public void render(float x, float y) { + Map childrenPos = getChildrenPosition(); + + for (MBGuiElement child : getChildren()) { + Vector2f childPos = childrenPos.get(child); + child.render(x + childPos.x, y + childPos.y); + } + } } -- cgit