Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class VideoGame {
- private int score;
- private String name;
- private String difficulty;
- public VideoGame() {
- this.score = 0;
- this.name = "name";
- this.difficulty = "difficulty";
- }
- public VideoGame(String name, String difficulty) {
- this.score = score;
- this.name = name;
- this.difficulty = difficulty;
- }
- public void setScore(int gameScore) {
- this.score = gameScore;
- }
- public void setName(String playerName) {
- this.name = playerName;
- }
- public void setDifficulty(String hardness) {
- this.difficulty = hardness;
- }
- public int getScore() {
- return this.score;
- }
- public String getName() {
- return this.name;
- } public String getDifficulty() {
- return this.difficulty;
- }
- public boolean checkGame(VideoGame game1, VideoGame game2) {
- boolean checker = false;
- if(game1.equals(game2)) {
- checker = true;
- }
- return checker;
- }
- public void checkScore(VideoGame game, int score1) {
- if(score1 > score) {
- game.setScore(score1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement