From 9a8e13bfb5cd93751248bccecf5a455fdc4420c7 Mon Sep 17 00:00:00 2001 From: Azra Victor Date: Thu, 24 Jun 2021 12:05:22 +0200 Subject: [PATCH] deleted nextFramesBuffer class --- src/gameplay/entities/Character.java | 2 - src/gameplay/entities/Entity.java | 1 - src/gameplay/frames/nextFrameBuffer.java | 118 ----------------------- src/gameplay/match/match.java | 5 - 4 files changed, 126 deletions(-) delete mode 100644 src/gameplay/frames/nextFrameBuffer.java diff --git a/src/gameplay/entities/Character.java b/src/gameplay/entities/Character.java index f6a7e5b..31a3aa1 100644 --- a/src/gameplay/entities/Character.java +++ b/src/gameplay/entities/Character.java @@ -2,8 +2,6 @@ package gameplay.entities; import gameplay.actions.*; import gameplay.frames.Frame; -import gameplay.frames.nextFrameBuffer; -import gameplay.input.InputBuffer; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/gameplay/entities/Entity.java b/src/gameplay/entities/Entity.java index e8260dd..d0020b1 100644 --- a/src/gameplay/entities/Entity.java +++ b/src/gameplay/entities/Entity.java @@ -1,7 +1,6 @@ package gameplay.entities; import gameplay.frames.Frame; -import gameplay.frames.nextFrameBuffer; import java.util.ArrayList; diff --git a/src/gameplay/frames/nextFrameBuffer.java b/src/gameplay/frames/nextFrameBuffer.java deleted file mode 100644 index cd935fe..0000000 --- a/src/gameplay/frames/nextFrameBuffer.java +++ /dev/null @@ -1,118 +0,0 @@ -package gameplay.frames; - -import java.util.ArrayList; - -/** - * This will handle the next frames to be played by each entity. - * @author Victor Azra - */ -public class nextFrameBuffer { - - private Frame current; - private nextFrameBuffer next; - - /** - * creates a new framebuffer, empty for now - */ - public nextFrameBuffer() { - this.current = null; - this.next = null; - } - - public void setCurrentFrame(Frame f) { - this.current = f; - } - - public void clone(nextFrameBuffer f) { - this.current = f.current; - this.next = f.next; - - -// try{ -// Frame cf = new Frame(); -// cf.clone(f.current); -// this.current = cf; } -// catch (NullPointerException n) { -// this.current = null; -// this.next = null; -// } -// nextFrameBuffer nfb = new nextFrameBuffer(); -// try { -// nfb.clone(f.next); -// } catch (NullPointerException n) {} -// this.next = nfb; - - } - - public void setNext(nextFrameBuffer f) { - this.next.clone(f); - } - - public void emptyQueue() { - this.next = null; - } - - public void empty() { - this.current = null; - this.next = null; - } - - public void goToNext() { - //try { - nextFrameBuffer nfb = new nextFrameBuffer(); - nfb.clone(this.next); - this.clone(nfb); - /*} catch (NullPointerException n) { - this.setCurrentFrame(null); - this.setNext(new nextFrameBuffer()); - }*/ - } - - public Frame getCurrentFrame() { - return this.current; - } - - public Frame getNextframe() { - try { - return this.next.current; - } catch(NullPointerException e) {return null;} - } - - /** - * Adds a frame at the end of the buffer - * @param f the frame to add at the end - */ - public void addFrameToQueue(Frame f) { - if(this.current == null) { - this.current = f; - } else if(this.next == null){ - nextFrameBuffer fb = new nextFrameBuffer(); - fb.current = f; - this.next = fb; - } else { - this.next.addFrameToQueue(f); - } - } - - /** - * Copies the same amount of frames from f in this, as the amount originally present, but keepsoriginal move data - * @param f frames array to copy - */ - public void changeFramesExceptForMove(ArrayList f) { - int i = 0; - boolean goOn = true; - nextFrameBuffer fb = new nextFrameBuffer(); - fb.clone(this); - this.emptyQueue(); - try{fb.goToNext();} catch(NullPointerException e) {goOn = false;} - while(goOn && i < f.size()) { - try{ - fb.current.cloneWithoutMovement(f.get(i)); - this.addFrameToQueue(fb.current); - fb.goToNext(); - i++; - } catch(NullPointerException e) { goOn = false;} - } - } - -} diff --git a/src/gameplay/match/match.java b/src/gameplay/match/match.java index 35601e3..35c0027 100644 --- a/src/gameplay/match/match.java +++ b/src/gameplay/match/match.java @@ -4,7 +4,6 @@ import engine.Engine; import engine.gui.UIElement; import engine.gui.UIElementText; import engine.gui.UIInputList; -import engine.input.Button; import engine.input.GamepadInput; import engine.math.Vector3f; import engine.object.Hitbox; @@ -14,11 +13,9 @@ import engine.object.Sprite; import gameplay.Characters.Blue.CharacterBlue; import gameplay.actions.Attack; import gameplay.actions.attackPart; -import gameplay.actions.Throw; import gameplay.actions.ThrowPart; import gameplay.entities.Status; import gameplay.frames.Frame; -import gameplay.frames.nextFrameBuffer; import gameplay.hitboxes.*; import gameplay.input.InputBuffer; import gameplay.entities.Character; @@ -28,7 +25,6 @@ import gameplay.input.ButtonIG; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; -import java.sql.SQLOutput; import java.util.ArrayList; import java.util.List; @@ -37,7 +33,6 @@ import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; import org.lwjgl.glfw.GLFW; -import org.lwjgl.system.CallbackI; import static org.lwjgl.glfw.GLFW.*;