Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Game.java
- ----------
- package myGames;
- public class Game {
- private String gameName;
- private int numPlayers;
- private boolean isWater;
- public Game(String gameName, int numPlayers, boolean isWater) {
- this.gameName = gameName;
- this.numPlayers = numPlayers;
- this.isWater = isWater;
- }
- public String getGameName() {
- return gameName;
- }
- public void setGameName(String gameName) {
- this.gameName = gameName;
- }
- public int getNumPlayers() {
- return numPlayers;
- }
- public void setNumPlayers(int numPlayers) {
- this.numPlayers = numPlayers;
- }
- public boolean isWater() {
- return isWater;
- }
- public void setWater(boolean isWater) {
- this.isWater = isWater;
- }
- }
- Country.java
- -------------
- package myGames;
- public class Country {
- private String countryName;
- private Game[] games;
- public Country(String countryName) {
- this.countryName = countryName;
- this.games = new Game[43];
- }
- public boolean isPlay(String gameName) {
- for (int i = 0; i < games.length; i += 1) {
- if (games[i].getGameName().equals(gameName))
- return true;
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement