package server;


public class BombFactory implements Runnable{
	
	private Player player;
	private GameBoard board;
	
	BombFactory(Player player, GameBoard board){
		this.player = player;
		this.board = board;
	}

	@Override
	public void run() {
		// TODO Auto-generated method stub
		System.out.println("Bomb placed");
		int tempx, tempy;
		//int constx, consty;
		synchronized (board) {
			tempx = player.getXPosition();
			tempy = player.getYPosition();
			board.placeBombAndPlayer(player);
		}
		
		try {
			Thread.sleep(2000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println("Bomb exploded");
		synchronized (board) {board.placeExplosion(tempx, tempy, player);}
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		/*
		while(1){
			constx = player.getXposition();
			consty = player.getYposition();
			if (constx == tempx && consty == tempy)
			{
				player.setLives(getLives() - 1);
				if(player.getLives() == 0)
				{
					System.out.println("The player has lost all lives. Game will terminate");
					//Begin termination sequence code.
				}
			}
		}
		*/
		synchronized (board) {
			board.removeExplosion(tempx, tempy, player);
			//player.setBombs(player.getBombs()+1);
		}
		//System.out.println(player.getBombs());
	}
}

@@ -124,118 +124,493 @@
 %09%0D%0A%09
-BombFactory(Player player, GameBoard board)%7B%0D%0A%09%09this.player = player;%0D%0A%09%09this.board = board;%0D%0A%09%7D%0D%0A%0D%0A%09@Override
+/**%0D%0A%09 * Assigns paramaters to the variables intialized in the field.%0D%0A%09 * @param player, Player%0D%0A%09 * @param board, GameBoard%0D%0A%09 */%0D%0A%09BombFactory(Player player, GameBoard board)%7B%0D%0A%09%09this.player = player;%0D%0A%09%09this.board = board;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09/**%0D%0A%09 * Places bomb at specific x and y position on the gameboard%0D%0A%09 * wherever the players position is current. Shows the gif for the bomb%0D%0A%09 * exploding and then removes the gif after a certain amount%0D%0A%09 * of time having elapsed.%0D%0A%09 */
 %0D%0A%09p

Update BombFactory.java