diff --git a/src/ei/engine/effects/ProgressBar.java b/src/ei/engine/effects/ProgressBar.java index b07aab1..7c0a32b 100644 --- a/src/ei/engine/effects/ProgressBar.java +++ b/src/ei/engine/effects/ProgressBar.java @@ -69,10 +69,8 @@ public class ProgressBar{ value.setSize(new Vector2f(((float)v/max)*width,height));//(v/max)*width value.setLocation(new Vector2f(-width/2+(((float)v/max)*width)/2,0)); - System.out.println("lol"+((float)v/max)); for(int i=0; i buildQueue; + private LinkedList buildQueue; private int buildTime; private Node unitNode; private Vector2i oldPos; @@ -80,7 +79,41 @@ public abstract class Building extends GameEntity{ InGameState.getMap().setBuildPos(this, x, y, size); } - + /** + * Adds a unit to the build queue + * @param u The unit to build + */ + public void buildUnit(Unit u){ + buildQueue.addLast(u); + } + + /** + * Returns the size of the build queue + * @return The size of the build queue + */ + public int getBuildQueueSize(){ + return buildQueue.size(); + } + + /** + * Removes the last unit in the build queue + * + */ + public void removeLast(){ + if(!buildQueue.isEmpty()){ + buildQueue.removeLast(); + } + } + + /** + * Returns the procentage of completion of the unit + * + */ + public int getBuildProgress(){ + // TODO return the procentage of completion of the unit + return 50; + } + /** * Removes this building from the game. * @@ -98,8 +131,7 @@ public abstract class Building extends GameEntity{ if(getLife()<=0) { removeBuilding(); - } - + } } }