cleared up game.java
This commit is contained in:
		
					parent
					
						
							
								c25886d72d
							
						
					
				
			
			
				commit
				
					
						c32314b787
					
				
			
		
					 1 changed files with 1 additions and 10 deletions
				
			
		|  | @ -3,11 +3,11 @@ package de.lunarakai.minecleaner.game; | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
| import org.joml.Vector2i; | import org.joml.Vector2i; | ||||||
| import de.lunarakai.minecleaner.MinecleanerPlugin; | import de.lunarakai.minecleaner.MinecleanerPlugin; | ||||||
| import de.lunarakai.minecleaner.utils.MathUtils; |  | ||||||
| 
 | 
 | ||||||
| public class Game { | public class Game { | ||||||
|     public boolean gameover; |     public boolean gameover; | ||||||
| 
 | 
 | ||||||
|  |     @SuppressWarnings("unused") | ||||||
|     private MinecleanerPlugin plugin;  |     private MinecleanerPlugin plugin;  | ||||||
|     private int width; |     private int width; | ||||||
|     private int height; |     private int height; | ||||||
|  | @ -15,7 +15,6 @@ public class Game { | ||||||
| 
 | 
 | ||||||
|     private Cell[][] state; |     private Cell[][] state; | ||||||
|     private Board board; |     private Board board; | ||||||
|     private BoardSize boardSize; |  | ||||||
|     private Tilemap tilemap; |     private Tilemap tilemap; | ||||||
| 
 | 
 | ||||||
|     private ArrayList<Cell> floodedCells; |     private ArrayList<Cell> floodedCells; | ||||||
|  | @ -31,10 +30,6 @@ public class Game { | ||||||
|         this.explodedCells = new ArrayList<>(); |         this.explodedCells = new ArrayList<>(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private void onValidate() { |  | ||||||
|         mineCount = MathUtils.clamp(mineCount, 0, width*height); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     public void start() { |     public void start() { | ||||||
|         board = new Board(); |         board = new Board(); | ||||||
|         newGame(); |         newGame(); | ||||||
|  | @ -150,8 +145,6 @@ public class Game { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         //boolean hitMine = false; |  | ||||||
| 
 |  | ||||||
|         switch (cell.getType()) { |         switch (cell.getType()) { | ||||||
|             case Mine: { |             case Mine: { | ||||||
|                 explode(cell); |                 explode(cell); | ||||||
|  | @ -188,7 +181,6 @@ public class Game { | ||||||
|         floodedCells.add(cell); |         floodedCells.add(cell); | ||||||
|         state[cell.position.x][cell.position.y] = cell;     |         state[cell.position.x][cell.position.y] = cell;     | ||||||
| 
 | 
 | ||||||
|         // this looks bad, i should probably go to the doctor with it D:  |  | ||||||
|         if(cell.getType() == Cell.CellType.Empty) { |         if(cell.getType() == Cell.CellType.Empty) { | ||||||
|             if(isValid(cell.position.x -1, cell.position.y)) { |             if(isValid(cell.position.x -1, cell.position.y)) { | ||||||
|                 flood(getCell(cell.position.x -1, cell.position.y)); |                 flood(getCell(cell.position.x -1, cell.position.y)); | ||||||
|  | @ -205,7 +197,6 @@ public class Game { | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             // Corners |             // Corners | ||||||
|             // Todo: oben links geht nicht |  | ||||||
|             if(isValid(cell.position.x + 1, cell.position.y +1)) { |             if(isValid(cell.position.x + 1, cell.position.y +1)) { | ||||||
|                 flood(getCell(cell.position.x +1, cell.position.y +1)); |                 flood(getCell(cell.position.x +1, cell.position.y +1)); | ||||||
|             } |             } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue