Modified Piece.java to fix any warnings and make value final.

This commit is contained in:
Jonathan Turner 2024-02-02 18:41:58 -05:00
parent 3375357755
commit 7ade1782d7
2 changed files with 12 additions and 3 deletions

View File

@ -0,0 +1,8 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ADDITIONAL_TAGS" value="postcondition,precondition" />
</inspection_tool>
</profile>
</component>

View File

@ -9,7 +9,7 @@ package Assignments.A1.models;
public class Piece {
private int loc;
private int value;
private final int value;
/**
* Creates a new piece with a specified location and value.
@ -17,8 +17,9 @@ public class Piece {
* @precondition loc >= 0 & newLoc <= 8
* & value >= 1 & value <= 8
* @postcondition the piece is created.
* @param loc
* @param value
*
* @param loc the location of the piece.
* @param value the value of the piece. (FINAL)
*/
public Piece(int loc, int value) {