From 759ea2222d5f56524fddf2609cc99bff571e9b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Rativel?= Date: Tue, 8 Jun 2021 20:11:13 +0200 Subject: [PATCH] Added getter and Setter for frame's attributes --- src/gameplay/frames/Frame.java | 98 ++++++++++++++++++++++++++-------- 1 file changed, 77 insertions(+), 21 deletions(-) diff --git a/src/gameplay/frames/Frame.java b/src/gameplay/frames/Frame.java index e5026eb..1c35642 100644 --- a/src/gameplay/frames/Frame.java +++ b/src/gameplay/frames/Frame.java @@ -25,13 +25,13 @@ public class Frame { private boolean isDashCancellable; public Frame() { - this.move_y = 0.0; - this.move_x = 0.0; - this.passHitBox = new ArrayList(); - this.actHitBox = new ArrayList(); - this.passThrowHitBox = new ArrayList(); - this.actThrowHitBox = new ArrayList(); - this.pushHitBox = new Push_HitBox(); + this.setMove_y(0.0); + this.setMove_x(0.0); + this.setPassHitBox(new ArrayList()); + this.setActHitBox(new ArrayList()); + this.setPassThrowHitBox(new ArrayList()); + this.setActThrowHitBox(new ArrayList()); + this.setPushHitBox(new Push_HitBox()); this.normalCancellable = true; this.specialCancellable = true; this.jumpCancellable = true; @@ -43,13 +43,13 @@ public class Frame { ArrayList passThrowHitBox, ArrayList actThrowHitBox, Push_HitBox pushHitBox, boolean normalCancellable, boolean specialCancellable, boolean jumpCancellable, boolean moveCancellable, boolean isDashCancellable) { - this.move_y = move_y; - this.move_x = move_x; - this.passHitBox = passHitBox; - this.actHitBox = actHitBox; - this.passThrowHitBox = passThrowHitBox; - this.actThrowHitBox = actThrowHitBox; - this.pushHitBox = pushHitBox; + this.setMove_y(move_y); + this.setMove_x(move_x); + this.setPassHitBox(passHitBox); + this.setActHitBox(actHitBox); + this.setPassThrowHitBox(passThrowHitBox); + this.setActThrowHitBox(actThrowHitBox); + this.setPushHitBox(pushHitBox); this.normalCancellable = normalCancellable; this.specialCancellable = specialCancellable; this.jumpCancellable = jumpCancellable; @@ -61,13 +61,13 @@ public class Frame { * Mainly use for projectiles */ public Frame(Double move_y, Double move_x, ArrayList passHitBox, ArrayList actHitBox) { - this.move_y = move_y; - this.move_x = move_x; - this.passHitBox = passHitBox; - this.actHitBox = actHitBox; - this.passThrowHitBox = new ArrayList(); - this.actThrowHitBox = new ArrayList(); - this.pushHitBox = new Push_HitBox(); + this.setMove_y(move_y); + this.setMove_x(move_x); + this.setPassHitBox(passHitBox); + this.setActHitBox(actHitBox); + this.setPassThrowHitBox(new ArrayList()); + this.setActThrowHitBox(new ArrayList()); + this.setPushHitBox(new Push_HitBox()); } public boolean isNormalCancellable() { @@ -89,4 +89,60 @@ public class Frame { public boolean isDashCancellable() { return isDashCancellable; } + + public Double getMove_y() { + return move_y; + } + + public void setMove_y(Double move_y) { + this.move_y = move_y; + } + + public Double getMove_x() { + return move_x; + } + + public void setMove_x(Double move_x) { + this.move_x = move_x; + } + + public ArrayList getPassHitBox() { + return passHitBox; + } + + public void setPassHitBox(ArrayList passHitBox) { + this.passHitBox = passHitBox; + } + + public ArrayList getActHitBox() { + return actHitBox; + } + + public void setActHitBox(ArrayList actHitBox) { + this.actHitBox = actHitBox; + } + + public ArrayList getPassThrowHitBox() { + return passThrowHitBox; + } + + public void setPassThrowHitBox(ArrayList passThrowHitBox) { + this.passThrowHitBox = passThrowHitBox; + } + + public ArrayList getActThrowHitBox() { + return actThrowHitBox; + } + + public void setActThrowHitBox(ArrayList actThrowHitBox) { + this.actThrowHitBox = actThrowHitBox; + } + + public Push_HitBox getPushHitBox() { + return pushHitBox; + } + + public void setPushHitBox(Push_HitBox pushHitBox) { + this.pushHitBox = pushHitBox; + } }