Beispiel #1
0
 public final int getCoupleIndex(int coupleId) {
   int i = 0;
   for (Couple temp : getCouples()) {
     if ((temp != null) && (temp.getId() == coupleId)) {
       return i;
     }
     i++;
   }
   return -1;
 }
Beispiel #2
0
  public void createCouple(L2PcInstance player1, L2PcInstance player2) {
    if ((player1 != null) && (player2 != null)) {
      if ((player1.getPartnerId() == 0) && (player2.getPartnerId() == 0)) {
        int player1id = player1.getObjectId();
        int player2id = player2.getObjectId();

        Couple couple = new Couple(player1, player2);
        getCouples().add(couple);
        player1.setPartnerId(player2id);
        player2.setPartnerId(player1id);
        player1.setCoupleId(couple.getId());
        player2.setCoupleId(couple.getId());
      }
    }
  }