Ejemplo n.º 1
0
 public void makeAvatarOrder(String sOrder) {
   String[] sTemp = sOrder.split("\\|");
   String[] sTemp2;
   listChar = new Avatar[sTemp.length];
   for (int i = 0; i < listChar.length; i++) {
     sTemp2 = sTemp[i].split(",");
     if (sTemp2[0].equals("A")) listChar[i] = oParty.getAvatar(Integer.parseInt(sTemp2[1]));
     else listChar[i] = oOpponentParty.getAvatar(Integer.parseInt(sTemp2[1]));
   }
 }
Ejemplo n.º 2
0
  public static void main(String args[]) throws Exception {
    int testCases = Integer.parseInt(in.readLine());
    for (int i = 0; i < testCases; i++) {
      StringTokenizer tokenizer = new StringTokenizer(in.readLine());
      int n = Integer.parseInt(tokenizer.nextToken());

      Party party = new Party();
      for (int j = 0; j < n; j++) {
        Person person = new Person(j);
        tokenizer = new StringTokenizer(in.readLine());
        while (tokenizer.hasMoreTokens()) person.add(Integer.parseInt(tokenizer.nextToken()));

        party.invite(person);
      }

      output(party);
      out.println();
    }

    out.flush();
  }
Ejemplo n.º 3
0
 public void phase4() {
   System.out.println("Phase 4");
   lblStatus1.setText("Main Phase");
   lblStatus2.setText("Assigning AT...");
   lblStatus3.setText("");
   for (int i = iChar; i < listChar.length; iChar = ++i) {
     System.out.println(listChar[i]);
     if (listChar[i].isATReady()) {
       oActiveAvatar = listChar[i];
       oActiveAvatar.giveAT();
       lblStatus3.setText(oActiveAvatar.getName() + "'s AT");
       if (oParty.contains(oActiveAvatar)) stateAT();
       else stateWaiting();
       return;
     }
   }
   phase1();
 }
Ejemplo n.º 4
0
 public static void output(Party party) throws Exception {
   out.print(party.getWaysToParty());
 }