deleted nextFramesBuffer class
This commit is contained in:
parent
2e67c94d40
commit
9a8e13bfb5
@ -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;
|
||||
|
@ -1,7 +1,6 @@
|
||||
package gameplay.entities;
|
||||
|
||||
import gameplay.frames.Frame;
|
||||
import gameplay.frames.nextFrameBuffer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
@ -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<Frame> 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;}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -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.*;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user