Package game.slot

Examples of game.slot.Sum


      playerXStats.add(sixes);
      Bonus bonus = new Bonus(ones, twos, threes, fours, fives, sixes, "Upper bonus", 50);
      playerXStats.add(bonus);

      //Add the intermediate summing slot
      Sum intermediate = new Sum(1, "Intermediate sum", 105);
      playerXStats.add(intermediate);
     
      //Add the lower section score slots
      Pair onePair = new Pair("One pair", 12);
      playerXStats.add(onePair);
      TwoPair twoPair = new TwoPair("Two pairs", 22);
      playerXStats.add(twoPair);
      XOAK threeOfAKind = new XOAK(3, "Three of a kind", 18);
      playerXStats.add(threeOfAKind);
      XOAK fourOfAKind = new XOAK(4, "Four of a kind", 24);
      playerXStats.add(fourOfAKind);
      SmallStraight small = new SmallStraight("Small straight", 15);
      playerXStats.add(small);
      LargeStraight large = new LargeStraight("Large Straight", 20);
      playerXStats.add(large);
      House house = new House("House", 28);
      playerXStats.add(house);
      Chance chance = new Chance("Chance", 30);
      playerXStats.add(chance);
      Yahtzee yahtzee = new Yahtzee("Yahtzee", 50);
      playerXStats.add(yahtzee);
     
      //Add the final summing slot
      Sum total = new Sum(2, "Final sum", 374);
      playerXStats.add(total);
     
      gameSheetContents.add(playerXStats);
    }
  }
View Full Code Here


   * in the sheet. <br />After updating the "Intermediate sum" slot, the method also checks whether an uppersection bonus
   * should be applied.
   */
  public void updateSums(){
    for(ArrayList<AbstractScoreSlot> playerXStats : gameSheetContents){
      Sum intermediate = (Sum)playerXStats.get(INTERMEDIATE_SUM);
      Sum total = (Sum)playerXStats.get(TOTAL_SUM);
      Bonus bonus = (Bonus)playerXStats.get(UPPERSECTION_BONUS);

      intermediate.resetScoreSum();
      total.resetScoreSum();

      for(int i = 0; i < UPPERSECTION_END; i++){
        intermediate.addScoreToSlot(playerXStats.get(i).getSlotScore());
      }
     
      bonus.addScoreToSlot(null); //Check whether a bonus should be applied after updating the intermediate sum slot
     
      for(int i = 0; i < LOWER_SECTION_END; i++){
        if(i == INTERMEDIATE_SUM)continue;
        total.addScoreToSlot(playerXStats.get(i).getSlotScore());
      }
//      printGameSheetContents(); V�tsin maha, kuna v�ljastas serveris.
    }
  }
View Full Code Here

TOP

Related Classes of game.slot.Sum

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.