Skip to content

Commit

Permalink
Add all things in the circus
Browse files Browse the repository at this point in the history
  • Loading branch information
okkhoy committed Feb 3, 2023
1 parent 3f3b8ed commit 6b52a82
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/Cannon.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public class Cannon extends Equipment {

public Cannon(int purchasePrice) {
super(purchasePrice);
}

@Override
public int getValue() {
return purchasePrice / 3;
}
}
11 changes: 11 additions & 0 deletions src/main/java/Equipment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public abstract class Equipment {
protected int purchasePrice;

public Equipment(int purchasePrice) {
this.purchasePrice = purchasePrice;
}

public int getValue() {
return purchasePrice;
}
}
11 changes: 11 additions & 0 deletions src/main/java/Ladder.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public class Ladder extends Equipment {

public Ladder(int purchasePrice) {
super(purchasePrice);
}

@Override
public int getValue() {
return purchasePrice / 2;
}
}

0 comments on commit 6b52a82

Please sign in to comment.