Финал
This commit is contained in:
parent
41bc1ec037
commit
8737449c24
@ -6,16 +6,11 @@ public enum CountWheels{
|
||||
private CountWheels(int val){
|
||||
this.val = val;
|
||||
}
|
||||
private int countWheels;
|
||||
|
||||
public int getCountWheels(){
|
||||
return val;
|
||||
}
|
||||
public void setCountWheels(int countWheels){
|
||||
this.countWheels = countWheels;
|
||||
}
|
||||
public void setEnumValue(){
|
||||
CountWheels enumvalue = CountWheels.values()[countWheels];
|
||||
}
|
||||
|
||||
public static CountWheels fromNumberToEnum(int number) {
|
||||
try{
|
||||
for (CountWheels countWheels : CountWheels.values()) {
|
||||
|
@ -7,12 +7,21 @@ public class DrawingWheels{
|
||||
Color color;
|
||||
private CountWheels _countWheels;
|
||||
|
||||
public void setNumWheels(int numRollers) {
|
||||
if (numRollers < 4 || numRollers > 6 ){
|
||||
|
||||
_countWheels = CountWheels.fromNumberToEnum(numRollers);
|
||||
return;
|
||||
}
|
||||
_countWheels = CountWheels.fromNumberToEnum(numRollers);
|
||||
}
|
||||
|
||||
public DrawingWheels(Graphics g, int startPosX, int startPosY, Color color, int countWheels){
|
||||
this.g = g;
|
||||
_startPosX = startPosX;
|
||||
_startPosY = startPosY;
|
||||
this.color = color;
|
||||
_countWheels.setCountWheels(countWheels);
|
||||
setNumWheels(countWheels);
|
||||
}
|
||||
public void Draw(){
|
||||
switch(_countWheels){
|
||||
|
Loading…
Reference in New Issue
Block a user