Esempio n. 1
0
 @Override
 public void offerExecuted(Offer offPicked) {
   int[] aintOffer = offPicked.getOffer();
   int[] aintDesire = offPicked.getDesire();
   for (int intColorIndex = 0; intColorIndex < intColorNum; intColorIndex++) {
     aintInHand[intColorIndex] += aintDesire[intColorIndex] - aintOffer[intColorIndex];
   }
 }
Esempio n. 2
0
  @Override
  public void offer(Offer offTemp) {
    G1Player.printArray(info.getAintInHand(), "after eating - info.getAintInHand():");
    int[] aintOffer = new int[info.getIntColorNum()];
    int[] aintDesire = new int[info.getIntColorNum()];
    offerStrategy.getOffer(aintOffer, aintDesire, info);

    G1Player.printArray(aintOffer, "aintOffer");
    G1Player.printArray(aintDesire, "aintDesire");
    offTemp.setOffer(aintOffer, aintDesire);
  }
Esempio n. 3
0
  public void offer(Offer offTemp) {
    System.out.println("What do you offer? (" + intColorNum + " colors)");
    String strOffer = Game.scnInput.nextLine();
    String[] astrOffer = strOffer.split(",");
    System.out.println("What do you desire? (" + intColorNum + " colors)");
    String strDesire = Game.scnInput.nextLine();
    String[] astrDesire = strDesire.split(",");

    int[] aintTempOffer = new int[intColorNum];
    int[] aintTempDesire = new int[intColorNum];

    for (int intColorIndex = 0; intColorIndex < intColorNum; intColorIndex++) {
      aintTempOffer[intColorIndex] = Integer.parseInt(astrOffer[intColorIndex]);
      aintTempDesire[intColorIndex] = Integer.parseInt(astrDesire[intColorIndex]);
    }
    offTemp.setOffer(aintTempOffer, aintTempDesire);
  }