Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Calculator {
- class Score{
- int score;
- int playerId;
- }
- class RatingCalculator extends Score {
- ArrayList<CalculatorForBoxing> newGame;
- public CalculatorForBoxing boxer1;
- public CalculatorForBoxing boxer2;
- ArrayList<Integer> getScores(){
- return myArrayList;
- }
- }
- class CalculatorForBoxing extends RatingCalculator implements RateByAccumulatingPoints {
- int forbiddenKicks;
- int successfullKicks;
- public CalculatorForBoxing (int playerId, int score, int forbiddenKicks, int successfullKicks ) {
- this.playerId = playerId;
- this.score = score;
- this.forbiddenKicks = forbiddenKicks;
- this.successfullKicks = successfullKicks;
- }
- public void setPlayerId(int playerId) {
- this.playerId = playerId;
- }
- public int getPlayerId() {
- return playerId;
- }
- public void setScore(int score) {
- this.score = score;
- }
- public int getScore() {
- return score;
- }
- @Override
- public void addPoints(int playerId, int points) {
- //some code
- }
- }
- interface RateByAccumulatingPoints {
- void addPoints(int playerId, int points );
- }
- class Judge extends RatingCalculator {
- // here my simple scenario;
- void rate(RatingCalculator rc){
- newGame = new ArrayList<CalculatorForBoxing>();
- newGame.add(boxer1 = new CalculatorForBoxing(01, 0, 0, 4));
- newGame.add(boxer2 = new CalculatorForBoxing(02, 0, 0, 5));
- newGame.addPoints(01, 20); //haven't access here
- newGame.getScores(); //haven't access here
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement