added a method for getting a piece through a uuid
This commit is contained in:
		@@ -144,6 +144,22 @@ public Piece getPieceThroughIdentifier(String identifier){
 | 
				
			|||||||
        return board.getPlayerData().get(Color.valueOf(parts[0])).getPieces()[Integer.parseInt(parts[1])];
 | 
					        return board.getPlayerData().get(Color.valueOf(parts[0])).getPieces()[Integer.parseInt(parts[1])];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * This method will be used to return a piece based on the UUID.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return the piece specified by the UUID
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public Piece getPieceThroughUUID(UUID pieceId){
 | 
				
			||||||
 | 
					        for (var playerData : board.getPlayerData().values()) {
 | 
				
			||||||
 | 
					            for (var piece : playerData.getPieces()) {
 | 
				
			||||||
 | 
					                if (piece.getUuid().equals(pieceId)) {
 | 
				
			||||||
 | 
					                    return piece;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        return null;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * This method notifies the observers.
 | 
					     * This method notifies the observers.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user