Ejemplo n.º 1
0
  public void warcont() {
    int g = 0;
    if (mine.size() == 0) return;

    x = rand.nextInt(mine.size());
    card a = mine.get(x);
    mine.remove(x);

    if (mine.size() == 0) {
      comp.recieve(a, ID);
      return;
    }

    x = rand.nextInt(mine.size());
    card b = mine.get(x);
    mine.remove(x);
    if (mine.size() == 0) {
      comp.recieve(a, b, ID);
      return;
    }
    x = rand.nextInt(mine.size());
    card c = mine.get(x);
    mine.remove(x);
    if (mine.size() == 0) {
      comp.recieve(a, b, c, ID);
      return;
    }
    x = rand.nextInt(mine.size());
    card d = mine.get(x);
    mine.remove(x);
    comp.recieve(a, b, c, d, ID);
    while (temps.size() != 0) temps.remove(temps.size());
  }
Ejemplo n.º 2
0
 public int playcard() {
   if (mine.size() == 0) return -1; // lost condition
   x = rand.nextInt(mine.size());
   temp = mine.get(x);
   comp.submit(temp, ID);
   mine.remove(x);
   return 0;
 }
Ejemplo n.º 3
0
 public void collect() {
   aa = comp.givewinnings();
   for (int i = 0; i < aa.size(); i++) mine.add(aa.get(i));
 }